diff options
| author | Kathy Gray | 2014-12-11 12:52:48 +0000 |
|---|---|---|
| committer | Kathy Gray | 2014-12-11 12:52:48 +0000 |
| commit | 17272e44bfb115120c1686cc2ca9f4a7df261a93 (patch) | |
| tree | ce610e1fcf76306f70c280c9999dbab45f082716 /src | |
| parent | 5ff99a2813ffde7241a1517837b14ae5c43f9908 (diff) | |
fix error with type int and subtraction
Diffstat (limited to 'src')
| -rw-r--r-- | src/type_internal.ml | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/type_internal.ml b/src/type_internal.ml index 91b583c0..c259698d 100644 --- a/src/type_internal.ml +++ b/src/type_internal.ml @@ -1964,14 +1964,14 @@ let freshen n = let rec simple_constraint_check in_env cs = let check = simple_constraint_check in_env in -(* let _ = Printf.printf "simple_constraint_check\n" in *) + let _ = Printf.printf "simple_constraint_check\n" in match cs with | [] -> [] | Eq(co,n1,n2)::cs -> let check_eq ok_to_set n1 n2 = -(* let _ = Printf.printf "eq check, about to normalize_nexp of %s, %s arising from %s \n" (n_to_string n1) (n_to_string n2) (co_to_string co) in *) + let _ = Printf.printf "eq check, about to normalize_nexp of %s, %s arising from %s \n" (n_to_string n1) (n_to_string n2) (co_to_string co) in let n1',n2' = normalize_nexp n1,normalize_nexp n2 in -(* let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in *) + let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in (match n1'.nexp,n2'.nexp with | Ninexact,nok | nok,Ninexact -> eq_error (get_c_loc co) ("Type constraint arising from here requires " ^ n_to_string {nexp = nok} ^ " to be equal to +inf + -inf") @@ -2018,16 +2018,16 @@ let rec simple_constraint_check in_env cs = | Some(c) -> c::(check cs)) | _ -> (Eq(co,n1,n2)::(check cs))) | GtEq(co,n1,n2)::cs -> - (*let _ = Printf.printf ">= check, about to normalize_nexp of %s, %s\n" (n_to_string n1) (n_to_string n2) in *) + let _ = Printf.printf ">= check, about to normalize_nexp of %s, %s\n" (n_to_string n1) (n_to_string n2) in let n1',n2' = normalize_nexp n1,normalize_nexp n2 in - (* let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in *) + let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in (match n1'.nexp,n2'.nexp with | Nconst i1, Nconst i2 | Nconst i1,N2n(_,Some(i2)) | N2n(_,Some(i1)),Nconst i2 -> if ge_big_int i1 i2 then check cs else eq_error (get_c_loc co) ("Type constraint mismatch: constraint of " ^ n_to_string n1 ^ " >= " ^ n_to_string n2 ^ " arising from here requires " ^ string_of_big_int i1 ^ " to be greater than or equal to " ^ string_of_big_int i2) - | Npos_inf, Nconst _ | Npos_inf, Npos_inf | Nconst _, Nneg_inf | Nneg_inf, Nneg_inf -> check cs + | Npos_inf, _ | Npos_inf, Npos_inf | _, Nneg_inf | Nneg_inf, Nneg_inf -> check cs | Ninexact, _ | _, Ninexact -> check cs | Nconst _ ,Npos_inf -> eq_error (get_c_loc co) ("Type constraint mismatch: constraint arising from here requires " ^ (n_to_string n1') ^ " to be greater than infinity") @@ -2041,16 +2041,16 @@ let rec simple_constraint_check in_env cs = ^ n_to_string new_n ^ " to be greater than or equal to 0, not " ^ string_of_big_int i) | _ -> GtEq(co,n1',n2')::(check cs))) | LtEq(co,n1,n2)::cs -> - (* let _ = Printf.printf "<= check, about to normalize_nexp of %s, %s\n" (n_to_string n1) (n_to_string n2) in *) + let _ = Printf.printf "<= check, about to normalize_nexp of %s, %s\n" (n_to_string n1) (n_to_string n2) in let n1',n2' = normalize_nexp n1,normalize_nexp n2 in - (* let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in *) + let _ = Printf.printf "finished evaled to %s, %s\n" (n_to_string n1') (n_to_string n2') in (match n1'.nexp,n2'.nexp with | Nconst i1, Nconst i2 | Nconst i1, N2n(_,Some(i2)) | N2n(_,Some(i1)),Nconst i2 -> if le_big_int i1 i2 then check cs else eq_error (get_c_loc co) ("Type constraint mismatch: constraint arising from here requires " ^ string_of_big_int i1 ^ " to be less than or equal to " ^ string_of_big_int i2) - | Nconst _, Npos_inf | Npos_inf, Npos_inf | Nneg_inf, Nconst _ | Nneg_inf, Nneg_inf -> check cs + | _, Npos_inf | Npos_inf, Npos_inf | Nneg_inf, _ | Nneg_inf, Nneg_inf -> check cs | Npos_inf, Nconst _ -> eq_error (get_c_loc co) ("Type constraint mismatch: constraint arising from here requires infinity to be less than " ^ (n_to_string n2')) | _,_ -> LtEq(co,n1',n2')::(check cs)) |
