Reasoning: Goal Trees and Rule-Based Expert system

Simon's Ant

“An ant, viewed as a behaving system, is quite simple. The apparent complexity of its behavior over time is largely a reflection of the complexity of the environment in which it finds itself.” — Herbert Simon (Simon’s Law)

Forward-chaining Rule-Based Expert System

fact -> conclusion

Backward-chaining Rule-Based Expert System

heuristic:

  1. specific cases
  2. different
  3. experiments

Generic Forward chaining Algorithm

1. For all rules and assertions, find all matches, i.e. Rule + Assertion combinations
2. Check if any of the matches are defunct
    A defunct match is one where the consequents from the match are already in the DB.
3. Fire the first non-defunct match.
4. Repeat until no more matches fire. 

Generic Backchaining Algorithms

function rule_match_goal_tree(hypothesis, rules, DB):
    1. check hypothesis against DB exit if satisfied.
    2. find all matching rules:  any rule with a consequent that matches hypothesis
    3. for each rule in matching rules:
        i) binding <- unify rule.consequent and hypothesis
        ii) subtree <- antecedents_goal tree(rule, rules, binding, DB)
        iii) Optimization: If subtree evaluation returns true, 
            we can short-circuit because we are ORing subtrees. 
    return OR(rule subtrees)

function antecedent_goal_tree(rule, rules, binding, DB):
    for each antecedent:
        1. new-hypothesis <- antecedent + binding
        2. check new-hypothesis against DB, if matched, update binding
        3. subtree <- rule_match_goal_tree(hypothesis, rules, DB)
        4. Optimization: Short circuit if the antecedent logics calls for it
             i.e. if in an AND then the first failure fails the whole branch.
             if in an OR, the first success implies the whole branch succeeds
    return {antecedent logic}(antecedent subtrees) 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值