C# Class Prolog.KnowledgeBase

Mostra file Open project: ianhorswill/UnityProlog Class Usage Examples

Public Properties

Property Type Description
ELRoot ELNode
GameObject UnityEngine.GameObject
Parent KnowledgeBase

Private Properties

Property Type Description
CallPrimitive IEnumerable
CheckForPredicateInfo PredicateInfo
CheckForPredicateInfoInThisKB PredicateInfo
CheckForPredicateInfoInThisKB PredicateInfo
Commafy Structure
Compile void
Consult void
DeclareExternal void
DeclareHigherOrderArguments void
DeclarePublic void
DeclareRandomizable void
DeclareShadow void
DeclareTraced void
DeclareUntraced void
DefaultExtension string
Disassemble void
EntryForStoring PredicateInfo
EntryListForStoring List
FindClauses IEnumerable
Forget void
GetPredicateInfo PredicateInfo
IsSourceFile bool
KnowledgeBase System
KnowledgeBase System
KnowledgeBase System
LoadCSVRow void
Prove IEnumerable
ProveFromDB IEnumerable
Reconsult void
Reconsult void
Reconsult void
ReconsultString void
ReloadModifiedSourceFiles void
Retract IEnumerable
Retract IEnumerable
SourceFor string
SourceFromPredicateInfo void
TermExpansion object

Public Methods

Method Description
Assert ( Structure structure, bool atEnd, bool checkSingletons ) : void

Add a term (fact or rule) to the KB.

Assert ( object term, bool atEnd, bool checkSingletons ) : void

Add a term (fact or rule) to the KB.

AssertA ( Structure structure ) : void

Add a term (fact or rule) to the KB.

AssertA ( object term ) : void

Add a term (fact or rule) to the KB.

AssertZ ( Structure structure ) : void

Add a term (fact or rule) to the KB.

AssertZ ( object term ) : void

Add a term (fact or rule) to the KB.

Clear ( ) : void

Erases the complete contents of the KB

Consult ( Stream stream ) : void

Load assertions into the KB

Consult ( string path ) : void

Load assertions into the KB

ConsultString ( string text ) : void

Load assertions into the KB

IsTrue ( object goal, object thisValue = null ) : bool

True if the specified goal is provable within this KnowledgeBase.

Prove ( Structure t ) : IEnumerable

Attempts to prove the specified goal. WARNING: THIS WILL LEAK A PROLOG CONTEXT UNLESS ENUMERATED TO COMPLETION.

RetractAll ( Structure head ) : void

Remove all terms matching head

RetractAll ( object term ) : void

Remove a term from the KB.

SolveFor ( LogicVariable result, object goal, object thisValue, bool throwOnFailure = true ) : object

True if the specified goal is provable within this KnowledgeBase.

ToString ( ) : string
Undefined ( Prolog.PredicateIndicator p ) : bool

True if the specified functor/arity is undefined.

Private Methods

Method Description
CallPrimitive ( Symbol functor, Prolog.PrologPrimitives handler, object args, PrologContext context ) : IEnumerable
CheckForPredicateInfo ( Prolog.PredicateIndicator p ) : PredicateInfo
CheckForPredicateInfoInThisKB ( Prolog.PredicateIndicator p ) : PredicateInfo
CheckForPredicateInfoInThisKB ( Symbol functor, int arity ) : PredicateInfo
Commafy ( Structure structures ) : Structure
Compile ( Prolog.PredicateIndicator p ) : void
Consult ( TextReader inStream ) : void
DeclareExternal ( Prolog.PredicateIndicator p ) : void
DeclareHigherOrderArguments ( Prolog.PredicateIndicator p, int arguments ) : void
DeclarePublic ( Prolog.PredicateIndicator p ) : void
DeclareRandomizable ( Prolog.PredicateIndicator p ) : void
DeclareShadow ( Prolog.PredicateIndicator p ) : void
DeclareTraced ( Prolog.PredicateIndicator p ) : void
DeclareUntraced ( Prolog.PredicateIndicator p ) : void
DefaultExtension ( string path, string extension ) : string
Disassemble ( Prolog.PredicateIndicator p ) : void
EntryForStoring ( Prolog.PredicateIndicator p ) : PredicateInfo
EntryListForStoring ( Prolog.PredicateIndicator p ) : List
FindClauses ( Structure head, object body ) : IEnumerable
Forget ( Prolog.PredicateIndicator p ) : void
GetPredicateInfo ( KnowledgeBase kb, Prolog.PredicateIndicator p ) : PredicateInfo
IsSourceFile ( string file ) : bool
KnowledgeBase ( ) : System
KnowledgeBase ( string kbName, GameObject gameObject ) : System
KnowledgeBase ( string kbName, GameObject gameObject, KnowledgeBase parent ) : System
LoadCSVRow ( int rowNumber, Structure row ) : void
Prove ( Symbol functor, object args, PrologContext context, ushort parentFrame ) : IEnumerable

