forked from ArathaJS/aratha
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
robama
committed
Dec 4, 2018
1 parent
3097cc9
commit 1e9045b
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |