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

WIP: Simplify preprocess #242

Open
wants to merge 18 commits into
base: next
Choose a base branch
from

Conversation

Stevendeo
Copy link
Collaborator

The preprocessing of a formula sometimes allow Alt-Ergo to discard useless patterns (especially on ite where the condition is trivial).
Three options are included in this PR:

  • -simplify [y|n] activates (disactivates) the prepreocessing
  • -simplify-th activates the use the theory in the simplification
  • `-simplify-verbose' activates the debug messages

@Stevendeo Stevendeo force-pushed the simplify-preprocess branch from fbe009b to 5715299 Compare May 20, 2019 12:17
Copy link
Collaborator

@Gbury Gbury left a comment

Choose a reason for hiding this comment

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

A few things seem strange to me in this PR. Most of them I wrote in comments, but from a more global point of view:

  • the expression simplifier is somewhat modular, but only with respect to booleans, which is a specialization that I find weird. I'd much prefer if arithmetic simplification would be done modularly, by the arithmetic theory, etc...
  • the definitions of values is very (too much) specific, and actually incorrect with respect to the arbitrary precision integers that alt-ergo should be able to handle

sources/lib/frontend/cnf.ml Outdated Show resolved Hide resolved
sources/lib/frontend/cnf.ml Outdated Show resolved Hide resolved
sources/lib/frontend/cnf.ml Outdated Show resolved Hide resolved
sources/lib/frontend/cnf.ml Outdated Show resolved Hide resolved
sources/lib/frontend/cnf.mli Outdated Show resolved Hide resolved
sources/lib/structures/symbols.ml Outdated Show resolved Hide resolved
sources/lib/structures/typed.ml Outdated Show resolved Hide resolved
sources/lib/structures/typed.ml Outdated Show resolved Hide resolved
sources/lib/structures/typed.ml Outdated Show resolved Hide resolved
sources/lib/frontend/cnf.ml Outdated Show resolved Hide resolved
@Stevendeo Stevendeo changed the title Simplify preprocess WIP: Simplify preprocess May 22, 2019
@Stevendeo
Copy link
Collaborator Author

the definitions of values is very (too much) specific, and actually incorrect with respect to the arbitrary precision integers that alt-ergo should be able to handle

Indeed, the simplifyer now uses Zarith in place of floats.

the expression simplifier is somewhat modular, but only with respect to booleans, which is a specialization that I find weird. I'd much prefer if arithmetic simplification would be done modularly, by the arithmetic theory, etc...

You are right, I didn't took time to use theories for solving constant expressions as the preprocess was initially design to be fully agnostic. I extended the signature of theory to include arithmetic solving. We could export the type value for having a simpler theory signature, or extend the signature of the theory for each case.
This would be even better if the environment was updated along the simplificaton, as variables & expressions could be replaced along the simplification process.

@Stevendeo Stevendeo force-pushed the simplify-preprocess branch from cced136 to c3055eb Compare August 16, 2022 07:20
@CLAassistant
Copy link

CLAassistant commented Apr 13, 2023

CLA assistant check
All committers have signed the CLA.

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.

4 participants