Skip to content

Properties

opulse.solver.properties

Algebraic properties of operators, including commutativity.

Equality is equality in V = Z u {NaN}: two sides agree when both are NaN or both are defined and equal. Each property gets one of four verdicts:

  • proved - z3 shows no counterexample exists in the value domain [-B, B];
  • refuted - a counterexample, found by a concrete search (small range, then boundary values) or by z3 and always re-checked with the oracle;
  • bounded - z3 could not decide; no counterexample on an exhaustive small range (the range is recorded);
  • not_found - (identity / absorbing element) no element among the candidates works; other elements were not ruled out (candidates' range recorded);
  • undecided - neither z3 nor the bounded check applies.

Laws over all integers are undecidable in general (nonlinear arithmetic), so bounded is the honest answer when z3 reaches its resource limit.

PropertyChecker

check_all

check_all(operator: Operator) -> dict[str, dict]

Every law of the operator's arity.

distributes_over

distributes_over(f: Operator, g: Operator) -> Verdict

f(a, g(b, c)) == g(f(a, b), f(a, c)).

properties_for

properties_for(n_ary: int) -> tuple[str, ...]

The laws meaningful for an operator of this arity.