From: Jakkan
Subject: Re: Help (somewhat long)
Date: 
Message-ID: <ftyH3.2845$56.73107@typhoon.nyroc.rr.com>
If it helps at all, much of the code, including the specific functions you
spoke of came from the book, so I am fairly confident that that stuff works.
The parts I had to implement were the defrule sections.  It seems that the
sections beginning with (defrule '(simplify...  work, as I have managed to
find a way to test them.  However, The pattern-matching code beginning with
(defrule '(complex-arithmetic... is what seems to not be working, at least
with the test cases at the bottom.

Thanks in advance for any other help.

Todd
Frank A. Adrian <·······@uswest.net> wrote in message
·························@news.uswest.net...
>
> Jakkan <·······@twcny.rr.com> wrote in message
> ························@typhoon.nyroc.rr.com...
> > The following is my attempt to develope a rule-based system for
evaluating
> > expressions using complex numbers.  It is based on and must use the
> > methodology of LEIBNIZ from Tanimoto's book "The Elements of Artificial
> > Intelligence Using Common Lisp."  I can't seem to get it to work.  Any
> help
> > would be appreciated.
> >
> > [Lots of code snipped.]
>
> And in what way is it "not working"?  My contribution for you is to
suggest
> that you focus on and describe the program's failure modes for us so that
we
> may better target our help.  The second contribution is to suggest that
you
> learn to use your system's debugger.  It will help you immensely with your
> homework problems.
>
> Now, more seriously, thank you for posting your code.  This is a step that
> many students neglect to do, simply asking the people on the newsgroup to
do
> their homework for them.  It is obvious that you've written a lot of code.
> In fact, you've written so much stuff that it is hard to find errors in it
> simply because the errors become drowned in the bulk.  I really don't want
> to try to debug this thing.  But here are some suggestions that may help.
>
> The functions handle-?-with-consistency-check and handle-* appear to be
> ill-factored and too long.  They look like lurking places for errors.  Try
> to break them up into functions that handle the sub-cases with appropriate
> names.
>
> Use the meanings of return slots as function names (e.g., rather than
> scatter your code with (first x) and (second x) when referring to the
> function results, define a function or macro called bindings or matches,
> resp.) - in fact, use multiple value return rather than consing the
binding
> list to the result and using it as the return value.
>
> Make these changes and you'll probably be able to spot the error by simple
> inspection.
>
>
From: Frank A. Adrian
Subject: Re: Help (somewhat long)
Date: 
Message-ID: <htDH3.4576$Pv.221189@news.uswest.net>
OK.  Next step in debugging - isolate.  Comment out all of the
simplification crud and just add the single subtraction rule to the rule
base.  See if it works, using your first test case.  If it does then you've
isolated the problem to the simplification code.  If not, you have to check
if it's a problem in the control driver or the rule pattern matching.  I'd
suggest single-stepping the code (or turning on tracing for your recursive
match function) to figure out what's happening there.

faa

Jakkan <·······@twcny.rr.com> wrote in message
························@typhoon.nyroc.rr.com...
> If it helps at all, much of the code, including the specific functions you
> spoke of came from the book, so I am fairly confident that that stuff
works.
> The parts I had to implement were the defrule sections.  It seems that the
> sections beginning with (defrule '(simplify...  work, as I have managed to
> find a way to test them.  However, The pattern-matching code beginning
with
> (defrule '(complex-arithmetic... is what seems to not be working, at least
> with the test cases at the bottom.
>
> Thanks in advance for any other help.
>
> Todd
> Frank A. Adrian <·······@uswest.net> wrote in message
> ·························@news.uswest.net...
> >
> > Jakkan <·······@twcny.rr.com> wrote in message
> > ························@typhoon.nyroc.rr.com...
> > > The following is my attempt to develope a rule-based system for
> evaluating
> > > expressions using complex numbers.  It is based on and must use the
> > > methodology of LEIBNIZ from Tanimoto's book "The Elements of
Artificial
> > > Intelligence Using Common Lisp."  I can't seem to get it to work.  Any
> > help
> > > would be appreciated.
> > >
> > > [Lots of code snipped.]
> >
> > And in what way is it "not working"?  My contribution for you is to
> suggest
> > that you focus on and describe the program's failure modes for us so
that
> we
> > may better target our help.  The second contribution is to suggest that
> you
> > learn to use your system's debugger.  It will help you immensely with
your
> > homework problems.
> >
> > Now, more seriously, thank you for posting your code.  This is a step
that
> > many students neglect to do, simply asking the people on the newsgroup
to
> do
> > their homework for them.  It is obvious that you've written a lot of
code.
> > In fact, you've written so much stuff that it is hard to find errors in
it
> > simply because the errors become drowned in the bulk.  I really don't
want
> > to try to debug this thing.  But here are some suggestions that may
help.
> >
> > The functions handle-?-with-consistency-check and handle-* appear to be
> > ill-factored and too long.  They look like lurking places for errors.
Try
> > to break them up into functions that handle the sub-cases with
appropriate
> > names.
> >
> > Use the meanings of return slots as function names (e.g., rather than
> > scatter your code with (first x) and (second x) when referring to the
> > function results, define a function or macro called bindings or matches,
> > resp.) - in fact, use multiple value return rather than consing the
> binding
> > list to the result and using it as the return value.
> >
> > Make these changes and you'll probably be able to spot the error by
simple
> > inspection.
> >
> >
>
>