logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Solutions and Discussion for Perl Quiz of the Week #18 (Expert Edition): msg#00042

Subject: Re: Solutions and Discussion for Perl Quiz of the Week #18 (Expert Edition)
Mark Dominus:
> My first cut at the program didn't make contraposition inferences, but
> I found a behavior that I interpreted as a bug, and contraposition was
> necessary to fix it.  Pr. Sanderson's example program demonstrates
> this same behavior:
> 
>         > All dogs are mammals
>         OK.
>         > No octopuses are mammals
>         OK.
>         > Are any octopuses dogs?
>         I don't know.

I find that none of the other submitted solutions (except mine) comes
up with "no" here; they all say "I don't know".  (Except perhaps Randy
Sims', which I couldn't get to work.)  This makes me worry that I've
committed a basic logic error somewhere, which is something that
hapened more than once while I was developing the program.

I would be interested to see the results of testing the five solution
programs.  I could contribute some tests.   For example, here's a
simple test that an earlier version of my program failed:

        All cats are mammals.
        Are any cats not mammals?  # No


Here's one that the program got right but that *I* failed:

        Some octopuses are orange.
        Some cats are orange.
        No octopuses are cats.
        All cats are mammals.
        Are any orange things not mammals?  # I don't know

(I initially thought that the answer should be "yes", since orange
octopuses are not mammals.  But one cannot conclude that from the
information given; orange octopuses might all be (nonfeline) mammals.)




<Prev in Thread] Current Thread [Next in Thread>