-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add nicer names in derive.param2 #761
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proux01
force-pushed
the
param2-nicer-names
branch
from
January 29, 2025 07:48
e14e504
to
50249eb
Compare
From elpi.apps Require Import derive.std.
Elpi derive.param2 list.
Print list_R. (*
* before
Inductive list_R (A A0 : Type) (A1 : A -> A0 -> Type) : list A -> list A0 -> Type :=
| nil_R : list_R A A0 A1 nil nil
| cons_R : forall (H : A) (H0 : A0), A1 H H0 ->
forall (H1 : list A) (H2 : list A0), list_R A A0 A1 H1 H2 ->
list_R A A0 A1 (H :: H1) (H0 :: H2).
Arguments list_R (A A)%type_scope A%function_scope (s1 s2)%list_scope
Arguments nil_R (A A)%type_scope A%function_scope
Arguments cons_R (A A)%type_scope A%function_scope _ _ _ (_ _)%list_scope _
* after
Inductive list_R (A1 A2 : Type) (A_R : A1 -> A2 -> Type) : list A1 -> list A2 -> Type :=
| nil_R : list_R A1 A2 A_R nil nil
| cons_R : forall (a1 : A1) (a2 : A2), A_R a1 a2 ->
forall (l1 : list A1) (l2 : list A2), list_R A1 A2 A_R l1 l2 ->
list_R A1 A2 A_R (a1 :: l1) (a2 :: l2).
Arguments list_R (A1 A2)%type_scope A_R%function_scope (s1 s2)%list_scope
Arguments nil_R (A1 A2)%type_scope A_R%function_scope
Arguments cons_R (A1 A2)%type_scope A_R%function_scope a1 a2 a_R (l1 l2)%list_scope l_R
*)
Definition fa (n : nat) (b : bool) := 0.
Elpi derive.param2 fa.
Print fa_R. (*
* before
fa_R = fun (n n0 : nat) (_ : nat_R n n0) (b b0 : bool) (_ : bool_R b b0) => O_R
Arguments fa_R (n n)%nat_scope n (b b)%bool_scope b
* after
fa_R = fun (n1 n2 : nat) (_ : nat_R n1 n2) (b1 b2 : bool) (_ : bool_R b1 b2) => O_R
Arguments fa_R (n1 n2)%nat_scope n_R (b1 b2)%bool_scope b_R
*) |
gares
approved these changes
Jan 29, 2025
gares
reviewed
Jan 29, 2025
proux01
force-pushed
the
param2-nicer-names
branch
from
January 29, 2025 16:16
50249eb
to
31b79cc
Compare
CohenCyril
reviewed
Jan 30, 2025
n1, n2 and n_R are more readable than n, n0 and n1 ```Coq From elpi.apps Require Import derive.std. Elpi derive.param2 list. Print list_R. (* * before Inductive list_R (A A0 : Type) (A1 : A -> A0 -> Type) : list A -> list A0 -> Type := | nil_R : list_R A A0 A1 nil nil | cons_R : forall (H : A) (H0 : A0), A1 H H0 -> forall (H1 : list A) (H2 : list A0), list_R A A0 A1 H1 H2 -> list_R A A0 A1 (H :: H1) (H0 :: H2). Arguments list_R (A A)%type_scope A%function_scope (s1 s2)%list_scope Arguments nil_R (A A)%type_scope A%function_scope Arguments cons_R (A A)%type_scope A%function_scope _ _ _ (_ _)%list_scope _ * after Inductive list_R (A1 A2 : Type) (A_R : A1 -> A2 -> Type) : list A1 -> list A2 -> Type := | nil_R : list_R A1 A2 A_R nil nil | cons_R : forall (a1 : A1) (a2 : A2), A_R a1 a2 -> forall (l1 : list A1) (l2 : list A2), list_R A1 A2 A_R l1 l2 -> list_R A1 A2 A_R (a1 :: l1) (a2 :: l2). Arguments list_R (A1 A2)%type_scope A_R%function_scope (s1 s2)%list_scope Arguments nil_R (A1 A2)%type_scope A_R%function_scope Arguments cons_R (A1 A2)%type_scope A_R%function_scope a1 a2 a_R (l1 l2)%list_scope l_R *) Definition fa (n : nat) (b : bool) := 0. Elpi derive.param2 fa. Print fa_R. (* * before fa_R = fun (n n0 : nat) (_ : nat_R n n0) (b b0 : bool) (_ : bool_R b b0) => O_R Arguments fa_R (n n)%nat_scope n (b b)%bool_scope b * after fa_R = fun (n1 n2 : nat) (_ : nat_R n1 n2) (b1 b2 : bool) (_ : bool_R b1 b2) => O_R Arguments fa_R (n1 n2)%nat_scope n_R (b1 b2)%bool_scope b_R *) ```
proux01
force-pushed
the
param2-nicer-names
branch
from
January 30, 2025 09:06
31b79cc
to
2495e53
Compare
CohenCyril
approved these changes
Jan 30, 2025
Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
n1, n2 and n_R are more readable than H, H0 and H1