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

Question About Assignment12_06 #153

Open
amityaffliction opened this issue Jun 13, 2015 · 9 comments
Open

Question About Assignment12_06 #153

amityaffliction opened this issue Jun 13, 2015 · 9 comments

Comments

@amityaffliction
Copy link

I know tloop is infinite so resulting x from tloop will also take step

I tried to prove directly but failed and tried to solve some properties with progress, stuck, preservation

after digging I got into this state. with these properties I tried to prove it

but keep stuck when (value x) in the context. will there be better approach then this??

or am I missing some lemma to assert to get to the goal?

x : tm
A : tapp tloop (tnat 0) ==>* x
B : ~ (exists t' : tm, x ==> t')
C : \empty |- tapp tloop (tnat 0) \in TNat
D : \empty |- x \in TNat
E : value x / (exists t' : tm, x ==> t')
F : normal_form step x /\ ~ value x -> False (that is, x is not stuck)
______________________________________(1/1)
False

@jaewooklee93
Copy link

Well.. In the case of my solution, I didn't use any of progress, stuck, preservation concept, but I used one remember and very delicate assert twice.

@amityaffliction
Copy link
Author

Thank you for answering! could you give me little more informal intuition on the property that you asserted? I'm really stuck and can't make progress

@jaewooklee93
Copy link

Actually, informal idea of proof is devastingly trivial. The problem is how to represent that idea in Coq formally.

[Informal Proof]
Let p = tapp tloop (tnat 0), there exist q, r such that p ==> q ==> r ==> p.
Thus, p ==>* t implies t = p or q or r. Therefore, t is not a normal form.

@amityaffliction
Copy link
Author

Oh!! so (tapp tloop (tnat 0)) has only few forms before getting back to original one and proving by existential quantification. I carelessly thought there would be so many of internal forms. proving this way is so clever! thank you

@amityaffliction
Copy link
Author

When proving p ==>* t implies t = p or q or r. trouble arise when p==>t is in context.
it's easy to show "p multi steps to some t" but when it is in the context,
it seems unsolvable either by inversion or induction.
for example, when H: p ==> * t, inversion/induction on H or t won't get any useful things..
I wonder if there is some tactics for coq to infer something from p ==>
t ..
and is this provable without some deterministic property lemma?

@jaewooklee93
Copy link

Yes, it is related to the deterministic property, or more precisely, the uniqueness of q and r. (If q is not unique, p ==> t doesn't implies t = q.) But I didn't directly prove or use the general deterministic Lemma itself. (It is truly overkill.) I only proved determinism for p,q,r using assert.

Well.. I agree that this problem is really difficult. As I mentioned above, the real problem is how to represent such informal idea in Coq.

@amityaffliction
Copy link
Author

After proving determinism, I tried to prove "p ==>* t implies t = p or q or r" part,
but cant figure out what tactic should be used. inversion on p==>*t and following hypothesis will
unfold infinitely and not exactly sure it is solvable with induction. I keep get not powerful Inductive Hypothesis. I think keep inversion on H and at some point, I should be able to prove within context that it circulates. but it seems it's not reachable with inversion or induction... is it related with remember tactic?? asdlkfjasdlkfasdf T_T

@rhs0266
Copy link

rhs0266 commented Jun 15, 2015

I also found p, q, r. But how can prove t=p or q or r? I am trying to proof with assert (t=p or t=q or t=z), but it is quite difficult assertion... Fall into the infinite circulation @_@

@jaewooklee93
Copy link

Yes.. I've also tried it with simple induction, but never succeeded.

With remember, you can define your own predicate like this.
remember (fun n => exists k, n = 5 * k + 1) as P.

And then you can use your predicate as invariant.
assert (forall n m, m = n + 5 -> P n -> P m).

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