Skip to content

Commit

Permalink
update simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrakananandi committed Jul 13, 2018
1 parent 588a2de commit 49ab2ca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/CAD.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,18 +1152,18 @@ module RawCAD3
else
Unop (op, sc)
| Binop (op, cA, cB) ->
if m = compile Empty then
Empty
let sA = simplify cA in
let sB = simplify cB in
if compile (Binop (Diff, sA, c)) = M.mesh []
&& compile (Binop (Diff, c, sA)) = M.mesh []
then
sA
else
let sA = simplify cA in
let sB = simplify cB in
if M.equiv m (compile sA) then
sA
else
if M.equiv m (compile sB) then
sB
else
Binop (op, sA, sB)
if compile (Binop (Diff, sB, c)) = M.mesh []
&& compile (Binop (Diff, c, sB)) = M.mesh [] then
sB
else
Binop (op, sA, sB)

(* TODO: add other primitives *)
let rec rand n =
Expand Down

0 comments on commit 49ab2ca

Please sign in to comment.