-
Notifications
You must be signed in to change notification settings - Fork 16
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] [Model] Handle definition of constants in smt2 file #98
Conversation
Fix error for declare-sort
I'm not sure I see what problem exactly is fixed by the different handling of definitions (the tests added already pass without the changes). |
On the other hand, there can be issues when a problem files does something along the following lines: |
I think
I think it should not be accepted. Accepting more would put too much burden on tools that also parses models. I think the terms that can define a model should be precisely defined (constants, or specific builtin function like |
You're correct: define-sorts indeed cause an error whereas they shouldn't, and we need to record the definitions from the problem file after all the definitions form the model. I'll fix that asap, ^^ |
My feeling is that a model should not use any benchmark-defined/declared functions. For real constants it should just give the value directly, for uninterpreted sorts it should give model values, and for function definitions it should only use theory-defined symbols (ite, <, =, +, *, etc). Following that logic, the model should also not use benchmark-defined sorts and instead use their underlying definition in the model. At least Bitwuzla and cvc5 do this for the benchmarks containing define-sort. This way it's correct to first parse the model (after setting the logic) and then parse the benchmark skipping the declared functions. If the model could refer to the benchmark-declared functions, one would need to parse the benchmark and when there is a declare-fun search for the definition in the model and then parse that definition (and complain about cyclic dependencies). For datatypes we may later run into problems, as these are declared in the benchmark and the model needs to use constructors and match terms. But for now, the smt-comp's model-validation track doesn't run on datatype logics. |
Indeed, the model definitions should only map constants to values, and therefore, we can evaluate them, and then evaluate the definitions from the original problem file (which may use the values defined by the model).
Dolmen already supports algebraic datatype in model verification. It can do so because the way things work is: parse and type the problem file, record all the definition/assertions, parse and type the model file, evaluate the definition from the model, and then evaluate the definitions from the problem file, and then evaluate the assertions. |
Fixes some errors found by @jhoenicke