Artificial Intelligence
Artificial Intelligence
Information

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


      Adds a premise with an object of the class Fact, the predicate, and the value of this premise.


Namespace : ielib
Assembly : ielib.dll

public int AddPremise(Fact f, KnowledgePredicate.Predicates ePredicate, Object aValue)

Parameters

Type : ielib.Fact

f : represents an instance of the class 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(f, KnowledgePredicate.Predicate.Equal, null);


See also overloads methods:

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

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