Add support for Ufs with 0 arguments for all solver / bugfixes#580
Add support for Ufs with 0 arguments for all solver / bugfixes#580daniel-raffler wants to merge 9 commits intomasterfrom
Conversation
kfriedberger
left a comment
There was a problem hiding this comment.
Is this PR a solution to the old issue #171 ? If yes, please document the new rules for nullary UFs and variables.
Is there a difference in plain SMTLIB2 between nullary UFs and variables for parsing? Abd how do solvers handle each case?
|
Hello Karlheinz
Yes, I think it closes it and I'll add some documentation. Most solvers expect at least one argument when defining a UF and will throw an exception otherwise. In that case we simply return a variable as a workaround. It's often hard to say if the solver considers variables and 0-ary UFs the same as most solvers allows multiple variables with the same name. It's then up to the variable cache (= us) to decide if they are identical
In Smtlib nullary Ufs and variables are the same: (page 67, here) In JavaSmt it's a bit more complicated as |
|
Good step towards uniform behavior! Thank you!
The important part here is that all solvers need the same behavior. So we need tests that check the cases:
|
# Conflicts: # src/org/sosy_lab/java_smt/solvers/princess/PrincessFormulaCreator.java
|
What weighs higher?
To me the answer is not obvious, but I think this question is important and should be discussed deliberately before committing to one of the options. |
Hello,
this PR adds support for Ufs with no arguments to Bitwuzla and Boolector, where it was still missing. It also fixes various bugs on Princess, CVC4 and CVC5 where 0-ary Ufs and variables where treated as different symbols: Since all of these solvers are using a variable cache, it is our job to make sure that no duplicate symbols are created and
(uf)andufare treated the same