summaryrefslogtreecommitdiff
path: root/src/lem_interp/interp_lib.lem
diff options
context:
space:
mode:
authorKathy Gray2015-03-17 15:09:56 +0000
committerKathy Gray2015-03-17 15:09:56 +0000
commite15a5884ea4e29492869655a3daaa8cbdcd48828 (patch)
tree60d8de289fd0f0c851a396e04a563f6bd047a0a1 /src/lem_interp/interp_lib.lem
parentd32c8308f43f97d4bec74990736e31c085950dd6 (diff)
Correct directionality in interpreter. Now the interpreter shouldn't use inc unless that's the current default or there's no default set in the spec
Diffstat (limited to 'src/lem_interp/interp_lib.lem')
-rw-r--r--src/lem_interp/interp_lib.lem6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lem_interp/interp_lib.lem b/src/lem_interp/interp_lib.lem
index e4de0d71..1e97e061 100644
--- a/src/lem_interp/interp_lib.lem
+++ b/src/lem_interp/interp_lib.lem
@@ -127,7 +127,9 @@ let lt_range (V_tuple[v1;v2]) =
let bit_to_bool b = match detaint b with
| V_lit (L_aux L_zero _) -> false
+ | V_lit (L_aux L_false _) -> false
| V_lit (L_aux L_one _) -> true
+ | V_lit (L_aux L_true _) -> true
end ;;
let bool_to_bit b = match b with
false -> V_lit (L_aux L_zero Unknown)
@@ -137,7 +139,9 @@ let bool_to_bit b = match b with
let bitwise_not_bit v =
let lit_not (L_aux l loc) = match l with
| L_zero -> (V_lit (L_aux L_one loc))
- | L_one -> (V_lit (L_aux L_zero loc)) end in
+ | L_false -> (V_lit (L_aux L_one loc))
+ | L_one -> (V_lit (L_aux L_zero loc))
+ | L_true -> (V_lit (L_aux L_zero loc)) end in
retaint v (match detaint v with
| V_lit lit -> lit_not lit
| V_unknown -> V_unknown end)