[sledge] Relax overly strong polynomial invariants

Reviewed By: mbouaziz

Differential Revision: D15098814

fbshipit-source-id: 4e4dac320
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent 8a9cf0198a
commit 0d70f57c6f

@ -387,7 +387,7 @@ let assert_monomial add_typ mono =
match mono with
| Mul {typ; args} ->
assert (Typ.castable add_typ typ) ;
assert (Option.exists ~f:(fun n -> 1 < n) (Typ.prim_bit_size_of typ)) ;
assert (Option.is_some (Typ.prim_bit_size_of typ)) ;
Qset.iter args ~f:(fun factor exponent ->
assert (Q.sign exponent > 0) ;
assert_indeterminate factor |> Fn.id )
@ -401,8 +401,10 @@ let assert_poly_term add_typ mono coeff =
match mono with
| Integer {data} -> assert (Z.equal Z.one data)
| Mul {args} ->
if Q.equal Q.one coeff then assert (Qset.length args > 1)
else assert (Qset.length args > 0) ;
( match Qset.min_elt args with
| None | Some (Integer _, _) -> assert false
| Some (_, n) -> assert (Qset.length args > 1 || not (Q.equal Q.one n))
) ;
assert_monomial add_typ mono |> Fn.id
| _ -> assert_monomial add_typ mono |> Fn.id

Loading…
Cancel
Save