interface Theory: Iterable<Clause>, Any
Fields
Methods
toMutableTheory
abstract fun toMutableTheory(): MutableTheory
ReturnValue
Name | Description |
---|---|
MutableTheory
|
plus
abstract operator fun plus(theory: Theory): Theory
Parameters
Name | Description |
---|---|
theory: Theory
|
ReturnValue
Name | Description |
---|---|
Theory
|
plus
open operator fun plus(clause: Clause): Theory
Adds given Clause to this Theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
contains
abstract operator fun contains(clause: Clause): Boolean
Checks if given clause is contained in this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
Boolean
|
contains
abstract operator fun contains(head: Struct): Boolean
Checks if given clause is present in this theory
Parameters
Name | Description |
---|---|
head: Struct
|
ReturnValue
Name | Description |
---|---|
Boolean
|
contains
abstract operator fun contains(indicator: Indicator): Boolean
Checks if clauses exists in this theory having the specified Indicator as head; this should be well-formed
Parameters
Name | Description |
---|---|
indicator: Indicator
|
ReturnValue
Name | Description |
---|---|
Boolean
|
get
abstract operator fun get(clause: Clause): Sequence
Retrieves matching clauses from this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
Sequence
|
get
abstract operator fun get(head: Struct): Sequence
Retrieves matching rules from this theory
Parameters
Name | Description |
---|---|
head: Struct
|
ReturnValue
Name | Description |
---|---|
Sequence
|
get
abstract operator fun get(indicator: Indicator): Sequence
Retrieves all rules in this theory having the specified Indicator as head; this should be well-formed
Parameters
Name | Description |
---|---|
indicator: Indicator
|
ReturnValue
Name | Description |
---|---|
Sequence
|
assertA
abstract fun assertA(clause: Clause): Theory
Adds given clause before all other clauses in this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertA
open fun assertA(struct: Struct): Theory
Adds given clause before all other clauses in this theory
Parameters
Name | Description |
---|---|
struct: Struct
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertA
abstract fun assertA(clauses: Iterable<Clause>): Theory
Adds the given clauses before all other clauses in this theory
Parameters
Name | Description |
---|---|
clauses: Iterable<Clause>
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertA
abstract fun assertA(clauses: Sequence
Adds the given clauses before all other clauses in this theory
Parameters
Name | Description |
---|---|
clauses: Sequence
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertZ
abstract fun assertZ(clause: Clause): Theory
Adds given clause after all other clauses in this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertZ
open fun assertZ(struct: Struct): Theory
Adds given clause after all other clauses in this theory
Parameters
Name | Description |
---|---|
struct: Struct
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertZ
abstract fun assertZ(clauses: Iterable<Clause>): Theory
Adds the given clauses after all other clauses in this theory
Parameters
Name | Description |
---|---|
clauses: Iterable<Clause>
|
ReturnValue
Name | Description |
---|---|
Theory
|
assertZ
abstract fun assertZ(clauses: Sequence
Adds the given clauses after all other clauses in this theory
Parameters
Name | Description |
---|---|
clauses: Sequence
|
ReturnValue
Name | Description |
---|---|
Theory
|
retract
abstract fun retract(clause: Clause): RetractResult<Theory>
Tries to delete a matching clause from this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
retract
abstract fun retract(clauses: Iterable<Clause>): RetractResult<Theory>
Tries to delete the matching clauses from this theory
Parameters
Name | Description |
---|---|
clauses: Iterable<Clause>
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
retract
abstract fun retract(clauses: Sequence
Tries to delete the matching clauses from this theory
Parameters
Name | Description |
---|---|
clauses: Sequence
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
retract
open fun retract(head: Struct): RetractResult<Theory>
Tries to delete a matching clause from this theory
Parameters
Name | Description |
---|---|
head: Struct
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
retractAll
abstract fun retractAll(clause: Clause): RetractResult<Theory>
Tries to delete all matching clauses from this theory
Parameters
Name | Description |
---|---|
clause: Clause
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
retractAll
open fun retractAll(head: Struct): RetractResult<Theory>
Tries to delete all matching clauses from this theory
Parameters
Name | Description |
---|---|
head: Struct
|
ReturnValue
Name | Description |
---|---|
RetractResult<Theory>
|
abolish
abstract fun abolish(indicator: Indicator): Theory
Parameters
Name | Description |
---|---|
indicator: Indicator
|
ReturnValue
Name | Description |
---|---|
Theory
|
toString
abstract fun toString(asPrologText: Boolean): String
An enhanced toString that prints the theory in a Prolog program format, if asPrologText is true
Parameters
Name | Description |
---|---|
asPrologText: Boolean
|
ReturnValue
Name | Description |
---|---|
String
|
CompanionObject
Theory
interface Theory: Iterable<Clause>, Any
Methods
of
fun of(vararg clause: Clause): Theory
Creates a Theory, containing the given clauses
Parameters
Name | Description |
---|---|
vararg clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
of
fun of(clauses: Iterable<Clause>): Theory
Creates a Theory, containing the given clauses
Parameters
Name | Description |
---|---|
clauses: Iterable<Clause>
|
ReturnValue
Name | Description |
---|---|
Theory
|
of
fun of(clauses: Sequence
Creates a Theory, containing the given clauses
Parameters
Name | Description |
---|---|
clauses: Sequence
|
ReturnValue
Name | Description |
---|---|
Theory
|
of
fun of(vararg clauses: Scope.()->Clause): Theory
Let developers easily create a Theory, while avoiding variables names clashing by using a different Scope for each Clause
ReturnValue
Name | Description |
---|---|
Theory
|
emptyIndexed
fun emptyIndexed(): Theory
Creates an empty Theory backed by an indexed data structure
ReturnValue
Name | Description |
---|---|
Theory
|
indexedOf
fun indexedOf(vararg clause: Clause): Theory
Creates a Theory backed by an indexed data structure, containing the given clauses
Parameters
Name | Description |
---|---|
vararg clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
indexedOf
fun indexedOf(vararg clauses: Scope.()->Clause): Theory
Let developers easily create a Theory backed by an indexed data structure, while avoiding variables names clashing by using a different Scope for each Clause
ReturnValue
Name | Description |
---|---|
Theory
|
indexedOf
fun indexedOf(clauses: Sequence
Creates a Theory backed by an indexed data structure, containing the given clauses
Parameters
Name | Description |
---|---|
clauses: Sequence
|
ReturnValue
Name | Description |
---|---|
Theory
|
indexedOf
fun indexedOf(clauses: Iterable<Clause>): Theory
Creates a Theory backed by an indexed data structure, containing the given clauses
Parameters
Name | Description |
---|---|
clauses: Iterable<Clause>
|
ReturnValue
Name | Description |
---|---|
Theory
|
emptyListed
fun emptyListed(): Theory
Creates a Theory backed by a list, containing the given clauses
ReturnValue
Name | Description |
---|---|
Theory
|
listedOf
fun listedOf(vararg clause: Clause): Theory
Creates a Theory backed by a list, containing the given clauses
Parameters
Name | Description |
---|---|
vararg clause: Clause
|
ReturnValue
Name | Description |
---|---|
Theory
|
listedOf
fun listedOf(vararg clause: Scope.()->Clause): Theory
Let developers easily create a Theory backed by a list, while avoiding variables names clashing by using a different Scope for each Clause
ReturnValue
Name | Description |
---|---|
Theory
|
Extensions
parse
fun Theory.Companion.parse(input: String, operators: OperatorSet): Theory
Receiver
Name | Description |
---|---|
Theory.Companion
|
Parameters
Name | Description |
---|---|
input: String
|
|
operators: OperatorSet
|
ReturnValue
Name | Description |
---|---|
Theory
|
Adds given Theory to this