"""Develop a named intermediate claim independently of its continuation."""

from judgment import Session, implies


def main() raises:
    var s = Session()
    var P = s.prop("P")
    var Q = s.prop("Q")
    var proof = s.theorem("swap_with_claim", implies(P & Q, Q & P))
    var h = proof.intro()

    var step = proof.have("first_component", Q)
    step.sorry()
    proof.exact(proof.conjoin(step.fact(), proof.left(h)))

    # The continuation is solved, but the intermediate claim still needs proof.
    step.resume()
    step.exact(step.right(h))
    var theorem = proof.finish()
    print(theorem)
    print("Axiom dependencies:", len(theorem.axioms()))
