Commit 763d4d0d authored by David Hauzar's avatar David Hauzar

Do not convert string value of bitvector to integer.

The value of bitvector can not fit into integer range (it can be, e.g,
9223372036854775881). Values of bitvectors are stored as strings and not
converted to integers.
parent 4564ce84
...@@ -31,7 +31,7 @@ type model_value = ...@@ -31,7 +31,7 @@ type model_value =
| Integer of string | Integer of string
| Decimal of (string * string) | Decimal of (string * string)
| Array of model_array | Array of model_array
| Bitvector of int | Bitvector of string
| Unparsed of string | Unparsed of string
and arr_index = { and arr_index = {
arr_index_key : model_value; arr_index_key : model_value;
...@@ -87,7 +87,7 @@ print_model_value_sanit sanit_print fmt value = ...@@ -87,7 +87,7 @@ print_model_value_sanit sanit_print fmt value =
| Array a -> | Array a ->
print_array str_formatter a; print_array str_formatter a;
sanit_print fmt (flush_str_formatter ()) sanit_print fmt (flush_str_formatter ())
| Bitvector v -> sanit_print fmt (string_of_int v) | Bitvector v -> sanit_print fmt v
and and
print_model_value fmt value = print_model_value fmt value =
print_model_value_sanit (fun fmt s -> fprintf fmt "%s" s) fmt value print_model_value_sanit (fun fmt s -> fprintf fmt "%s" s) fmt value
......
...@@ -18,7 +18,7 @@ type model_value = ...@@ -18,7 +18,7 @@ type model_value =
| Integer of string | Integer of string
| Decimal of (string * string) | Decimal of (string * string)
| Array of model_array | Array of model_array
| Bitvector of int | Bitvector of string
| Unparsed of string | Unparsed of string
and arr_index = { and arr_index = {
arr_index_key : model_value; arr_index_key : model_value;
......
...@@ -20,7 +20,7 @@ rule token = parse ...@@ -20,7 +20,7 @@ rule token = parse
{ LPAREN } { LPAREN }
| ')' | ')'
{ RPAREN } { RPAREN }
| "(_ bv"(num as bv_value)" "num")" { BITVECTOR_VALUE (int_of_string bv_value) } | "(_ bv"(num as bv_value)" "num")" { BITVECTOR_VALUE bv_value }
| num as integer | num as integer
{ INT_STR (integer) } { INT_STR (integer) }
| '-'space*(num as integer) { MINUS_INT_STR ("-"^integer) } | '-'space*(num as integer) { MINUS_INT_STR ("-"^integer) }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%token STORE %token STORE
%token CONST %token CONST
%token AS %token AS
%token <int> BITVECTOR_VALUE %token <string> BITVECTOR_VALUE
%token <string> INT_STR %token <string> INT_STR
%token <string> MINUS_INT_STR %token <string> MINUS_INT_STR
%token <string * string> DEC_STR %token <string * string> DEC_STR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment