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: Yves Bertot <yves.bertot AT inria.fr>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Equations by WellFounded ad hoc measure
  • Date: Wed, 27 Oct 2021 19:32:52 +0200 (CEST)
  • Ironport-data: A9a23:cd3x76CRIkkBhBVW/xjhw5YqxClBgxIJ4g17XOLfV1G/1GkqhD0DxmccX2mPPPqMYTH8edxzao2//U4E7MeAx9UxeLYW3SE0HigS8aIpJvzAcxyuZ3vKRiH7ofMOA/w2MrEsF+hpCC+DzvuRGuK59yAljfvXHuCU5NPsYUideyc0EE/Ntjo4w4bVsqYw6TSIK1vlVeHa+6UzC3f5s9JACV/43orYwP9ZUFsejxtD1rA2TagjUFYzDBD5BrpHTU26ByOQroW5goeHq+j/ILGRpgs1/j8/Acjgiar8aEBXBL/UJwmHzHRMM0SgqkEY9mpjieBiaKBaMh0/Zzahx7idzP1cq5GrDw0kJLHLhMwcVQNZGmdwJ8Wq/ZeXeSnm7pD7I0ruNiGEL+9VJEoxJMgT/vt9KXpf8OQRbjELdBGKweysqI9X4MEEat8LPsLweZgDvWttkHfYC+wnSNbNWc33CRZj9G9Yrqhz8Tz2PKL1ogaDoPgNj9Oj97vX5F8DcD+Uu0TC
  • Ironport-hdrordr: A9a23:QBPQe6BmKRNDl67lHemr55DYdb4zR+YMi2TDsHoBKyC9E/bo9PxG885x6faZslwssTQb9uxoW5PhfZq/z/JICOAqVN+ftUvd1ldAR7sC0WKW+UyHJ8SIzJ876U4PScVD4aXLfDxHZJHBkWyFL+o=

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