-
Notifications
You must be signed in to change notification settings - Fork 0
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
new proof terms #64
Draft
c-cube
wants to merge
35
commits into
main
Choose a base branch
from
simon/proof3-2025-01-15
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
new proof terms #64
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
Member
c-cube
commented
Mar 6, 2025
- directly use twine for proofs
- use newer twine features like explicit offsets, to be able to read only one proof step at a time
- generate type for proof steps and deep proof steps
- add a proof writer
The generated types.ml file: (** Proof rules.
Proof rules in use in ImandraX. *)
(* auto-generated in [gen/mk_rules.ml], do not modify *)
type 'a offset_for = 'a Imandrakit_twine.offset_for [@@deriving eq, show, twine, typereg]
(** A proof step, proving a clause using logical rules. *)
type proof_step =
| Assume of Scope.t * Imandrax_api_mir.Term.t
| By_def of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Lemma of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Sequent.t
| Sorry of Scope.t * Imandrax_api_mir.Sequent.t
| Cc of Scope.t * Imandrax_api_mir.Sequent.t
| Intros of Scope.t * Imandrax_api_mir.Sequent.t
| Unintros of Scope.t * Imandrax_api_mir.Term.t list * Imandrax_api_mir.Sequent.t
| If_true of Scope.t * Imandrax_api_mir.Term.t
| If_false of Scope.t * Imandrax_api_mir.Term.t
| If_trivial of Scope.t * Imandrax_api_mir.Term.t
| If_trivial_neg of Scope.t * Imandrax_api_mir.Term.t
| Trivial of Scope.t * Imandrax_api_mir.Sequent.t
| And_elim of Scope.t * Imandrax_api_mir.Sequent.t * Imandrax_api_mir.Sequent.t
| Or_left of Scope.t * Imandrax_api_mir.Sequent.t * Imandrax_api_mir.Term.t
| Or_right of Scope.t * Imandrax_api_mir.Sequent.t * Imandrax_api_mir.Term.t
| Cstor_inj of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t * int
| Cstor_disj of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Cstor_is_a_true of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Cstor_is_a_false of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Cstor_is_a_project of Scope.t * Imandrax_api_mir.Term.t
| Cstor_select of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Destruct of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| And_true_left of Scope.t * Imandrax_api_mir.Term.t
| And_true_right of Scope.t * Imandrax_api_mir.Term.t
| And_false_left of Scope.t * Imandrax_api_mir.Term.t
| And_false_right of Scope.t * Imandrax_api_mir.Term.t
| And_refl of Scope.t * Imandrax_api_mir.Term.t
| Or_false_left of Scope.t * Imandrax_api_mir.Term.t
| Or_false_right of Scope.t * Imandrax_api_mir.Term.t
| Or_true_left of Scope.t * Imandrax_api_mir.Term.t
| Or_true_right of Scope.t * Imandrax_api_mir.Term.t
| Or_refl of Scope.t * Imandrax_api_mir.Term.t
| Imply_true_right of Scope.t * Imandrax_api_mir.Term.t
| Imply_true_left of Scope.t * Imandrax_api_mir.Term.t
| Imply_false_left of Scope.t * Imandrax_api_mir.Term.t
| Imply_false_right of Scope.t * Imandrax_api_mir.Term.t
| Imply_refl of Scope.t * Imandrax_api_mir.Term.t
| Neq of Scope.t * Imandrax_api_mir.Term.t
| Eq_const of Scope.t * Imandrax_api_mir.Term.t * Imandrax_api_mir.Term.t
| Double_neg_elim of Scope.t * Imandrax_api_mir.Term.t
| Eq_true_elim of Scope.t * Imandrax_api_mir.Term.t
| Eq_false_not of Scope.t * Imandrax_api_mir.Term.t
| Cut of Scope.t * proof_step offset_for * proof_step offset_for list
| Subst of Scope.t * proof_step offset_for * (Imandrax_api_mir.Var.t * Imandrax_api_mir.Term.t) list
(** A proof step at the level of deep sequents. *)
and deep_proof_step =
| Deep_cut of Scope.t * deep_proof_step offset_for * deep_proof_step offset_for list
| Deep_intro of Scope.t * Scope.t * proof_step offset_for
| Deep_subst of Scope.t * deep_proof_step offset_for * (Imandrax_api_mir.Var.t * Imandrax_api_mir.Term.t) list
(** A node in the proof tree, annotated with a deep sequent, used to encode the structure of the proof. *)
and deep_proof_tree =
| Pt_root
| Pt_node of deep_proof_tree offset_for * deep_proof_step offset_for
[@@deriving eq, twine, show, typereg] |
7c6040b
to
0fda855
Compare
We'll merge this once it's used in imandrax! |
14dfffe
to
3a9baca
Compare
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.