From 623cd571bb9dde646e47951f9827bc3d7fa3a2ac Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Mon, 24 Nov 2014 18:45:28 +0000 Subject: Correctly cast between 1 and a single bit --- src/lem_interp/interp_lib.lem | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lem_interp') 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 ;; -- cgit v1.2.3