coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Destructing a term whose body is important
- Date: Wed, 6 Sep 2017 11:17:22 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga09.intel.com
- Dlp-product: dlpe-windows
- Dlp-reaction: no-action
- Dlp-version: 11.0.0.116
- Ironport-phdr: 9a23:pb8uPRz6uRiVHVLXCy+O+j09IxM/srCxBDY+r6Qd0uMXIJqq85mqBkHD//Il1AaPBtqLra8cw8Pt8IneGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2NBXupSj45jkLXx77KABdJ+LvG4eUgd79n7S5/ISWaAFVjhK8Z6lzJVO4t1OCmNMRhN4oEaE8xQfTpWMMM8FXzmNhKFbZ10L558yw9ZNntT9Xtv097clYeaT8Y6k8C7dfCWJ1YCgO+MT3uEybHkO07XwGXzBOnw==
Dear Igor,
a few advices:
-
In case you use a dependent type e.g. for a sorted tree and have the sorted property as dependent type, have a type with and without this property,
do the proofs of the sortedness with the type without the property and put the dependent type together using these lemmas in the end. Induction on dependent types is usually the harder way. - When handling data structures I frequently prove some lemmas which can be used as induction scheme on these data structures. E.g. for lists it helps to prove that you can also do induction by appending to the end:
Theorem induction_list_append_rev : forall (t : Type) (p : list t -> Type), p [] -> (forall (x : t) (l : list t), p l -> p (l ++ [x])) -> forall l : list t, p l.
In your case you might want to prove induction lemmas, which take whatever dependent property you have into account and use these when
doing your program proof obligations. Otherwise you keep repeating possibly complicated proofs. Such lemmas can be applied with “induction x using lemma”. As stated before I would prove such lemmas with a non-dependent type.
-
Your example is not that useful. The obvious solution is to prove a lemma that if sprev n = Some n0 then n=n0+1 and use it. It is difficult to see what
your actual problem is in this example. Give an example which is closer to the real problem you have. Best regards,
Michael
P.S.:
I guess you know that you can get access to the variable instantiation equation done be destruct with: destruct (sprev n) eqn:Hdest This gives you Hdest : sprev n = Some n0 and on this you can use e.g. a lemma that then n=n0+1. I think this is all you could possibly get from destructing (sprev
n).
Intel Deutschland GmbH |
- [Coq-Club] Destructing a term whose body is important, Igor Jirkov, 09/06/2017
- RE: [Coq-Club] Destructing a term whose body is important, Soegtrop, Michael, 09/06/2017
Archive powered by MHonArc 2.6.18.