@@ -1236,38 +1236,6 @@ static exprt negation_of_not_contains_constraint(
12361236 return and_exprt (univ_bounds, get (constraint.premise ()), equal_strings);
12371237}
12381238
1239- // / Negates the constraint to be fed to a solver. The intended usage is to find
1240- // / an assignment of the universal variable that would violate the axiom. To
1241- // / avoid false positives, the symbols other than the universal variable should
1242- // / have been replaced by their valuation in the current model.
1243- // / \pre Symbols other than the universal variable should have been replaced by
1244- // / their valuation in the current model.
1245- // / \param axiom: the not_contains constraint to add the negation of
1246- // / \return: the negation of the axiom under the current evaluation
1247- static exprt negation_of_constraint (const string_constraintt &axiom)
1248- {
1249- // If the for all is vacuously true, the negation is false.
1250- const exprt &lb=axiom.lower_bound ();
1251- const exprt &ub=axiom.upper_bound ();
1252- if (lb.id ()==ID_constant && ub.id ()==ID_constant)
1253- {
1254- const auto lb_int = numeric_cast<mp_integer>(lb);
1255- const auto ub_int = numeric_cast<mp_integer>(ub);
1256- if (!lb_int || !ub_int || ub_int<=lb_int)
1257- return false_exprt ();
1258- }
1259-
1260- // If the premise is false, the implication is trivially true, so the
1261- // negation is false.
1262- if (axiom.premise ()==false_exprt ())
1263- return false_exprt ();
1264-
1265- and_exprt premise (axiom.premise (), axiom.univ_within_bounds ());
1266- and_exprt negaxiom (premise, not_exprt (axiom.body ()));
1267-
1268- return negaxiom;
1269- }
1270-
12711239// / Debugging function which outputs the different steps an axiom goes through
12721240// / to be checked in check axioms.
12731241static void debug_check_axioms_step (
@@ -1365,7 +1333,7 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
13651333 const string_constraintt axiom_in_model (
13661334 univ_var, get (bound_inf), get (bound_sup), get (body));
13671335
1368- exprt negaxiom= negation_of_constraint ( axiom_in_model);
1336+ exprt negaxiom = axiom_in_model. negation ( );
13691337 negaxiom = simplify_expr (negaxiom, ns);
13701338
13711339 stream << indent << i << " .\n " ;
0 commit comments