-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use elpi.derive instead of "Scheme Equality" #1052
base: main
Are you sure you want to change the base?
Conversation
elpi.derive is much faster on inductives with many constructors. This is particularly interesting for type x86_op which has more than 100 constructors.
There are currently a few caveats:
|
@@ -15,6 +15,7 @@ | |||
-arg "-w -deprecated-since-mathcomp-2.3.0" | |||
-arg "-w -deprecated-from-Coq" | |||
-arg "-w -deprecated-dirpath-Coq" | |||
-arg "-async-proofs off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, should not be there.
; call_xreg_ret := [::] | ||
; call_reg_ret_uniq := erefl true; | ||
|}. | ||
Definition riscv_linux_call_conv : calling_convention := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated fix. The comment was not true anymore.
@@ -105,19 +107,15 @@ End CmpR. | |||
Module Mr := Mmake CmpR. | |||
|
|||
(* ------------------------------------------------------------------ *) | |||
#[only(eqbOK)] derive Z. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to move that elsewhere. In utils?
@@ -176,6 +176,11 @@ Section PROOF. | |||
end. | |||
Qed. | |||
|
|||
Lemma cons_inj {A} {x1 x2 : A} (s1 s2 : seq A) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to move this to utils.
@@ -147,7 +143,7 @@ Module CEDecStype. | |||
| sword w1 => | |||
match t2 as t0 return {sword w1 = t0} + {True} with | |||
| sword w2 => | |||
match wsize_eq_dec w1 w2 with | |||
match Bool.reflect_dec _ _ (wsize_eqb_OK w1 w2) with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, I reintroduced wsize_eq_dec
so this change is not needed.
@@ -169,7 +167,7 @@ Module CEDecStype. | |||
+ case: pos_dec (@pos_dec_r n n' I) => [Heq _ | [] neq ] //=. | |||
move => _; apply/eqP => -[]. | |||
by move/eqP: (neq erefl). | |||
case: wsize_eq_dec => // eqw. | |||
case: Bool.reflect_dec => // eqw. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
move=> [?]; subst v. | ||
case: ves => [// | ? []]; last by t_xrbindP. | ||
apply: rbindP => v /=. | ||
apply: rbindP => _ -> [->] /ok_inj /(f_equal (head (Vbool true))) /= /Vword_inj [?]; subst ws''. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: use cons_inv
instead
move=> [?]; subst v. | ||
case: ves => [// | ? []]; last by t_xrbindP. | ||
apply: rbindP => v /=. | ||
apply: rbindP => _ -> [->] /ok_inj /(f_equal (head (Vbool true))) /= /Vword_inj [?]; subst ws''. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
Note to self: it seems we can remove |
elpi.derive is much faster on inductives with many constructors. This is particularly interesting for type x86_op which has more than 100 constructors.