pub enum PTerm {
Ident(String),
App(Box<PTerm>, Vec<PTerm>),
Tuple(Vec<PTerm>),
Hole,
Op(&'static str, Box<PTerm>, Box<PTerm>),
}Expand description
A term as a proof SCRIPT writes it — the argument of exact, have, refine, use.
One syntax serves two languages, because Lean’s does: the same ⟨a, b⟩ is a conjunction
proof against p ∧ q and a witness-and-proof pair against ∃x. φ, and the same bare
name is a hypothesis in a proof position and a variable in a value position. Which
language a term is read in is decided by the position, never by the term
(ProofState::exact_term checks it as a proof, ProofState::value_term as a value).
Variants§
Ident(String)
A bare name: a hypothesis, a bound variable, or a constant.
App(Box<PTerm>, Vec<PTerm>)
Juxtaposition — f a b. Modus ponens over an implication, instantiation over a
universal, a function application in a value position.
Tuple(Vec<PTerm>)
The anonymous constructor (a, b) / ⟨a, b⟩.
Hole
A ?_ / ?name hole — a subgoal under refine, and an error anywhere else.
Op(&'static str, Box<PTerm>, Box<PTerm>)
An infix arithmetic operator, by its ProofTerm function name (add/sub/mul).