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
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)
Trait Implementations
impl Debug for Proposition
[src]
impl Debug for Proposition
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Proposition
[src]
impl PartialEq for Proposition
fn eq(&self, other: &Proposition) -> bool
[src]
fn eq(&self, other: &Proposition) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Proposition) -> bool
[src]
fn ne(&self, other: &Proposition) -> bool
This method tests for !=
.
impl Clone for Proposition
[src]
impl Clone for Proposition
fn clone(&self) -> Proposition
[src]
fn clone(&self) -> Proposition
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Display for Proposition
[src]
impl Display for Proposition
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
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 Send for Proposition
impl Sync for Proposition
impl Sync for Proposition