Artificial Intelligence
Artificial Intelligence
Information

KnowledgeBase.Add(Rule) method


      Adds a rule to the knowledge base.


Namespace : ielib
Assembly : ielib.dll

public bool Add(Fact f)

Parameters

Type: ielib.Rule.

r: Represents a specified Rule class object.

Return value

Type : System.Boolean.

true If the object is accepted and added in the database, otherwise false.

      Note : Cannot add a value null

Example :

KnowledgeBase kb = new KnowledgeBase(500);
Rule r = new Rule();
bool b = kb.Add(r); // The variable b is equal true

r = null;
b = kb.Add(r); // The variable b is equal false
if (!b)
MessageBox.Show("The value null is not accepted.");



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