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
impl Clone for ProofStrategy
Source§fn clone(&self) -> ProofStrategy
fn clone(&self) -> ProofStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProofStrategy
impl Debug for ProofStrategy
Source§impl Default for ProofStrategy
impl Default for ProofStrategy
Source§fn default() -> ProofStrategy
fn default() -> ProofStrategy
Source§impl PartialEq for ProofStrategy
impl PartialEq for ProofStrategy
impl StructuralPartialEq for ProofStrategy
Auto Trait Implementations§
impl Freeze for ProofStrategy
impl RefUnwindSafe for ProofStrategy
impl Send for ProofStrategy
impl Sync for ProofStrategy
impl Unpin for ProofStrategy
impl UnsafeUnpin for ProofStrategy
impl UnwindSafe for ProofStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.