Eval vm_compute in pmap pid (pcons true (pcons false pnil)). Eval vm_compute in pmap (fun x => match x with
| pnil => true
| pcons _ _ => false end) (pcons pnil (pcons (pcons false pnil) pnil)). Eval vm_compute in pmap (fun x => x -> Type) (pcons tbool (pcons (plist tbool) pnil)).
Polymorphic Inductive Tree@{i} (T : Type@{i}) : Type@{i} :=
| Empty
| Branch : plist@{i} (Tree T) -> Tree T.
Polymorphic Definition pfold@{i u}
{T : Type@{i}} {U : Type@{u}} (f : T -> U -> U) := fix pfold (acc : U) (ls : plist@{i} T) : U := match ls with
| pnil => acc
| pcons a b => pfold (f a acc) b end.
Polymorphic Inductive nat@{i} : Type@{i} :=
| O
| S : nat -> nat.
Polymorphic Fixpoint nat_max@{i} (a b : nat@{i}) : nat@{i} := match a , b with
| O , b => b
| a , O => a
| S a , S b => S (nat_max a b) end.
Polymorphic Fixpoint height@{i} {T : Type@{i}} (t : Tree@{i} T) : nat@{i} := match t return nat@{i} with
| Empty _ => O
| Branch _ ls => S@{i} (pfold@{i i} nat_max O (pmap height ls)) end.
Polymorphic Fixpointrepeat@{i} {T : Type@{i}} (n : nat@{i}) (v : T) : plist@{i} T := match n return plist@{i} T with
| O => pnil
| S n => pcons@{i} v (repeat n v) end.
Polymorphic Fixpoint big_tree@{i} (n : nat@{i}) : Tree@{i} nat@{i} := match n with
| O => @Empty nat@{i}
| S n' => Branch@{i} nat@{i} (repeat@{i} n' (big_tree n')) end.
Evalcompute in height (big_tree (S (S (S O)))).
#[local] Definition big := S (S (S (S (S O)))).
Polymorphic Definition really_big@{i} := (S@{i} (S (S (S (S (S (S (S (S (S O)))))))))).
TimeDefinition _5 : height (@Empty nat) = O :=
@eq_refl nat O <: height (@Empty nat) = O.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.