Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine_struct not working as advertised? #160

Closed
semorrison opened this issue Jun 20, 2018 · 8 comments
Closed

refine_struct not working as advertised? #160

semorrison opened this issue Jun 20, 2018 · 8 comments

Comments

@semorrison
Copy link
Collaborator

The example in comments for refine_struct suggests using refine_struct ({ .. } : semigroup α), but I can't get this to work.

Here's my MWE:

import tactic.interactive

variable (α : Type)
def foo : semigroup α := 
begin
  refine_struct ({ .. } : semigroup α),
end

This just says failed at the refine_struct. Instead I expected it to give me two tagged goals.

@spl
Copy link
Collaborator

spl commented Jun 20, 2018

@cipher1024 says: “Yeah, refine_struct is not particularly tolerant. It only accepts a literal record. It infers semigroup from the goal.”

@cipher1024
Copy link
Collaborator

cipher1024 commented Jun 20, 2018

The goal is for refine_struct to eventually implement a superset of the features of refine.

@cipher1024
Copy link
Collaborator

Would refine_struct { .. } work for you?

@cipher1024
Copy link
Collaborator

cipher1024 commented Jun 20, 2018

I had a few minutes so I implemented the following:

def my_foo {α} (x : semigroup α) (y : group α) : true := trivial

example {α : Type} : true :=
begin
  refine_struct (@my_foo α { .. } { .. } ),
    -- 9 goals
    -- case semigroup, mul
    -- α : Type
    -- ⊢ α → α → α

    -- case semigroup, mul_assoc
    -- α : Type
    -- ⊢ ∀ (a b c : α), a * b * c = a * (b * c)

    -- case group, mul
    -- α : Type
    -- ⊢ α → α → α

    -- case group, mul_assoc
    -- α : Type
    -- ⊢ ∀ (a b c : α), a * b * c = a * (b * c)

    -- case group, one
    -- α : Type
    -- ⊢ α

    -- case group, one_mul
    -- α : Type
    -- ⊢ ∀ (a : α), 1 * a = a

    -- case group, mul_one
    -- α : Type
    -- ⊢ ∀ (a : α), a * 1 = a

    -- case group, inv
    -- α : Type
    -- ⊢ α → α

    -- case group, mul_left_inv
    -- α : Type
    -- ⊢ ∀ (a : α), a⁻¹ * a = 1

end

That should cover it :)

@cipher1024
Copy link
Collaborator

See: #162

@cipher1024
Copy link
Collaborator

cipher1024 commented Jun 20, 2018

Should we rename the tactic to refine' since it overlaps so much with the purpose of refine?

@spl
Copy link
Collaborator

spl commented Jun 21, 2018

Since #162 has been merged, can we close this issue?

@cipher1024
Copy link
Collaborator

cipher1024 commented Jun 21, 2018

I would say so. Let's see if that satisfies @semorrison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants