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

Reimplement conversion modulo AC #1211

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

fblanqui
Copy link
Member

@fblanqui fblanqui commented Feb 27, 2025

This PR reimplements conversion modulo AC without enforcing terms to be in AC-canonical form.
This is much more efficient but may not work with any rewrite system (fix #1200).
It seems to work well with:

  • the theory ACI = AC + Idempotence used in max-suc algebra for universe levels,
  • the theory of commutative groups AG = AC + Inverse + Neutral used in linear arithmetic.

CHANGES:

  • main changes are in term.ml and eval.ml
  • Logger.set_debug_in: use string argument instead of char + permute arguments
  • Print: rename without_qualifying into no_qualif
  • List: add rev_append2
  • Term: add type side = Left | Right, used in properties and rewrite tactic
  • Term: remove property Assoc
  • when declaring a symbol as associative commutative, a side must be given now

TODO:

  • do not declare term as private and remove functions mk_
  • handle commutativity alone, fix tests/OK/ac.lp
  • fix compute
  • in applications, compare arguments from left to right
  • try improve eq_modulo further
  • update CHANGES
  • update doc, add links to examples
  • Logger.set_debug: permute arguments?

@fblanqui
Copy link
Member Author

@NotBad4U Could you please try this PR on some other examples for linear arithmetic ?

@fblanqui
Copy link
Member Author

Be careful that I changed the ordering: arguments are now compared from left to right. So, you need to permute the arguments of var.

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.

The modifier associative commutative can be slow with large terms
1 participant