Artificial Intelligence
Artificial Intelligence
Information

Rule.AddPremise(string, KnowledgePredicate.Predicates, Object) method


      Adds a premise by specifying the name of a fact, the predicate and the value of this premise.


Namespace : ielib
Assembly : ielib.dll

public int AddPremise(string aFactName, KnowledgePredicate.Predicates ePredicate, Object aValue)

Parameters

Type : System.string

aFactName: a string that represents the name of a fact.

Type : ielib.KnowledgePredicate.Predicates

ePredicate: Represents the value of the KnowledgePredicate.Predicates property.

Type : System.Object

aValue: the object represents the value of a premise (see also the Premise.Value property).

Return value

Type : System.Int32

Index to which the premise was added, otherwise a negative value.


Exception: Syntax error in the construction of the object Premise.

Example

KnowledgeBase Kb = new KnowledgeBase();
Fact f = new Fact("many monuments", Fact.DataType.Bool, null);
Rule r = new ielib.Rule();

Kb.Add( f ); // Added object is in the knowledge base to obtain the ID of this fact
Kb.Add( r ); // Then, adding the rule object in the knowledge base
r.AddPremise("many monuments", KnowledgePredicate.Predicate.Equal, null);


See also overloads methods:

Rule.AddPremise(int, KnowledgePredicate.Predicates, Object).

Rule.AddPremise(Fact, KnowledgePredicate.Predicates, Object).