(* Functions inside the array *) Definition t3 : array (nat -> nat) := [| fun x => x | fun x => O |]. Definition foo21 := (eq_refl : t3.[0] 2 = 2). Definition foo22 := (eq_refl 2 <: t3.[0] 2 = 2). Definition foo23 := (eq_refl 2 <<: t3.[0] 2 = 2). Definition x9 := Evalcompute in t3.[0] 2. Definition foo24 := (eq_refl : x9 = 2). Definition x10 := Eval cbn in t3.[0] 2. Definition foo25 := (eq_refl : x10 = 2).
Ltac check_const_eq name constr := let v := (eval cbv delta [name] in name) in
tryif constr_eq v constr thenidtac else fail 0 "Not syntactically equal:" name ":=" v "<>" constr.
Notation check_const_eq name constr := (ltac:(check_const_eq name constr; exact constr)) (only parsing).
(* Stuck primitive *) Definition lazy_stuck_get := Eval lazy in (fun A (t : array A) => t.[0]). Definition vm_stuck_get := Eval vm_compute in (fun A (t : array A) => t.[0]). Definition native_stuck_get := Eval native_compute in (fun A (t : array A) => t.[0]). Definition compute_stuck_get := Evalcompute in (fun A (t : array A) => t.[0]). Definition cbn_stuck_get := Eval cbn in (fun A (t : array A) => t.[0]).
Check check_const_eq lazy_stuck_get (fun A (t : array A) => t.[0]). Check check_const_eq vm_stuck_get (fun A (t : array A) => t.[0]). Check check_const_eq native_stuck_get (fun A (t : array A) => t.[0]). Check check_const_eq compute_stuck_get (fun A (t : array A) => t.[0]). Check check_const_eq cbn_stuck_get (fun A (t : array A) => t.[0]).
(* Under-application *) Definition lazy_get := Eval lazy in @PrimArray.get. Definition vm_get := Eval vm_compute in @PrimArray.get. Definition native_get := Eval native_compute in @PrimArray.get. Definition compute_get := Evalcompute in @PrimArray.get. Definition cbn_get := Eval cbn in @PrimArray.get.
Check check_const_eq lazy_get (@PrimArray.get). Check check_const_eq vm_get (fun A (t : array A) i => t.[i]). Check check_const_eq native_get (fun A (t : array A) i => t.[i]). Check check_const_eq compute_get (@PrimArray.get). Check check_const_eq cbn_get (@PrimArray.get).
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
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.