.po 1i
.ll 6.5i
.nr ps 11
.nr pp 11
.ce 10
\fB\s16Homework 5: Explanation-Based Learning with EGGS\fP\s0
.sp
.sz 14
CS 395T: Machine Learning
.sp .5
Due: Tuesday, April 17
.sp
.ce 0
.pp
A simple version of the EGGS explanation-based generalization algorithm is in
the file EGGS.  It uses the PROLOG-like DEDUCE system to construct proofs
using backward chaining and then generalizes these proofs into operational
macro-rules to be used in future deductions.  For the most part you may treat
the DEDUCE system as a
.q "black box."
However, understanding EGGS requires that you read the comments at the
beginning of the file and look at the section of the code which deals with
unification.  The simple CUP, SAFE-TO-STACK, SUICIDE and natural deduction
examples presented in class are in the files CUP-DOMAIN, TOY-DOMAIN and
MA-DOMAIN, and can be used to test the system.
.uh "Part 1: Pruning Sub-Proofs of Operational Predicates"
.pp
First complete the definition of the function PRUNE-OPERATIONAL in EGGS. Prior
to generalization, this function should remove from the proof structure
sub-proofs which conclude facts which are already known to be operational.
Operationality is simply defined by a list of operational predicates. Test the
system by running the CUP example with GRASPABLE and OPEN-VESSEL defined as
operational.  In this case, the learned rule should include these more general
predicates in its antecedents. Hand in your commented code and a dribble file
produced when testing it on the CUP example.
.uh "Part 2: Speedup and Conjunct Reordering"
.pp
The file FAMILY-DOMAIN contains a set of rules for inferring family
relationships (SISTER, AUNT, COUSIN, etc.) and a set of facts describing a
particular family (using the operational predicates MARRIED, PARENT, MALE, and
FEMALE).  First, run all of the sample queries in the list QUESTIONS using
RUN-EGGS with learning turned off (*learn*=NIL) and note the total run time. Be
sure to supply a reasonable rule depth-bound to the prover which allows it to
correctly retrieve all of the facts but keeps it under control (5 worked well
for me). Next, turn learning on and use RUN-EGGS again and note the run time.
This allows rules learned from queries earlier in the list to be used to answer
later queries.  Finally, use RUN-EGGS a third time so that the learned rules
can be used to help answer all of the queries.  Again note the run time.
.pp
When I performed these tests I got some speedup from learning but it was not
real impressive (16.7s no learning, 14.3s while learning, 11.5s after
learning).  One thing I noticed was that the conjuncts in the learned rules
where often inefficiently ordered when interpreted using left-to-right,
depth-first, backward chaining (as in DEDUCE and PROLOG). Determine a method
for reordering the conjuncts in the learned rules so that in general they are
more efficient when interpreted in this manner.  Implement this method by
altering the function GENERAL-RULE and redo the three test runs.  Remember to
first unlearn previously learned rules by reloading your rules using
INDEX-BRULES.  Make sure your fix is a domain independent one and is not
specific to the domain of family relationships. With my fix I got a reasonable
increase in efficiency (12.6s while learning, 8.3s after learning).  Hand in a
commented copy of your code, a dribble of the tests, and a table reporting your
results.
.pp
Finally, write a paragraph or two explaining your results.  Look for instances
of speedup and slowdown on particular deductions. Discuss why this domain is
or is not a good one in which to learn macro-rules. 


