tags: classical ai

Knowledge is a theoretical or a practical understanding of a domain, it is also the sum of what is currently known.

Most experts express their rules in a form of if-then rules. Expert systems aims to make decisions from if-then rules that are based on knowledge in a certain domain. Expert systems are typically very specialized.

It is said expert systems are based on abduction which makes it uncertain.

Rules

The if part of the rule can be called an antecedent (premise, evidence or condition) and the then part is called consequent (conclusion, hypothesis or action).

Relations are like facts, heuristic may not be true (the conclusion i concluded may not be true).

Knowledge is set of if-then rules an the expert writes them in the knowledge base. The database has facts and it is filled with session related data. The knowledge base and database are domain specific. The inference engine, explanation facility and user interface can be written alone and they are named the system shell - I don’t know if the knowledge base itself is decoupled from the software or like the knowledge is the only thing that is decoupled - so we don’t have to rewrite them every time.

The explanation explains and can say how and why a decision was taken. The above image supports my argument that only the knowledge is decoupled.

Characteristic of expert systems

The heuristic are deduced from the experiences of the expert. Expert systems can make mistakes like humans, but still should be trusted just as experts.

Inference

When a rule is fired it gets added to the database.

Inference engine does reasoning either by:

  1. Forward chaining
  2. Backward chaining

Forward chaining

Iterating over the knowledge base and one a rule is found that can be fired, it is fired and the result is added to the database. Notice the iterations, if a rule was fired but couldn’t be satisfied then it can be only fired again in next cycle or iteration.

Forward chaining sometimes is not really efficient, because some times two rules can give me the same conclusion , so there is no need really to fire both of them. That’s why backward chaining is used.

Backward chaining

Backward chain problems are solved using a stack, every time we find a rule we push a single sub goal to the stack and try to satisfy it. For example:

\begin{eqnarray} If (C1 \& C2) \rightarrow C4 \\ If (C5) \rightarrow C1 \end{eqnarray}

My goal is C4, I’ll start by pushing C1 and then looking for the rule and pushing C5, and when I come back I push C2. It is explain in the end of the section.

Combining forward and backward

Some times I cant use backward if i have many goals, maybe due to stack conflict, I am not yet sure.

Conflict resolution

Some times some If-Then rules have the same conditional but a different conclusion, that leads to conflicting rules, we will have to come up with a way to solve conflicts.

1. Choosing the rule with the highest priority

if the two if parts are satisfies, we choose the first rule because it has the highest priority.

2. The most specific rule

We choose the rule that is more specific in its condition, for example: If we have that the season is autumn, the sky is cloudy and the forecast is rain, then we fire rule 1 because it is the more specific one, if we only have the season is autumn we fire 2.

3. Use the most recent data

This part I am not yet sure about but we only fire the rule with the last data added to the database. I don’t understand yet If I have to rules like how choosing the latest data will resolve this but left TODO

Certainty factor

Sometimes we are not really certain or don’t have a complete truth value for a value, so we use a certainty factor, and the same logic rules are applied as in ^d7d38c, the only exception is the NOT operation is a negation operation. The output is the cf of the input multiplied by the cf of the output. The rules above are used when we have two rules that bot fire the same conclusion but with different certainty factor, the effect of this is that I either become more or less certain about a conclusion and the total value can be calculated from the above rules.

Advanced of expert system

Disadvantage of expert systems