DeclarativeProlog

io.github.kelvindev15.prolog.dsl.DeclarativeProlog

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited classlikes

Attributes

Inherited from:
DeclarativePrologUtils (hidden)
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
DeclarativePrologUtils (hidden)
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
DeclarativePrologUtils (hidden)
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Value members

Concrete methods

def assert(using dynamicTheory: MutableDynamicTheoryWrapper)(clause: Clause): Unit

Add an assert(X) clause to the dynamicTheory provided as a context parameter.

Add an assert(X) clause to the dynamicTheory provided as a context parameter.

Value parameters

clause

the clause to assert in the theory.

dynamicTheory

the theory to which the clause will be added.

Attributes

def assertA(using dynamicTheory: MutableDynamicTheoryWrapper)(clause: Clause): Unit

Add an asserta(X) clause to the dynamicTheory provided as a context parameter.

Add an asserta(X) clause to the dynamicTheory provided as a context parameter.

Value parameters

clause

the clause to assert in the theory.

dynamicTheory

the theory to which the clause will be added.

Attributes

def assertZ(using dynamicTheory: MutableDynamicTheoryWrapper)(clause: Clause): Unit

Add an assertz(X) clause to the dynamicTheory provided as a context parameter.

Add an assertz(X) clause to the dynamicTheory provided as a context parameter.

Value parameters

clause

the clause to assert in the theory.

dynamicTheory

the theory to which the clause will be added.

Attributes

def clause(using theory: MutableTheoryWrapper)(c: Clause): Unit

Add a clause (either a rule, a fact or a directive) to a MutableTheoryWrapper provided as a context parameter.

Add a clause (either a rule, a fact or a directive) to a MutableTheoryWrapper provided as a context parameter.

Value parameters

c

the clause to add to the theory.

theory

the theory to which the clause will be added.

Attributes

def directive(using theory: MutableTheoryWrapper)(directive: Directive): Unit

Add a directive to a MutableTheoryWrapper provided as a context parameter.

Add a directive to a MutableTheoryWrapper provided as a context parameter.

Value parameters

directive

the directive to add to the theory.

theory

the theory to which the directive will be added.

Attributes

def dynamicTheory(using program: PrologProgram)(theory: MutableDynamicTheoryWrapper ?=> Unit): Unit

Sets the dynamic theory of a PrologProgram. Warning: it overrides any previously dynamic theory set in the program.

Sets the dynamic theory of a PrologProgram. Warning: it overrides any previously dynamic theory set in the program.

Value parameters

program

the program whose dynamic theory has to be set.

theory

a function that takes a MutableDynamicTheoryWrapper as a context parameter and operates on it e.g to add or remove clauses.

Attributes

def fact(using theory: MutableTheoryWrapper)(fact: Fact): Unit

Add a fact to a MutableTheoryWrapper provided as a context parameter.

Add a fact to a MutableTheoryWrapper provided as a context parameter.

Value parameters

fact

the fact to add to the theory.

theory

the theory to which the fact will be added.

Attributes

def goal(using program: PrologProgram)(g: Term): Unit

Sets the goal of a PrologProgram provided as a context parameter.

Sets the goal of a PrologProgram provided as a context parameter.

Value parameters

g

the goal to set in the program.

program

the program whose goal will be set.

Attributes

def programTheory(using program: PrologProgram)(theory: MutableDynamicTheoryWrapper ?=> Unit): Unit

Alias of dynamicTheory. Sets the dynamic theory of a PrologProgram. Warning: it overrides any previously dynamic theory set in the program.

Alias of dynamicTheory. Sets the dynamic theory of a PrologProgram. Warning: it overrides any previously dynamic theory set in the program.

Value parameters

program

the program whose dynamic theory has to be set.

theory

a function that takes a MutableDynamicTheoryWrapper as a context parameter and operates on it e.g to add or remove clauses.

Attributes

def prolog(program: PrologProgram ?=> Unit): PrologProgram

Returns a new PrologProgram.

Returns a new PrologProgram.

Value parameters

program

a function that takes a PrologProgram as a context parameter and operates on it.

Attributes

def rule(using theory: MutableTheoryWrapper)(rule: Rule): Unit

Add a rule to a MutableTheoryWrapper provided as a context parameter.

Add a rule to a MutableTheoryWrapper provided as a context parameter.

Value parameters

rule

the rule to add to the theory.

theory

the theory to which the rule will be added.

Attributes

def staticTheory(using program: PrologProgram)(theory: MutableTheoryWrapper ?=> Unit): Unit

Sets the static theory of a PrologProgram. Warning: it overrides any previously static theory set in the program.

Sets the static theory of a PrologProgram. Warning: it overrides any previously static theory set in the program.

Value parameters

program

the program whose static theory has to be set.

theory

a function that takes a MutableTheoryWrapper as a context parameter and operates on it e.g to add or remove clauses.

Attributes