Std.Proof.LinearArithmetic.Reflection (Cure Standard Library v0.37.2)

View Source

Indexed evidence wrappers, not a checker-to-goal soundness theorem.

check_lia_candidate computes a Boolean certificate verdict. Evidence of that verdict is not evidence of an arbitrary integer comparison. In particular, IsTrue(True()) must never be used in place of the original goal.

The omega tactic currently reconstructs a bounded fragment with ordinary checked IntOrder lemmas. A general theorem relating successful certificate checking, holding hypotheses, and the goal's semantics remains separate work.

Examples

use Std.Bool
use Std.Int
use Std.Proof.IntMath
use Std.Proof.IntOrder
use Std.Proof.LinearArithmetic.Reflection

fn wrap_le(a: Int, b: Int, ev: IsTrue(le_int(a, b))) -> IsLessThanOrEqual(a, b) =
  close_less_than_or_equal(ev)

fn wrap_lt(a: Int, b: Int, ev: IsTrue(lt_int(a, b))) -> IsLessThan(a, b) =
  close_less_than(ev)

Summary

Functions

Preserve the exact checker application in the evidence's type. This wrapper does not produce a proof from a Bool or establish goal soundness.

Wrap Boolean evidence of lt_int(left, right) as an IsLessThan proof.

Preserve evidence of this atom's actual semantics. Callers must supply that evidence; a successful Farkas check alone is not an argument here.

Functions

checked_holds(hypotheses: Hypotheses, goal: LinearAtom, witness: FarkasWitness, checked: IsTrue(check_lia_candidate(hypotheses, goal, witness))) -> IsTrue(check_lia_candidate(hypotheses, goal, witness))

 fn checked_holds(hypotheses: Hypotheses, goal: LinearAtom, witness: FarkasWitness, checked: IsTrue(check_lia_candidate(hypotheses, goal, witness))) -> IsTrue(check_lia_candidate(hypotheses, goal, witness))

Preserve the exact checker application in the evidence's type. This wrapper does not produce a proof from a Bool or establish goal soundness.

close_less_than(left: Int, right: Int, evidence: IsTrue(lt_int(left, right))) -> IsLessThan(left, right)

 fn close_less_than(left: Int, right: Int, evidence: IsTrue(lt_int(left, right))) -> IsLessThan(left, right)

Wrap Boolean evidence of lt_int(left, right) as an IsLessThan proof.

close_less_than_or_equal(left: Int, right: Int, evidence: IsTrue(le_int(left, right))) -> IsLessThanOrEqual(left, right)

 fn close_less_than_or_equal(left: Int, right: Int, evidence: IsTrue(le_int(left, right))) -> IsLessThanOrEqual(left, right)

The exact Boolean comparison evidence is required by the constructor.

goal_evaluates_true(goal: LinearAtom, valuation: Valuation, evidence: IsTrue(evaluate_atom(goal, valuation))) -> IsTrue(evaluate_atom(goal, valuation))

 fn goal_evaluates_true(goal: LinearAtom, valuation: Valuation, evidence: IsTrue(evaluate_atom(goal, valuation))) -> IsTrue(evaluate_atom(goal, valuation))

Preserve evidence of this atom's actual semantics. Callers must supply that evidence; a successful Farkas check alone is not an argument here.