Skip to content

Commit

Permalink
Added z3str prelude.
Browse files Browse the repository at this point in the history
  • Loading branch information
robama committed Dec 4, 2018
1 parent 3097cc9 commit 1e9045b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/smt2/z3str/prelude.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(set-option :produce-models true)
(set-option :produce-unsat-cores true)
(set-option :timeout 10000)

; Datatypes

; Val is the datatype for an ECMAScript value.

(declare-datatypes () (
(Val
(undefined)
(null)
(Boolean (bool Bool))
(Str (str String))
(Num (num Int))
(Obj (id Int))
)
))

(declare-datatypes () (
(MaybeVal
(Nothing)
(Just (just Val)))))

(define-fun Int32ToInt ((x (_ BitVec 32))) Int
(let ((nx (bv2int x)))
(ite (>= nx 2147483648) (- nx 4294967296) nx)))
(define-fun Int32ToUInt ((x (_ BitVec 32))) Int (bv2int x))

0 comments on commit 1e9045b

Please sign in to comment.