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

Egraph #220

Merged
merged 11 commits into from
Apr 19, 2024
Merged

Egraph #220

merged 11 commits into from
Apr 19, 2024

Conversation

SimonGuilloud
Copy link
Collaborator

Add a tactic called "Congruence".
This tactic tries to prove a sequent by congruence.
Consider the congruence closure of all terms and formulas in the sequent, with respect to all === and <=> left of the sequent.
The sequent is provable by congruence if one of the following conditions is met:
- The right side contains an equality s === t or equivalence a <=> b provable in the congruence closure.
- The left side contains an negated equality !(s === t) or equivalence !(a <=> b) provable in the congruence closure.
- There is a formula a on the left and b on the right such that a and b are congruent.
- There are two formulas a and !b on the left such that a and b are congruent.
- There are two formulas a and !b on the right such that a and b are congruent.
- The sequent is Ol-valid without equality reasoning
Note that complete congruence closure modulo OL is an open problem.

The tactic uses an egraph datastructure to compute the congruence closure.
The egraph itselfs relies on two underlying union-find datastructure, one for terms and one for formulas.
The union-finds are equiped with an explain method that produces a path between any two elements in the same equivalence class.
Each edge of the path can come from an external equality, or be the consequence of congruence.
The tactic uses uses this path to produce needed proofs.

Copy link
Collaborator

@agilot agilot left a comment

Choose a reason for hiding this comment

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

Looks really nice! We should see if and where we should move union-finds so they can be used for other purposes as well (scala library, lisa-utils...?)

@SimonGuilloud SimonGuilloud merged commit cbec155 into epfl-lara:main Apr 19, 2024
1 check passed
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.

2 participants