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_set := Eval lazy in (fun A (t : array A) v => t.[1 <- v]). Definition vm_stuck_set := Eval vm_compute in (fun A (t : array A) v => t.[1 <- v]). Definition native_stuck_set := Eval native_compute in (fun A (t : array A) v => t.[1 <- v]). Definition compute_stuck_set := Evalcompute in (fun A (t : array A) v => t.[1 <- v]). Definition cbn_stuck_set := Eval cbn in (fun A (t : array A) v => t.[1 <- v]).
Check check_const_eq lazy_stuck_set (fun A (t : array A) v => t.[1 <- v]). Check check_const_eq vm_stuck_set (fun A (t : array A) v => t.[1 <- v]). Check check_const_eq native_stuck_set (fun A (t : array A) v => t.[1 <- v]). Check check_const_eq compute_stuck_set (fun A (t : array A) v => t.[1 <- v]). Check check_const_eq cbn_stuck_set (fun A (t : array A) v => t.[1 <- v]).
(* Not stuck primitive, but with an accumulator as last argument *) Definition lazy_accu_set := Eval lazy in (fun v => t.[1 <- v]). Definition vm_accu_set := Eval vm_compute in (fun v => t.[1 <- v]). Definition native_accu_set := Eval native_compute in (fun v => t.[1 <- v]). Definition compute_accu_set := Evalcompute in (fun v => t.[1 <- v]). Definition cbn_accu_set := Eval cbn in (fun v => t.[1 <- v]).
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.