diff options
| author | Kathy Gray | 2014-11-24 18:45:28 +0000 |
|---|---|---|
| committer | Kathy Gray | 2014-11-24 18:45:28 +0000 |
| commit | 623cd571bb9dde646e47951f9827bc3d7fa3a2ac (patch) | |
| tree | f061686f17f8fe052edae45f336aabb660b8d289 /src/lem_interp | |
| parent | 12d3b1f8d7a8393b0b905e5cf6e62753f5032f6f (diff) | |
Correctly cast between 1 and a single bit
Diffstat (limited to 'src/lem_interp')
| -rw-r--r-- | src/lem_interp/interp_lib.lem | 6 |
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 ;; |
