Type Alias cop::tptp::SFof

source ·
pub type SFof = Fof<FofAtom<String, String, String>, String>;
Expand description

String formula.

Aliased Type§

enum SFof {
    Atom(FofAtom<String, String, String>),
    Neg(Box<Fof<FofAtom<String, String, String>, String>, Global>),
    Bin(Box<Fof<FofAtom<String, String, String>, String>, Global>, Op, Box<Fof<FofAtom<String, String, String>, String>, Global>),
    BinA(OpA, Vec<Fof<FofAtom<String, String, String>, String>, Global>),
    Quant(Quantifier, String, Box<Fof<FofAtom<String, String, String>, String>, Global>),
}

Variants§

§

Atom(FofAtom<String, String, String>)

atom

§

Neg(Box<Fof<FofAtom<String, String, String>, String>, Global>)

negation

§

Bin(Box<Fof<FofAtom<String, String, String>, String>, Global>, Op, Box<Fof<FofAtom<String, String, String>, String>, Global>)

binary operation

§

BinA(OpA, Vec<Fof<FofAtom<String, String, String>, String>, Global>)

associative binary operation

§

Quant(Quantifier, String, Box<Fof<FofAtom<String, String, String>, String>, Global>)

quantification

Implementations§

source§

impl<A, V> Fof<A, V>

source

pub fn bin(l: Self, o: Op, r: Self) -> Self

Apply a binary operation to two formulas.

source

pub fn bina(l: Self, o: OpA, r: Self) -> Self

Apply an associative binary operation to two formulas.

If r is itself an application of o, then l is simply added to r. For example, if o is conjunction and r is a & b, then the result is l & a & b, not l & (a & b).

source

pub fn binas(o: OpA, fms: impl DoubleEndedIterator<Item = Self>) -> Self

For formulas f1, .., fn, return f1 o (… o fn).

source

pub fn imp(l: Self, r: Self) -> Self

Create the implication from l to r.

source

pub fn quant(q: Quantifier, v: V, fm: Self) -> Self

Create a quantification.

source

pub fn forall(v: V, fm: Self) -> Self

Create a universal quantification.

source

pub fn foralls(vs: impl Iterator<Item = V>, fm: Self) -> Self

Universally quantify over a sequence of variables.

source

pub fn add_premise(self, premise: Self) -> Self

If self is of shape a => b, then return premise & a => b, else premise => self.

source

pub fn mark_impl(self, fm: impl Fn() -> Self) -> (bool, Self)

If self is of shape a => c, then return a & fm() => fm() & c, else self.

Also return whether self is an implication, i.e. whether the output formula does not equal self.

source

pub fn map_atoms<B>(self, f: &mut impl FnMut(A) -> B) -> Fof<B, V>

Apply a function to all atoms.

source

pub fn map_vars<W>(self, f: &mut impl FnMut(V) -> W) -> Fof<A, W>

Apply a function to all variables.

source

pub fn atoms(&self) -> Box<dyn Iterator<Item = &A> + '_>

Return all atoms occurring in the formula.

source§

impl<P, C, V> Fof<FofAtom<P, C, V>, V>

source

pub fn atom(p: P, args: Args<Term<C, V>>) -> Self

Construct an atom.

source

pub fn eqtm(l: Term<C, V>, r: Term<C, V>) -> Self

Construct an equality between two terms.

source§

impl<A: Clone + Neg<Output = A>, V: Clone> Fof<A, V>

source

pub fn qnnf( self, f: &impl Fn(bool, Self, Op, Self) -> Self ) -> Nnf<A, V, Quantifier>

Convert to NNF, replacing non-associative binary operations via function.

source

pub fn unfold_eqfm_disj_conj(pol: bool, l: Self, op: Op, r: Self) -> Self

Unfold logical equivalence with a disjunction of conjunctions.

Used in (nondefinitional) leanCoP.

source

pub fn unfold_eqfm_conj_impl(pol: bool, l: Self, op: Op, r: Self) -> Self

Unfold logical equivalence with a conjunction of implications.

Used in nanoCoP.

source§

impl<P: Eq, C: Eq, V> Fof<FofAtom<P, C, V>, V>

source

pub fn predconst_unique(&self) -> (Vec<(&P, usize)>, Vec<(&C, usize)>)

Corresponds to leanCoP’s collect_predfunc.

Trait Implementations§

source§

impl<A, V> BitAnd<Fof<A, V>> for Fof<A, V>

§

type Output = Fof<A, V>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
source§

impl<A, V> BitOr<Fof<A, V>> for Fof<A, V>

§

type Output = Fof<A, V>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
source§

impl<A: Clone, V: Clone> Clone for Fof<A, V>

source§

fn clone(&self) -> Fof<A, V>

Returns a copy 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<A: Debug, V: Debug> Debug for Fof<A, V>

source§

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

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

impl<Atom: Display, V: Display> Display for Fof<Atom, V>

source§

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

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

impl From<AtomicFormula<'_>> for SFof

source§

fn from(frm: AtomicFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<BinaryAssoc<'_>> for SFof

source§

fn from(fm: BinaryAssoc<'_>) -> Self

Converts to this type from the input type.
source§

impl From<BinaryFormula<'_>> for SFof

source§

fn from(frm: BinaryFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<BinaryNonassoc<'_>> for SFof

source§

fn from(frm: BinaryNonassoc<'_>) -> Self

Converts to this type from the input type.
source§

impl From<DefinedAtomicFormula<'_>> for SFof

source§

fn from(frm: DefinedAtomicFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<DefinedPlainFormula<'_>> for SFof

source§

fn from(fm: DefinedPlainFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<Disjunction<'_>> for SFof

source§

fn from(frm: Disjunction<'_>) -> Self

Converts to this type from the input type.
source§

impl From<Formula<'_>> for SFof

source§

fn from(frm: Formula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<Formula<'_>> for SFof

source§

fn from(frm: Formula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<InfixUnary<'_>> for SFof

source§

fn from(frm: InfixUnary<'_>) -> Self

Converts to this type from the input type.
source§

impl From<Literal<'_>> for SFof

source§

fn from(lit: Literal<'_>) -> Self

Converts to this type from the input type.
source§

impl From<LogicFormula<'_>> for SFof

source§

fn from(frm: LogicFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<PlainAtomicFormula<'_>> for SFof

source§

fn from(frm: PlainAtomicFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<QuantifiedFormula<'_>> for SFof

source§

fn from(frm: QuantifiedFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<UnaryFormula<'_>> for SFof

source§

fn from(frm: UnaryFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<UnitFormula<'_>> for SFof

source§

fn from(frm: UnitFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl From<UnitaryFormula<'_>> for SFof

source§

fn from(frm: UnitaryFormula<'_>) -> Self

Converts to this type from the input type.
source§

impl<A, V> Neg for Fof<A, V>

§

type Output = Fof<A, V>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl<A: PartialEq, V: PartialEq> PartialEq<Fof<A, V>> for Fof<A, V>

source§

fn eq(&self, other: &Fof<A, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A: Eq, V: Eq> Eq for Fof<A, V>

source§

impl<A, V> StructuralEq for Fof<A, V>

source§

impl<A, V> StructuralPartialEq for Fof<A, V>