Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] termination when branching with fmaps

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] termination when branching with fmaps


Chronological Thread 
  • From: Laurent Thery <Laurent.Thery AT inria.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] termination when branching with fmaps
  • Date: Fri, 19 Feb 2021 18:07:02 +0100


Hi,

> Finite maps are based on finite functions which allow such nested
definitions,
> You can find an example in the doc:

There is actually an example about tree in the header

https://github.com/math-comp/math-comp/blob/17dd3091e7f809c1385b0c0be43d1f8de4fa6be0/mathcomp/ssreflect/finfun.v#L24

the depth function is simply:

Inductive tree : Type := node n of tree ^ n.
Fixpoint depth (t : tree) : nat :=
match t with node n br => (\max_(i <- codom (depth \o br)) i).+1
end.

--
Laurent



Archive powered by MHonArc 2.6.19+.

Top of Page