Comments (6)
All done (in #80 for the reset behavior, and) in #82, which adds a warning. On your example, dolmen now prints:
File "/home/guigui/tmp/tmp.smt2", line 2, character 0-18:
Warning Logic was already set at line 1, character 0-22
from dolmen.
Indeed, multiple set-logic
should at the very least warn, if not error; I'll correct that asap.
from dolmen.
A quick remark: Section 4.2.1 of the SMT-LIB standard hints that multiple set-logic
commands are allowed and that indeed the last one is the one that is used.
There is one weird effect though: "The effect of the command is to add globally (and permanently) a declaration of
each sort and function symbol in the logic." hence in the second case here the bitvector functions should still be around?
from dolmen.
Oh... I'll have to read it, but it seems particularly annoying to implement, particularly when considering that a logic is not simply a set of theories, but also extensions and restrictions. Would the restrictions be cumulative ?
from dolmen.
This is not how I understood it, but I just quickly looked this up
from dolmen.
Okay, so there are basically two parts of the language specification that relates to set-logic:
page 55:
current signature: the signature determined by the logic specified with the most recent set-logic command and by the set of sort symbols and rank associations (for function symbols) in the current context.
page 60:
(set-logic l) tells the solver what logic, in the sense of Section 5.5, is being used. The argument l can be the name of a logic in the SMT-LIB catalog or of some other solver-specific logic. The effect of the command is to add globally (and permanently) a declaration of each sort and function symbol in the logic. The argument l can also be the predefined symbol ALL. With this argument, the solver sets the logic to the most general logic it supports.(35) Note that while the reaction to (set-logic ALL) is the same for every compliant solver, the chosen logic is solverspecific. We refer to the logic set by the most recent set-logic command as the current logic.
From what I understand, this means that the last set-logic should be used to determine the logic to use when typing an assertion. The part about adding symbols globally is, to my understanding, more about what happens with respect to the (reset-assertions)
command as described:
(reset-assertions) removes from the assertion stack all assertion levels beyond the first one. In addition, it removes all assertions from the first assertion level. Declarations and definitions resulting from the set-logic command are unaffected (because they are global)
So, I think that dolmen's behavior is currently not wrong, however a few things could be made better:
- a warning when using multiple
set-logic
in the same file, or more precisely when aset-logic
command overwrites a previous one (soset-logic
commands separated by areset
should be okay (which reminds me that I don't think dolmen correctly handles thereset
command, which i'll try to fix)). - should that warning be fatal in strict mode ?
- are there realistic cases where one would want to use and/or need multiple logics in a single file (without any
reset
) ?
from dolmen.
Related Issues (20)
- Additional builtins in the State? HOT 1
- Wrong check-model
- Bitvectors of size 0 should be forbidden
- Ill-typed statement on Bitvector is accepted by Dolmen HOT 1
- Expose `with_cache`? HOT 1
- Support Alt-Ergo's `cut` and `check` HOT 12
- Add authors files
- Unclear error message during model checking HOT 7
- Spec errors on the difference logic benchmarks of the SMT-LIB HOT 2
- Reject names starting with `@` and `.` outside of models
- Handling of `set-option :global-declarations`
- Handling of named terms HOT 2
- Check sat assuming HOT 2
- DIMACS variables do not appear as decls HOT 1
- Uncaught exception on buggy file
- 4.08 support broken (`List.concat_map`) HOT 10
- Quoted identifiers can be keywords HOT 12
- Warning regarding the `dolmen_type` file HOT 2
- Support non-incremental parsing from stdin HOT 1
- Handling abstract values in `(get-value)` statements HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dolmen.