Skip to content
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

Unification #431

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Unification #431

wants to merge 7 commits into from

Conversation

Engreyight
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@berpeti berpeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the code is good this way, I only made some suggestions where to move the general lemmas. The anti-unification developments could be phrased as a separate PR. Also, if there are unnecessary comments (e.g., failed proof attempts), any Search, Print, About, and Check commands, these should be removed.

(* https://github.com/harp-project/AML-Formalization/blob/09f24d95119769ce578c8c15eceba5a3a00c45d4/matching-logic/src/Theories/Nat_ProofSystem.v#L392 *)
Section predicate_stuff.

Axiom predicate_equiv :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can copy the proof for these, since the branch mentioned above won't be merged into main in the short term future.


(* These [are from/should be part of] that branch. *)
(* https://github.com/harp-project/AML-Formalization/blob/09f24d95119769ce578c8c15eceba5a3a00c45d4/matching-logic/src/Theories/Nat_ProofSystem.v#L392 *)
Section predicate_stuff.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nothing is against it, you could move these theorems into Definedness_ProofSystem.v.


Section helpers.

Lemma functional_pattern_defined :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lemma should be moved to FOEquality_ProofSystem.v.

* mlExact "H0".
Defined.

Lemma membership_equal_equal :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lemma should be moved to FOEquality_ProofSystem.v.

mlExactMeta Func2.
Defined.

Lemma free_evar_subst_id :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lemma should be moved to Substitution.v.

Γ ⊢ φ and φ' =ml φ' ---> φ
.
(* foldr_ind_set is more general *)
Lemma foldr_preserves_function_set {A : Type} (t : A -> Pattern) (P : Pattern -> Set) (f : A -> Pattern -> Pattern) x xs :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could go into stpp_ext.v.

Defined.

End corollaries.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (or at the beginning of the file), could you make a comment on the sources where the names come from (i.e., cite the two papers on unification).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "names", I meant "Lemma_3", "Prop_3_left" etc.


Theorem wf_unify_pattern :
forall u, wf_unification u -> well_formed (unification_to_pattern u).
Class UP (T : Type) := {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short textual description could help here on what the fields of this class represent.


Section stdpp_but_for_set.

Lemma set_choose_or_empty' `{FinSet A C} (X : C) : (sig (.∈ X)) + (X ≡ ∅).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the following (unadmitted) lemmas, those which are independent of the unification could go into stdpp_ext.v.

| (patt_free_evar x, p2)::xs =>
| (p1, p2)::xs => unify_step3 xs
end. *)
Section antiunification.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The anti-unification developments can go into a separate file in the same folder (which could depend on this module if needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants