Commit ee61420a authored by charguer's avatar charguer

record_trick

parent 506e9b84
......@@ -5,7 +5,7 @@
URGENT
- record generation breaks circularity through use of "loc" systematically for records
SANITY
......@@ -20,17 +20,32 @@ SANITY
else if name = "exists" then "exists__"
else if name = "forall" then "forall__"
- prevent rebinding of List
- restriction on not binding "min" and "max" might be a bit restrictive..
COMPILATION
- In the makefile.Coq, when building the .vq and obtaining
"Error: /home/charguer/tlc/src/LibPer.vio: premature end of file. Try to rebuild it."
=> then delete the .vio file
(useful for compilations interrupted using CTRL+C)
=> even better, wrap "coqc -quick" with an atomic commit of its result.
LATER
- prevent rebinding of List
- restriction on not binding "min" and "max" might be a bit restrictive..
- implement the work around for type abbreviations:
type typerecb1 = | Typerecb_1 of typerecb2
and typerecb2 = typerecb1 list
=> idea: inline the abbreviation automatically (abbreviation should not be cyclic though)
=> for now, do this encoding by hand.
- add support for pure records
......
......@@ -656,7 +656,7 @@ Lemma order_list_spec :
Proof using. xcf_go*. Qed.
Lemma order_tuple_spec :
app order_tuple [tt] \[] \[= 1::1::nil].
app order_tuple [tt] \[] \[= (1,1)].
Proof using. xcf_go*. Qed.
(* TODO:
......
This diff is collapsed.
......@@ -499,7 +499,7 @@ Tactic Notation "xclean" :=
*)
Ltac xok_core cont := (* see [xok] spec further *)
solve [ cbv beta; apply rel_le_refl
solve [ hnf; apply rel_le_refl
| apply pred_le_refl
| apply hsimpl_to_qunit; reflexivity
| hsimpl; cont tt ].
......@@ -1461,11 +1461,6 @@ Tactic Notation "xval_st" constr(P) :=
should take the form [fun f => spec_of_f].
When this tactic fails, try
[xfun_no_simpl P as f Sf. intros. xapp_types. apply Sf.]
- [xfun_no_simpl P] is like the above but does not attempt to
automatically exploit the most general specification for
proving the special specification. Use [xapp] or [apply]
to continue the proof.
- [xfun_ind R P] is a shorthand for proving a recursive function
by well-founded induction on the first argument quantified in [P].
......@@ -1475,12 +1470,23 @@ Tactic Notation "xval_st" constr(P) :=
shown well-founded. Typical relation includes [downto 0]
and [upto n] for induction on the type [int].
- [xfun_no_simpl P] is like [xfun P] but does not attempt to
automatically exploit the most general specification for
proving the special specification. Use [xapp] or [apply]
to continue the proof.
- [xfun_ind_no_simpl R P] is like [xfun_ind R P] but does not
attempt to automatically exploit the most general specification
for proving the special specification. Use [xapp] or [apply]
to continue the proof.
- Also available:
[xfun P as f]
[xfun P as f Hf]
[xfun_no_simpl P as f]
[xfun_no_simpl P as f Hf]
[xfun_ind R P as IH]
[xfun_ind_nos_impl R P as IH]
*)
......@@ -1562,15 +1568,23 @@ Tactic Notation "xfun_no_simpl" constr(P) "as" ident(f) :=
Tactic Notation "xfun_no_simpl" constr(P) "as" ident(f) ident(Hf) :=
xfun_spec_as_2 P f Hf ltac:(fun _ => idtac).
(* TODO: support higher number of mutually recursive functions. *)
(* Internal: [xfun_ind_core_no_simpl_then R P IH cont]
is like [xfun_no_simpl], followed by a call to well-founded
induction on relation [R] with induction principle called [IH],
followed by a call to [cont] on the CF associated with the function. *)
Ltac xfun_ind_core R P IH :=
Ltac xfun_ind_core_no_simpl_then R P IH cont :=
xfun_spec_as_0 P ltac:(fun Hf =>
intro;
let X := get_last_hyp tt in
induction_wf_core_then IH R X ltac:(fun _ =>
intros; apply (proj2 Hf); clear Hf
)).
induction_wf_core_then IH R X ltac:(fun _ => cont Hf)).
Ltac xfun_ind_core_no_simpl R P IH :=
xfun_ind_core_no_simpl_then R P IH ltac:(fun Hf => idtac).
Ltac xfun_ind_core R P IH :=
xfun_ind_core_no_simpl_then R P IH ltac:(fun Hf =>
intros; apply (proj2 Hf); clear Hf).
Tactic Notation "xfun_ind" constr(R) constr(S) "as" ident(IH) :=
xfun_ind_core R S IH.
......@@ -1578,6 +1592,11 @@ Tactic Notation "xfun_ind" constr(R) constr(S) "as" ident(IH) :=
Tactic Notation "xfun_ind" constr(R) constr(S) :=
let IH := fresh "IH" in xfun_ind R S as IH.
Tactic Notation "xfun_ind_no_simpl" constr(R) constr(S) "as" ident(IH) :=
xfun_ind_core_no_simpl R S IH.
Tactic Notation "xfun_ind_no_simpl" constr(R) constr(S) :=
let IH := fresh "IH" in xfun_ind_core_no_simpl R S IH.
(*--------------------------------------------------------*)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment