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

Improve matching algorithm to efficiently support axioms #4

Open
12 tasks
taktoa opened this issue Apr 22, 2018 · 0 comments
Open
12 tasks

Improve matching algorithm to efficiently support axioms #4

taktoa opened this issue Apr 22, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request performance This issue is related to performance

Comments

@taktoa
Copy link
Owner

taktoa commented Apr 22, 2018

We should support Term nodes with associativity (A), commutativity (C), unitality (U), and idempotency (I) axioms, and combinations thereof.

  • Implement A-matching
  • Implement AU-matching
  • Implement C-matching
    • NP-complete
  • Implement AC-matching
    • NP-complete
    • AC matching can be implemented by enumerating the perfect matchings of the bipartite graph (P, N, E), where P is the set of subpatterns to match, N is the set of children of the node we are matching at, and there is an edge in E for every pair (p, n) ∈ P × N such that p matches n.
    • Associative-Commutative Rewriting on Large Terms has some interesting insights into improving best/average-case performance (slides, paper).
    • This one is probably the most commonly needed in practice.
  • Implement ACU-matching
    • Reducible to solving systems of inhomogeneous linear Diophantine equations.
  • Implement I-matching
  • Implement CI-matching
  • Implement ACI-matching
  • Implement matching modulo the axioms of a boolean ring
  • Implement matching modulo the axioms of an abelian group
  • Implement matching modulo arbitrary first-order equations using narrowing
  • Implement higher-order matching

Unification for all of these is known to be decidable (and algorithms are known for them), though I haven't looked into efficiency for all of them.

Other resources

@taktoa taktoa added enhancement New feature or request performance This issue is related to performance labels Apr 22, 2018
@taktoa taktoa self-assigned this Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance This issue is related to performance
Projects
None yet
Development

No branches or pull requests

1 participant