aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/micromega/sos.ml
diff options
context:
space:
mode:
authorGravatar xclerc <xclerc@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-14 07:33:57 +0000
committerGravatar xclerc <xclerc@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-14 07:33:57 +0000
commitec5ed7870b4b59e05c5e994c9bad35e28685b8bd (patch)
tree6b735f9c86df8102f132946afbf7b728f5b19edc /plugins/micromega/sos.ml
parent38d9a3342f626d16bcf5c993bf15ff3e6e8ee8d9 (diff)
Getting rid of the use of deprecated elements (from the OCaml standard library).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16882 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/micromega/sos.ml')
-rw-r--r--plugins/micromega/sos.ml24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/micromega/sos.ml b/plugins/micromega/sos.ml
index 130f6bfd4..6816abb2f 100644
--- a/plugins/micromega/sos.ml
+++ b/plugins/micromega/sos.ml
@@ -200,11 +200,11 @@ let monomial_pow (m:monomial) k =
else mapf (fun x -> k * x) m;;
let monomial_divides (m1:monomial) (m2:monomial) =
- foldl (fun a x k -> tryapplyd m2 x 0 >= k & a) true m1;;
+ foldl (fun a x k -> tryapplyd m2 x 0 >= k && a) true m1;;
let monomial_div (m1:monomial) (m2:monomial) =
let m = combine (+) (fun x -> x = 0) m1 (mapf (fun x -> -x) m2) in
- if foldl (fun a x k -> k >= 0 & a) true m then m
+ if foldl (fun a x k -> k >= 0 && a) true m then m
else failwith "monomial_div: non-divisible";;
let monomial_degree x (m:monomial) = tryapplyd m x 0;;
@@ -226,7 +226,7 @@ let eval assig (p:poly) =
let poly_0 = (undefined:poly);;
-let poly_isconst (p:poly) = foldl (fun a m c -> m = monomial_1 & a) true p;;
+let poly_isconst (p:poly) = foldl (fun a m c -> m = monomial_1 && a) true p;;
let poly_var x = ((monomial_var x) |=> Int 1 :poly);;
@@ -282,14 +282,14 @@ let poly_variables (p:poly) =
(* Order monomials for human presentation. *)
(* ------------------------------------------------------------------------- *)
-let humanorder_varpow (x1,k1) (x2,k2) = x1 < x2 or x1 = x2 & k1 > k2;;
+let humanorder_varpow (x1,k1) (x2,k2) = x1 < x2 || x1 = x2 && k1 > k2;;
let humanorder_monomial =
let rec ord l1 l2 = match (l1,l2) with
_,[] -> true
| [],_ -> false
- | h1::t1,h2::t2 -> humanorder_varpow h1 h2 or h1 = h2 & ord t1 t2 in
- fun m1 m2 -> m1 = m2 or
+ | h1::t1,h2::t2 -> humanorder_varpow h1 h2 || h1 = h2 && ord t1 t2 in
+ fun m1 m2 -> m1 = m2 ||
ord (sort humanorder_varpow (graph m1))
(sort humanorder_varpow (graph m2));;
@@ -602,7 +602,7 @@ let run_csdp dbg obj mats =
let csdp obj mats =
let rv,res = run_csdp (!debugging) obj mats in
- (if rv = 1 or rv = 2 then failwith "csdp: Problem is infeasible"
+ (if rv = 1 || rv = 2 then failwith "csdp: Problem is infeasible"
else if rv = 3 then ()
(* Format.print_string "csdp warning: Reduced accuracy";
Format.print_newline() *)
@@ -653,7 +653,7 @@ let linear_program_basic a =
let mats = List.map (fun j -> diagonal (column j a)) (1--n)
and obj = vector_const (Int 1) m in
let rv,res = run_csdp false obj mats in
- if rv = 1 or rv = 2 then false
+ if rv = 1 || rv = 2 then false
else if rv = 0 then true
else failwith "linear_program: An error occurred in the SDP solver";;
@@ -667,7 +667,7 @@ let linear_program a b =
let mats = diagonal b :: List.map (fun j -> diagonal (column j a)) (1--n)
and obj = vector_const (Int 1) m in
let rv,res = run_csdp false obj mats in
- if rv = 1 or rv = 2 then false
+ if rv = 1 || rv = 2 then false
else if rv = 0 then true
else failwith "linear_program: An error occurred in the SDP solver";;
@@ -968,7 +968,7 @@ let run_csdp dbg nblocks blocksizes obj mats =
let csdp nblocks blocksizes obj mats =
let rv,res = run_csdp (!debugging) nblocks blocksizes obj mats in
- (if rv = 1 or rv = 2 then failwith "csdp: Problem is infeasible"
+ (if rv = 1 || rv = 2 then failwith "csdp: Problem is infeasible"
else if rv = 3 then ()
(*Format.print_string "csdp warning: Reduced accuracy";
Format.print_newline() *)
@@ -1052,7 +1052,7 @@ let real_positivnullstellensatz_general linf d eqs leqs pol =
((b,j,i) |-> c) (((b,i,j) |-> c) m))
undefined allassig in
let diagents = foldl
- (fun a (b,i,j) e -> if b > 0 & i = j then equation_add e a else a)
+ (fun a (b,i,j) e -> if b > 0 && i = j then equation_add e a else a)
undefined allassig in
let mats = List.map mk_matrix qvars
and obj = List.length pvs,
@@ -1439,7 +1439,7 @@ let run_csdp dbg obj mats =
let csdp obj mats =
let rv,res = run_csdp (!debugging) obj mats in
- (if rv = 1 or rv = 2 then failwith "csdp: Problem is infeasible"
+ (if rv = 1 || rv = 2 then failwith "csdp: Problem is infeasible"
else if rv = 3 then ()
(* (Format.print_string "csdp warning: Reduced accuracy";
Format.print_newline()) *)