|
|
@ -114,12 +114,16 @@ end = struct
|
|
|
|
non-coefficient, so Integer and Rational terms must compare higher than
|
|
|
|
non-coefficient, so Integer and Rational terms must compare higher than
|
|
|
|
any valid monomial *)
|
|
|
|
any valid monomial *)
|
|
|
|
let compare x y =
|
|
|
|
let compare x y =
|
|
|
|
match (x, y) with
|
|
|
|
if x == y then 0
|
|
|
|
| Var {id= i; name= _}, Var {id= j; name= _} when i > 0 && j > 0 ->
|
|
|
|
else
|
|
|
|
Int.compare i j
|
|
|
|
match (x, y) with
|
|
|
|
| _ -> compare x y
|
|
|
|
| Var {id= i; name= _}, Var {id= j; name= _} when i > 0 && j > 0 ->
|
|
|
|
|
|
|
|
Int.compare i j
|
|
|
|
|
|
|
|
| _ -> compare x y
|
|
|
|
|
|
|
|
|
|
|
|
let equal x y =
|
|
|
|
let equal x y =
|
|
|
|
|
|
|
|
x == y
|
|
|
|
|
|
|
|
||
|
|
|
|
match (x, y) with
|
|
|
|
match (x, y) with
|
|
|
|
| Var {id= i; name= _}, Var {id= j; name= _} when i > 0 && j > 0 ->
|
|
|
|
| Var {id= i; name= _}, Var {id= j; name= _} when i > 0 && j > 0 ->
|
|
|
|
Int.equal i j
|
|
|
|
Int.equal i j
|
|
|
|