class documentation

class Clause(list): (source)

Constructor: Clause(data)

View In Hierarchy

Undocumented

Method __add__ Undocumented
Method __getslice__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method __sub__ Undocumented
Method free Undocumented
Method is_tautology Self is a tautology if it contains ground terms P and -P. The ground term, P, must be an exact match, ie, not using unification.
Method isSubsetOf Return True iff every term in 'self' is a term in 'other'.
Method replace Replace every instance of variable with expression across every atom in the clause
Method substitute_bindings Replace every binding
Method subsumes Return True iff 'self' subsumes 'other', this is, if there is a substitution such that every term in 'self' can be unified with a term in 'other'.
Method unify Attempt to unify this Clause with the other, returning a list of resulting, unified, Clauses.
Instance Variable _is_tautology Undocumented
Instance Variable _parents Undocumented
def __add__(self, other): (source)

Undocumented

def __getslice__(self, start, end): (source)

Undocumented

def __init__(self, data): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def __str__(self): (source)

Undocumented

def __sub__(self, other): (source)

Undocumented

def free(self): (source)

Undocumented

def is_tautology(self): (source)

Self is a tautology if it contains ground terms P and -P. The ground term, P, must be an exact match, ie, not using unification.

def isSubsetOf(self, other): (source)

Return True iff every term in 'self' is a term in 'other'.

Parameters
otherClause
Returns
bool
def replace(self, variable, expression): (source)

Replace every instance of variable with expression across every atom in the clause

Parameters
variableVariable
expressionExpression
def substitute_bindings(self, bindings): (source)

Replace every binding

Expressions to which they are bound :return: Clause

Parameters
bindingsA list of tuples mapping Variable Expressions to the
def subsumes(self, other): (source)

Return True iff 'self' subsumes 'other', this is, if there is a substitution such that every term in 'self' can be unified with a term in 'other'.

Parameters
otherClause
Returns
bool
def unify(self, other, bindings=None, used=None, skipped=None, debug=False): (source)

Attempt to unify this Clause with the other, returning a list of resulting, unified, Clauses.

during the unification :param used: tuple of two lists of atoms. The first lists the atoms from 'self' that were successfully unified with atoms from 'other'. The second lists the atoms from 'other' that were successfully unified with atoms from 'self'. :param skipped: tuple of two Clause objects. The first is a list of all the atoms from the 'self' Clause that have not been unified with anything on the path. The second is same thing for the 'other' Clause. :param debug: bool indicating whether debug statements should print :return: list containing all the resulting Clause objects that could be obtained by unification

Parameters
otherClause with which to unify
bindingsBindingDict containing bindings that should be used
usedUndocumented
skippedUndocumented
debugUndocumented
_is_tautology: bool = (source)

Undocumented

_parents = (source)

Undocumented