Attempts to prove the specified goal.

ProveFromDB ( Symbol functor, object args, PrologContext context ) : IEnumerable
Reconsult ( Stream stream ) : void
Reconsult ( TextReader inStream ) : void
Reconsult ( string path ) : void
ReconsultString ( string text ) : void
ReloadModifiedSourceFiles ( ) : void
Retract ( Structure head, object body ) : IEnumerable
Retract ( object term ) : IEnumerable
SourceFor ( Prolog.PredicateIndicator p ) : string
SourceFromPredicateInfo ( Prolog.PredicateIndicator p, PredicateInfo predicateInfo, ISOPrologWriter writer ) : void
TermExpansion ( object unexpanded ) : object

Method Details

Assert() public method

Add a term (fact or rule) to the KB.
public Assert ( Structure structure, bool atEnd, bool checkSingletons ) : void
structure Structure
atEnd bool
checkSingletons bool
return void

Assert() public method

Add a term (fact or rule) to the KB.
public Assert ( object term, bool atEnd, bool checkSingletons ) : void
term object
atEnd bool
checkSingletons bool
return void

AssertA() public method

Add a term (fact or rule) to the KB.
public AssertA ( Structure structure ) : void
structure Structure
return void

AssertA() public method

Add a term (fact or rule) to the KB.
public AssertA ( object term ) : void
term object
return void

AssertZ() public method

Add a term (fact or rule) to the KB.
public AssertZ ( Structure structure ) : void
structure Structure
return void

AssertZ() public method

Add a term (fact or rule) to the KB.
public AssertZ ( object term ) : void
term object
return void

Clear() public method

Erases the complete contents of the KB
public Clear ( ) : void
return void

Consult() public method

Load assertions into the KB
public Consult ( Stream stream ) : void
stream Stream
return void

Consult() public method

Load assertions into the KB
public Consult ( string path ) : void
path string
return void

ConsultString() public method

Load assertions into the KB
public ConsultString ( string text ) : void
text string
return void

IsTrue() public method

True if the specified goal is provable within this KnowledgeBase.
public IsTrue ( object goal, object thisValue = null ) : bool
goal object Goal to attempt to prove
thisValue object The value to give ot the $this indexical while running the goal
return bool

Prove() public method

Attempts to prove the specified goal. WARNING: THIS WILL LEAK A PROLOG CONTEXT UNLESS ENUMERATED TO COMPLETION.
public Prove ( Structure t ) : IEnumerable
t Structure
return IEnumerable

RetractAll() public method

Remove all terms matching head
public RetractAll ( Structure head ) : void
head Structure
return void

RetractAll() public method

Remove a term from the KB.
public RetractAll ( object term ) : void
term object
return void

SolveFor() public method

True if the specified goal is provable within this KnowledgeBase.
public SolveFor ( LogicVariable result, object goal, object thisValue, bool throwOnFailure = true ) : object
result LogicVariable Value of variable to return
goal object Goal to attempt to prove
thisValue object Value to give ot the indexical $this during execution
throwOnFailure bool If true, SolveFor will throw a GoalException if the goal fails
return object

ToString() public method

public ToString ( ) : string
return string

Undefined() public method

True if the specified functor/arity is undefined.
public Undefined ( Prolog.PredicateIndicator p ) : bool
p Prolog.PredicateIndicator
return bool

Property Details

ELRoot public_oe property

public ELNode ELRoot
return ELNode

GameObject public_oe property

public GameObject,UnityEngine GameObject
return UnityEngine.GameObject

Parent public_oe property

public KnowledgeBase,Prolog Parent
return KnowledgeBase