rfgb.logic module


class rfgb.logic.Goal(rule, parent=None, env={})[source]

Bases: object

class for each goal in rule during prolog search

class rfgb.logic.Logic[source]

Bases: object

Class for logic operations.

static constantsPresentInLiteral(literalTypeSpecification)[source]

Returns true if constants present in type specification.

static generateTests(literalName, literalTypeSpecification, clause)[source]

Generates tests for literal according to modes and types.

static getVariables(literal)[source]

Returns variables in the literal.

class rfgb.logic.Prover[source]

Bases: object

class for prolog style proof of query

goalId = 100
static prove(data, example, clause)[source]

Proves if example satisfies clause given the data. Returns True if it satisfies, else return False.

Prover.rules: contains all of the rules. Prover.trace: If this is 1, displays the proof tree. Prover.goalID: stores the goal ID.

rules = []
static search(term)[source]

Method to perform prolog style query search.

trace = 0
static unify(srcTerm, srcEnv, destTerm, destEnv)[source]

Unification method.

class rfgb.logic.Rule(s)[source]

Bases: object

Class for logic rules in prolog proof.

class rfgb.logic.Term(s)[source]

Bases: object

Class for term in prolog proof.