ProofExpr

Enum ProofExpr 

Source
pub enum ProofExpr {
Show 22 variants Predicate { name: String, args: Vec<ProofTerm>, world: Option<String>, }, Identity(ProofTerm, ProofTerm), Atom(String), And(Box<ProofExpr>, Box<ProofExpr>), Or(Box<ProofExpr>, Box<ProofExpr>), Implies(Box<ProofExpr>, Box<ProofExpr>), Iff(Box<ProofExpr>, Box<ProofExpr>), Not(Box<ProofExpr>), ForAll { variable: String, body: Box<ProofExpr>, }, Exists { variable: String, body: Box<ProofExpr>, }, Modal { domain: String, force: f32, flavor: String, body: Box<ProofExpr>, }, Temporal { operator: String, body: Box<ProofExpr>, }, Lambda { variable: String, body: Box<ProofExpr>, }, App(Box<ProofExpr>, Box<ProofExpr>), NeoEvent { event_var: String, verb: String, roles: Vec<(String, ProofTerm)>, }, Ctor { name: String, args: Vec<ProofExpr>, }, Match { scrutinee: Box<ProofExpr>, arms: Vec<MatchArm>, }, Fixpoint { name: String, body: Box<ProofExpr>, }, TypedVar { name: String, typename: String, }, Hole(String), Term(ProofTerm), Unsupported(String),
}
Expand description

Owned expression representation for proof manipulation.

Supports all LogicExpr variants to enable full language coverage. This is the “proposition” side of the Curry-Howard correspondence.

§See Also

Variants§

§

Predicate

Atomic predicate: P(t1, t2, …)

Fields

§name: String
§

Identity(ProofTerm, ProofTerm)

Identity: t1 = t2

§

Atom(String)

Propositional atom

§

And(Box<ProofExpr>, Box<ProofExpr>)

Conjunction: P ∧ Q

§

Or(Box<ProofExpr>, Box<ProofExpr>)

Disjunction: P ∨ Q

§

Implies(Box<ProofExpr>, Box<ProofExpr>)

Implication: P → Q

§

Iff(Box<ProofExpr>, Box<ProofExpr>)

Biconditional: P ↔ Q

§

Not(Box<ProofExpr>)

Negation: ¬P

§

ForAll

Universal quantification: ∀x P(x)

Fields

§variable: String
§

Exists

Existential quantification: ∃x P(x)

Fields

§variable: String
§

Modal

Modal operator: □P or ◇P (with world semantics)

Fields

§domain: String
§force: f32
§flavor: String
§

Temporal

Temporal operator: Past(P) or Future(P)

Fields

§operator: String
§

Lambda

Lambda abstraction: λx.P

Fields

§variable: String
§

App(Box<ProofExpr>, Box<ProofExpr>)

Function application: (f x)

§

NeoEvent

Neo-Davidsonian event: ∃e(Verb(e) ∧ Agent(e,x) ∧ …)

Fields

§event_var: String
§verb: String
§

Ctor

Data Constructor: Zero, Succ(n), Cons(h, t), etc. The building blocks of inductive types.

Fields

§name: String
§

Match

Pattern Matching: match n { Zero => A, Succ(k) => B } Eliminates inductive types by case analysis.

Fields

§scrutinee: Box<ProofExpr>
§

Fixpoint

Recursive Function (Fixpoint): fix f. λn. … Defines recursive functions over inductive types.

Fields

§name: String
§

TypedVar

Typed Variable: n : Nat Signals to the prover that induction may be applicable.

Fields

§name: String
§typename: String
§

Hole(String)

Meta-variable (unification hole) to be solved during proof search. Represents an unknown expression, typically a function or predicate. Example: Hole(“P”) in ?P(x) = Body, to be solved as P = λx.Body

§

Term(ProofTerm)

Embedded term (lifts ProofTerm into ProofExpr context). Used when a term appears where an expression is expected. Example: App(Hole(“P”), Term(BoundVarRef(“x”)))

§

Unsupported(String)

Unsupported construct (with description for debugging)

Trait Implementations§

Source§

impl Clone for ProofExpr

Source§

fn clone(&self) -> ProofExpr

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 ProofExpr

Source§

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

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

impl Display for ProofExpr

Source§

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

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

impl PartialEq for ProofExpr

Source§

fn eq(&self, other: &ProofExpr) -> 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 ProofExpr

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.