Skip to content

Commit 18cea46

Browse files
authored
Merge pull request #609 from lfwa/cvc5
SMT-LIB 2.6 conformance, support for cvc5, and generalization for alternative SMT-solvers
2 parents 8836afa + eaa1190 commit 18cea46

27 files changed

Lines changed: 944 additions & 582 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ method main() {
134134
* You need recent installations of
135135
1. the [sbt build tool](https://www.scala-sbt.org/)
136136
2. the [Z3 SMT solver](https://github.com/Z3Prover/z3/releases)
137+
3. (optional) the [cvc5 SMT solver](https://github.com/cvc5/cvc5/releases)
137138
* Clone this repository *recursively* by running:
138139
`git clone --recursive https://github.com/viperproject/silicon`
139140

src/main/resources/cvc5config.smt2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; This Source Code Form is subject to the terms of the Mozilla Public
2+
; License, v. 2.0. If a copy of the MPL was not distributed with this
3+
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
; Requires CVC5 >= 1.0.0
6+
(set-option :print-success true)
7+
8+
(set-logic ALL)
9+
(set-option :seed 0)
10+
(set-option :sat-random-seed 0)
11+
12+
; default options as used by boogie
13+
(set-option :incremental true) ; required for push and pop
14+
(set-option :condense-function-values false)
15+
(set-option :strict-parsing false)
16+
(set-option :produce-models true) ; enabled to support proverStdIO. retrieveAndSaveModel
17+
18+
; Translated from z3config
19+
(set-option :global-declarations true)
20+
(set-option :type-checking true)

src/main/resources/field_value_functions_axioms.smt2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
; been emitted.
1313

1414
(assert (forall ((vs $FVF<$T$>) (ws $FVF<$T$>)) (!
15-
(implies
15+
(=>
1616
(and
1717
(Set_equal ($FVF.domain_$FLD$ vs) ($FVF.domain_$FLD$ ws))
1818
(forall ((x $Ref)) (!
19-
(implies
19+
(=>
2020
(Set_in x ($FVF.domain_$FLD$ vs))
2121
(= ($FVF.lookup_$FLD$ vs x) ($FVF.lookup_$FLD$ ws x)))
2222
; :pattern ((Set_in x ($FVF.domain_$FLD$ vs)))
@@ -33,8 +33,8 @@
3333

3434
(assert (forall ((r $Ref) (pm $FPM)) (!
3535
($Perm.isValidVar ($FVF.perm_$FLD$ pm r))
36-
:pattern ($FVF.perm_$FLD$ pm r))))
36+
:pattern (($FVF.perm_$FLD$ pm r)))))
3737

3838
(assert (forall ((r $Ref) (f $S$)) (!
3939
(= ($FVF.loc_$FLD$ f r) true)
40-
:pattern ($FVF.loc_$FLD$ f r))))
40+
:pattern (($FVF.loc_$FLD$ f r)))))

src/main/resources/field_value_functions_axioms_no_triggers.smt2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
; been emitted.
1313

1414
(assert (forall ((vs $FVF<$T$>) (ws $FVF<$T$>)) (!
15-
(implies
15+
(=>
1616
(and
1717
(Set_equal ($FVF.domain_$FLD$ vs) ($FVF.domain_$FLD$ ws))
1818
(forall ((x $Ref)) (!
19-
(implies
19+
(=>
2020
(Set_in x ($FVF.domain_$FLD$ vs))
2121
(= ($FVF.lookup_$FLD$ vs x) ($FVF.lookup_$FLD$ ws x)))
2222
:qid |qp.$FVF<$T$>-eq-inner|

src/main/resources/preamble.smt2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
; --- Snapshots ---
1212

13-
(declare-datatypes () ((
14-
$Snap ($Snap.unit)
13+
(declare-datatypes (($Snap 0)) ((
14+
($Snap.unit)
1515
($Snap.combine ($Snap.first $Snap) ($Snap.second $Snap)))))
1616

1717
; --- References ---
@@ -21,8 +21,8 @@
2121

2222
; --- Permissions ---
2323

24-
(declare-sort $FPM)
25-
(declare-sort $PPM)
24+
(declare-sort $FPM 0)
25+
(declare-sort $PPM 0)
2626
(define-sort $Perm () Real)
2727

2828
(define-const $Perm.Write $Perm 1.0)

src/main/resources/predicate_snap_functions_axioms.smt2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
; been emitted.
1212

1313
(assert (forall ((vs $PSF<$S$>) (ws $PSF<$S$>)) (!
14-
(implies
14+
(=>
1515
(and
1616
(Set_equal ($PSF.domain_$PRD$ vs) ($PSF.domain_$PRD$ ws))
1717
(forall ((x $Snap)) (!
18-
(implies
18+
(=>
1919
(Set_in x ($PSF.domain_$PRD$ vs))
2020
(= ($PSF.lookup_$PRD$ vs x) ($PSF.lookup_$PRD$ ws x)))
2121
; :pattern ((Set_in x ($PSF.domain_$PRD$ vs)))
@@ -32,8 +32,8 @@
3232

3333
(assert (forall ((s $Snap) (pm $PPM)) (!
3434
($Perm.isValidVar ($PSF.perm_$PRD$ pm s))
35-
:pattern ($PSF.perm_$PRD$ pm s))))
35+
:pattern (($PSF.perm_$PRD$ pm s)))))
3636

3737
(assert (forall ((s $Snap) (f $S$)) (!
3838
(= ($PSF.loc_$PRD$ f s) true)
39-
:pattern ($PSF.loc_$PRD$ f s))))
39+
:pattern (($PSF.loc_$PRD$ f s)))))

src/main/resources/predicate_snap_functions_axioms_no_triggers.smt2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
; been emitted.
1212

1313
(assert (forall ((vs $PSF<$S$>) (ws $PSF<$S$>)) (!
14-
(implies
14+
(=>
1515
(and
1616
(Set_equal ($PSF.domain_$PRD$ vs) ($PSF.domain_$PRD$ ws))
1717
(forall ((x $Snap)) (!
18-
(implies
18+
(=>
1919
(Set_in x ($PSF.domain_$FRD$ vs))
2020
(= ($PSF.lookup_$PRD$ vs x) ($PSF.lookup_$PRD$ ws x)))
2121
:qid |qp.$PSF<$S$>-eq-inner|

0 commit comments

Comments
 (0)