Skip to content

Commit

Permalink
backchain.
Browse files Browse the repository at this point in the history
  • Loading branch information
John committed Sep 20, 2012
1 parent 22088af commit 8da4e61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Binary file added 6.034-labs/lab1/.zookeeper.py.swp
Binary file not shown.
10 changes: 8 additions & 2 deletions 6.034-labs/lab1/backchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@


def backchain_to_goal_tree(rules, hypothesis):
raise NotImplementedError
matcihypothesis
for rule in rules:
consequent = rule.consequent
populate(consequent,
print consequent
if match(consequent, hypothesis):
return consequent

# Here's an example of running the backward chainer - uncomment
# it to see it work:
#print backchain_to_goal_tree(ZOOKEEPER_RULES, 'opus is a penguin')
print backchain_to_goal_tree(ZOOKEEPER_RULES, 'opus is a penguin')

0 comments on commit 8da4e61

Please sign in to comment.