Record R := C { p : nat }. (* R is defined
p is defined *)
Unset Primitive Projections.
Record R' := C' { p' : nat }.
Fail Definition f := fix f (x : R) : nat := p x. (** Not allowed to make fixpoint defs on (non-recursive) records
having eta *)
Fail Definition f := fix f (x : R') : nat := p' x. (** Even without eta (R' is not primitive here), as long as they're
found to be BiFinite (non-recursive), we disallow it *)
(*
(* Subject reduction failure example, if we allowed fixpoints *)
Set Primitive Projections.
Record R := C { p : nat }.
Definition f := fix f (x : R) : nat := p x.
(* eta rule for R *) Definition Rtr (P : R -> Type) x (v : P (C (p x))) : P x
:= v.
Definitiongoal := forall x, f x = p x.
(* when we compute the Rtr away typechecking will fail *) Definition thing : goal := fun x =>
(Rtr (fun x => f x = p x) x (eq_refl _)).
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 und die Messung sind noch experimentell.