Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Equations by WellFounded ad hoc measure

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Equations by WellFounded ad hoc measure


Chronological Thread 
  • From: manoury <pascal.manoury AT lip6.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Equations by WellFounded ad hoc measure
  • Date: Thu, 28 Oct 2021 12:05:26 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pascal.manoury AT lip6.fr; spf=Pass smtp.mailfrom=pascal.manoury AT lip6.fr; spf=Pass smtp.helo=postmaster AT osiris.lip6.fr
  • Ironport-hdrordr: A9a23:WtMOba1Nf/rolsQpD1zseAqjBL8kLtp133Aq2lEZdPU1SL3+qynKpp4mPHDP+VUssR0b+exoW5PgfZq/z+8W3WB5B97LNzUO01HYSb2Kg7GSpwEI2BeTygee78pdmmRFZ+EYxGIVsfrH
  • Ironport-phdr: A9a23:LUTEjBbqyv+e4D/Lz3YmKtn/LTHE0IqcDmcuAnoPtbtCf+yZ8oj4OwSHvLMx1gePDNyQtq0MotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+5YHfbx9MiTagbr9/LBe7phjNu8cLhodvNrw/wQbTrHtSfORWy2JoJVaNkBv5+8y94p1t/TlOtvw478JPXrn0cKo+TbxDETQpKHs169HxtRnCVgSA+H0RWXgLnxVSAgjF6Bb6Xortsib/q+Fw1jWWMdHwQLspXzmp8qVlRwLyiCofNzA27G7ZhcNtgqxVrhKvuR5wzY3TboyOKPp+Z6bdcc8aRWZdXMtcUTFKDIOmb4sICuoMJeNYoJP7p1sJsBu+HwmtD/7oxz9QnHD2xrE13P4lEQ3c2QwvBdQOsHPJrNXvNKYfSuS1zKjQzTjCdf9W1y395ZHOfxs8rv6CQah+ftDNyUkzCQzFlFOQpJTlMT2VyOkAsnWW4/Z8WOyhiWMppA9/rzevy8kihITEmJwZx1TK+Clnzos4J9O2RUFlbdOmEJZdtT2XOpdqTs4/RWxjpSg0yroDuZGhfSgKzowqxwXDa/Odb4eI4RXjVPiPLjdiinJlfLW/hhio/Ue8ze38U8+520tJoCpditTAq34A2wLJ5sSZVPdw/F2t1DeT2wzJ5OxIPVg4mbfVJpI/2LI8iIQfvEbZEiL1mEj6lq6be0si9+O18eroeK/mqYWZN4JsigHxLKAumsunDOQ/KQgOXnKb+eWn1LH5+U35Qa1Kg/wsnqnXqpDWPcUbpqinDA9Jyosv9hiyAym83NgGg3UKLkhJdRObg4TzNVzCPOj0DfKljFStlDdryerGPrrkApjVNnjMiqzhcqpn5E5Y0gYzyMpQ55RTCrEcOvLyWlT8tNjZDh8hMgG42ejnCM9l2oMERW2PGrOZML/VsVKQ+u0vJPCMaJYJtzb5Nvgq/OXjjWQ5mF8YZammx4EbaHG+HvR8IkWWe2DggtkbETRCgg1rR+vzzVaGTDR7ZnCoXqt66CtoJpihCNLGT4aqnaaQlHOjF4Zdb2QAD1mKFmryZq2AWu9SLiyIdJwy2gcYXKSsHtdynSqlsxX3nuIPxgX8/iwA69TtzoosjwU2vRUz7WIyAd7PiwllrklzhWISRiRw2KFn/wpz0AXauZU=

It works !

Pascal.

> Le 28 oct. 2021 à 09:47, manoury <pascal.manoury AT lip6.fr> a écrit :
>
> Thank you Yves for this pointer. It seems sound. I’ll try it and tell you
> about the result.
>
> Pascal.
>
>> Le 27 oct. 2021 à 19:32, Yves Bertot <Yves.Bertot AT inria.fr> a écrit :
>>
>> I had the same problem last week!
>>
>> If you proved a statement of the form well_founded it is not sufficient.
>> You must add an instance in the class WellFounded.
>>
>> See https://stackoverflow.com/a/69678500/1809211
>>
>> You did not give enough information in your question, so I am not sure
>> this will be enough for you.
>>
>> Yves
>> ----- Original Message -----
>>> From: "manoury" <pascal.manoury AT lip6.fr>
>>> To: "coq-club" <coq-club AT inria.fr>
>>> Sent: Wednesday, October 27, 2021 5:01:40 PM
>>> Subject: [Coq-Club] Equations by WellFounded ad hoc measure
>>
>>> I defined for binary trees the following measure
>>>
>>> --
>>> Definition bt_mesure {A:Set} (bt:btree A) : (nat * nat) :=
>>> match bt with
>>> Empty => (0,0)
>>> | Node _ bt1 _ => (btree_size bt, btree_size bt1)
>>> end.
>>> —
>>>
>>> where tree_size is the usual
>>>
>>> --
>>> Fixpoint btree_size {A:Set} (bt:btree A) : nat :=
>>> match bt with
>>> Empty => 0
>>> | Node x bt1 bt2 => S (btree_size bt1 + btree_size bt2)
>>> end.
>>> —
>>>
>>> I proved that lexicographic ordering of pairs of natural (I call it
>>> nat_lex_lt)
>>> is well founded.
>>> Then I try the following:
>>>
>>> --
>>> Equations list_of_btree {A:Set} (bt:btree A) : (list A) by wf (bt_mesure
>>> bt)
>>> nat_lex_lt :=
>>> list_of_btree Empty := nil;
>>> list_of_btree (Node x Empty bt) := x::(list_of_btree bt);
>>> list_of_btree (Node x1 (Node x2 bt1 bt2) bt3) :=
>>> (list_of_btree (Node x1 bt1 (Node x2 bt2 bt3))).
>>> —
>>>
>>> And I get the following:
>>>
>>> --
>>> Error:
>>> Unable to satisfy the following constraints:
>>>
>>> ?w : "WellFounded
>>> (Telescopes.tele_measure
>>> (Telescopes.ext Set (fun A : Set => Telescopes.tip (btree A)))
>>> (nat * nat) (fun (A : Set) (bt : btree A) => bt_mesure bt)
>>> nat_lex_lt)"
>>> —
>>>
>>> Any hint ? Thanks !
>>>
>>> Pascal Manoury.
>




Archive powered by MHonArc 2.6.19+.

Top of Page