summaryrefslogtreecommitdiff
path: root/src/lem_interp/interp_lib.lem
diff options
context:
space:
mode:
authorKathy Gray2014-11-24 18:45:28 +0000
committerKathy Gray2014-11-24 18:45:28 +0000
commit623cd571bb9dde646e47951f9827bc3d7fa3a2ac (patch)
treef061686f17f8fe052edae45f336aabb660b8d289 /src/lem_interp/interp_lib.lem
parent12d3b1f8d7a8393b0b905e5cf6e62753f5032f6f (diff)
Correctly cast between 1 and a single bit
Diffstat (limited to 'src/lem_interp/interp_lib.lem')
-rw-r--r--src/lem_interp/interp_lib.lem6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lem_interp/interp_lib.lem b/src/lem_interp/interp_lib.lem
index 9ee54b16..aca430cb 100644
--- a/src/lem_interp/interp_lib.lem
+++ b/src/lem_interp/interp_lib.lem
@@ -43,8 +43,10 @@ let rec fill_in_sparse v = match v with
end
let is_one v = match v with
- | V_lit (L_aux b lb) -> V_lit (L_aux (if b = L_one then L_true else L_false) lb)
- | V_track (V_lit (L_aux b lb)) r -> V_track (V_lit (L_aux (if b = L_one then L_true else L_false) lb)) r
+ | V_lit (L_aux (L_num n) lb) -> V_lit (L_aux (if n=1 then L_one else L_zero) lb)
+ | V_track (V_lit (L_aux (L_num n) lb)) r -> V_track (V_lit (L_aux (if n=1 then L_one else L_zero) lb)) r
+ | V_lit (L_aux b lb) -> V_lit (L_aux (if b = L_one then L_one else L_zero) lb)
+ | V_track (V_lit (L_aux b lb)) r -> V_track (V_lit (L_aux (if b = L_one then L_one else L_zero) lb)) r
| V_track V_unkown _ -> v
| V_unknown -> v
end ;;