-
Notifications
You must be signed in to change notification settings - Fork 35
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
Term transformation helper function #781
base: master
Are you sure you want to change the base?
Conversation
Should it be called |
(** The term [bool_or true true] *) | ||
let or_true_true = | ||
Syntax.P.(appl_list (iden "bool_or") [ iden "true"; iden "true" ]) | ||
|> scope_term bool_sig_st |
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.
Why not using parse_string instead?
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.
Well we don't have a parse_term
yet, we can only parse complete commands (unless we use
Line 6 in c1337fd
let parse_term s = |
Syntax.P.(appl_list (iden "bool_and") [ iden "true"; iden "true" ]) | ||
|> scope_term bool_sig_st | ||
in | ||
Alcotest.(check term) "same term" and_true_true rewritten |
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.
Which equality is used here?
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.
I use syntactic equality (the infamous Rewrite.eq
): we don't want to use convertibility since we want to make sure that a rewrite step is done.
@gabrielhdt How do you plan to introduce in LP the rules you want to use? |
IMO the first step is to provide a convenient caml API, so that we may write rules in ocaml (possibly using Then we may provide a binary. In the case of a binary, we may provide a file containing only rewrite rules which are evaluated after the evaluation of the input, so that the rewrite rules are scoped with the signature state of the input. We can also provide lambdapi code as command line arguments, if we have few rewrite rules (à la lisp, we could invoke I'll try to use these features on https://github.com/Deducteam/personoj/tree/devel/proofs/psnj_toolbox soon enough, so we may have a practical feedback. |
fe8fb4c
to
6b449a6
Compare
This comment has been minimized.
This comment has been minimized.
A possible implementation of LpMeta may behave as specified by the following test file https://github.com/Deducteam/personoj/blob/48d580f39975292ae8ad5af9136f19b56a324b44/proofs/psnj_toolbox/test/qfo/qfo.t where the binary lpmeta is called
to evaluate the lambdapi commands |
Introduce a function that allows to rewrite a term with a specific set of rewrite rules. In particular, it may be used to implement tactics that transform terms.
8d90e87
to
81146a0
Compare
Gabriel, do you want to rewrite dk files only, or lp files also? If you want to rewrite dk files only, there is something easy to do now that lambdapi can generate dk files: we could add an option |
Well for the moment it's rather only an API, so it allows to rewrite terms, and not file or signature. But rewriting files or signature should only depend on the printer used, right? So I'd say that it is orthogonal. The updated version of the specification of the previously mentioned tool |
Introduce a function that allows to rewrite a term with a specific
set of rewrite rules. In particular, it may be used to implement tactics
that transform terms.