Skip to content

Handling of set-option :global-declarations #186

@Stevendeo

Description

@Stevendeo

The SMT standard states (https://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf#page=56) :

Popping that assertion level removes them. As an alternative, declarations and definitions can all be made global by running the solver with the option :global-declarations set to true. When running with this option set, all declarations and definitions become permanent. That is, they survive any pop operations on the assertion stack as well as invocations of reset-assertions and can only be removed by a global reset, achieved with the reset command.

The following example fails :

(set-logic ALL)
(set-option :global-declarations)
(push 1)
(declare-const x Int)
(pop 1)
(assert (= x x))

with the error Unbound identifier x. Same goes with the following example :

(set-logic ALL)
(set-option :global-declarations)
(declare-const x Int)
(reset-assertions)
(assert (= x x))

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions