[sledge] Refactor: Simplify Term.solve_sum code

Reviewed By: ngorogiannis

Differential Revision: D21720985

fbshipit-source-id: e63790889
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent 967a9e1c58
commit 0d73a355c9

@ -1296,9 +1296,9 @@ let solve_for_mono rejected_sum coeff mono sum =
(* solve [0 = rejected + sum] *)
let rec solve_sum rejected_sum sum =
let* mono, coeff, sum = Qset.pop_min_elt sum in
solve_for_mono rejected_sum coeff mono sum
|> Option.or_else ~f:(fun () ->
solve_sum (Qset.add rejected_sum mono coeff) sum )
match solve_for_mono rejected_sum coeff mono sum with
| Some _ as soln -> soln
| None -> solve_sum (Qset.add rejected_sum mono coeff) sum
(* solve [0 = e] *)
let solve_zero_eq ?for_ e =

Loading…
Cancel
Save