.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: Thursday, April 7
.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: Defining a Domain Theory and Conjunct Reordering"
.pp
The file FAMILY-DOMAIN contains a specific set of facts describing a set of
family relationships using the operational predicates MARRIED, PARENT, MALE,
and FEMALE. Define a set of rules which allow EGGS to infer instances of more
complex family relationships (e.g. UNCLE, SISTER-IN-LAW, etc.) and thereby
allow it to deduce the set of queries given in the file. First run all of the
sample queries 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 my rule-set). 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 in 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
very impressive (44.6s no learning, 41.8s while learning (remember this
includes the time spent learning), 30.72s 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 (45.58s
no learning, 40.92s while learning, 23.78 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. 


