Skip to main content

ProofStrategy

Enum ProofStrategy 

Source
pub enum ProofStrategy {
    Auto,
    Induction(String),
    ByRule(String),
    Script(String),
}
Expand description

Proof strategies for theorem verification.

Variants§

§

Auto

Automatic proof search using backward chaining. The prover will try all available inference rules.

§

Induction(String)

Induction on a variable (for inductive types like Nat, List). Example: Proof: By induction on n.

Driven by lowering to the tactic script induction <variable>, so there is one proof engine rather than a second, divergent one — and the bare Script spelling Proof: Induction on n. reaches exactly the same proof by the same route. What the structured variant adds is that the METHOD and its ARGUMENT are readable without re-parsing prose.

Only the WHOLE line qualifies: By induction on n. Automatically. is a two-step script and stays one.

§

ByRule(String)

A one-word Proof: line: the proof is a SINGLE named step. Example: Proof: Assumption.

The classification is by SHAPE — one word is one step, more than one word is a Script — so it cannot drift against the inference-rule enum or the tactic table. The vernacular has exactly ONE proof-step namespace (the tactics), and the step runs through the same engine a script does.

A word that names a kernel INFERENCE RULE rather than a tactic — Proof: ModusPonens. — is reported as exactly that and is NOT applied here. A rule is not a step, exactly as Lean answers by modus_ponens with “unknown tactic” and wants apply; the diagnostic names the spelling that DOES apply it, Proof: By ModusPonens., which lowers to the by_rule tactic and is certified before it reports success.

§

Script(String)

An explicit tactic-script proof, written in the English-esque vernacular and run by the tactic framework. Over the block

## Theorem: Or_Commutes
Given (h): Bob is happy or Bob is sad.
Prove: Bob is sad or Bob is happy.
Proof: By cases on h. Right, by assumption. Left, by assumption.

the script is Proof: By cases on h. Right, by assumption. Left, by assumption.

The example names its BLOCK because a proof step is only meaningful against a goal: the spelling taught here before, which opened with Assume h., wanted a goal that was BOTH an implication (for Assume) and a disjunction (for cases), a shape this surface has no sentence for, so the one worked example of the one open-ended variant could not be run on anything. That is the same defect as T12-005 one variant over. Every Proof: spelling quoted in this file is now extracted from the file and run against the surface by logicaffeine-tests::L_language_extra::every_proof_spelling_our_own_doc_comments_teach_is_checked_against_the_surface, so a doc comment cannot teach a spelling the surface does not accept.

Trait Implementations§

Source§

impl Clone for ProofStrategy

Source§

fn clone(&self) -> ProofStrategy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProofStrategy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProofStrategy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ProofStrategy

Source§

fn eq(&self, other: &ProofStrategy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ProofStrategy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,