Jo Devriendt
Disclaimer: ManyWorlds is a project in development with Nonfiction Software. This presentation cannot be used by KU Leuven to claim copyright on the ManyWorlds project.
Compilers!
[Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: principles, techniques, and tools. 1986.]
Vocabulary for propositional terms
Example terms
Term Algebra
Term Algebra
A term is a recursive structure (a tree):
Rewrite Rules
Rewrite Rules
Rewrite Rules
CPMpy can probably be elegantly modeled as a term rewrite system
E.g., to avoid distributivity blowup, use Tseitinization
CPMpy can probably be elegantly modeled as a term rewrite system
I don't know about constraint compilation systems (SMT, ASP, CP, IDP, ...) that formally describe their compilation step using term rewriting terminology.
They may still exist though.
Edit: yes, MiniZinc's predecessor Cadmium!
3.3.1 Preproccessing of syntax tree
3.3.2 Flattening
"prior to flattening, every expression tree has been preprocessed such that its tree structure conforms to the propagators provided by solver S. [...] for every node N in E, there exists a propagator in solver S that corresponds to operation N [...] this preprocessing procedure can be embedded into flattening"
3.3.3 Solver Profiles
"a solver profile [...] captures important features of a particular solver. [...] an expression is only flattened, if the target solver does not support it."
flatten_constraint
reify_rewrite
only_bv_implies
linearize_constraint
only_numexpr_equality
only_positive_bv
only_const_rhs
only_var_lhs
to_cnf
flat2cnf
For Exact:
For SAT:
Possible formalization approach:
Possible formalization approach:
Disadvantage:
Rewrite systems do not formalize when to match a rule - i.e., what input a transformation expects. They just check whether a rule matches.
Advantages:
linearize_constraint
only_bv_implies