Enum resolution_prover::Proposition[][src]

pub enum Proposition {
    Or(Box<Proposition>, Box<Proposition>),
    And(Box<Proposition>, Box<Proposition>),
    Implies(Box<Proposition>, Box<Proposition>),
    Iff(Box<Proposition>, Box<Proposition>),
    Not(Box<Proposition>),
    Term(String),
}

A statement in propositional logic.

For example, p /\ (~q) would be representated in the following way.

let p = resolution_prover::term("p".to_string());
let q = resolution_prover::term("q".to_string());

let not_q = resolution_prover::not(q);

let p_and_not_q = resolution_prover::and(p, not_q);

Variants

Trait Implementations

impl Debug for Proposition
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Proposition
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for Proposition
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Display for Proposition
[src]

Displays the proposition using cominations of ascii characters to represent the propositional logic operations.

let hello = resolution_prover::Proposition::Term("hello".to_string());
let hi = resolution_prover::Proposition::Term("hi".to_string());

let not_hi = resolution_prover::not(hi);

let hello_and_not_hi = resolution_prover::and(hello, not_hi);

let expected = String::from("hello /\\ ~(hi)");

assert_eq!(format!("{}", hello_and_not_hi), expected);

Auto Trait Implementations

impl Send for Proposition

impl Sync for Proposition