> Date: Thu, 31 Oct 2002 15:16:17 -0800 (PST)
> From: Austin Hastings <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
> 
> 
> --- Luke Palmer <[EMAIL PROTECTED]> wrote:
> > > --- Damian Conway <[EMAIL PROTECTED]> wrote:
> > > > Austin Hastings wrote:
> > > > > traits = any ( ... )
> > > > > requirements = .. & ..
> > > > > if $requirements eq $traits
> > > > > 
> > > > > Should that be traits = all()?
> > > > 
> > > > No. Because later we say (effectively):
> > > > 
> > > >         print "True love\n"
> > > >             if all(@desiderata) eq any(@traits)
> > > > 
> > > > In other words we want *all* the desired characteristics to be
> > > > matched
> > > > by *some* trait. If the comparison was C<all(...) eq all(...)>,
> > then
> > > > you're asking for every characteristic to be the same as every
> > trait,
> > > > which obviously can't happen.
> > > > 
> > > > This is just a case where the "logic" of English phraseology has
> > > > several implicit assumptions that computational logic can't just
> > > > fudge over.
> > > 
> > > Does this imply some sort of "depth matching" is required for these
> > > expressions?
> > > 
> > > In this case, there's 
> > > 
> > > T = tall & dark & handsome
> > > D = (tall & dark & handsome) | (Australian) | (rich & old)
> > > 
> > > So when I say:
> > > 
> > > all(@desiderata)       # I hated that ^[!]() poem
> > > 
> > > does that implicitly "search down" until it finds a singleton
> > > (Australian) or a conjunction (old & rich)?
> > > 
> > > And likewise does saying 
> > > 
> > > any(@traits)
> > > 
> > > do some sort of implicit (de) construction looking for a singleton
> > or a
> > > disjunction?
> > > 
> > > Obviously, yes.
> > > 
> > > So you're saying that the all() can't work at the a|b|c level,
> > because
> > > that would be conjunctive disjunction.  (Doc, tell me straight: how
> > > long do I have?) So the evaluation alternates through the
> > > possibilities, looking for a chance to apply "all".
> > 
> > I think you've got it mixed up: all() and any() don't work with junk,
> > they _are_ junk.
> > 
> > any($a) is just $a
> > all($a) is just $a
> > 
> > It doesn't do matching, not unless it collapses right there.  So the
> > only time it does matching is when it collapses, which has nothing to
> > do with whether all() or any() are present.  It has to do with
> > whether
> > a value is a junction.
> > 
> >     all(1, 2, 3) === 1 & 2 & 3
> >     any(1 & 2 & 3) is still just 1 & 2 & 3
> > 
> > It matches:
> > 
> >     all(1, 2, 3) < $x
> >     1 & 2 & 3    < $x
> > 
> > because the junction is forced to collapse there.  Understand?
> 
> Maybe I just think differently.  When I'm trying to actually DO the
> comparison, I'm forcing at least a partial collapse, no?
> 
> I mean, maybe the traits are 
> 
> tall & dark & old & handsome & Australian
> 
> so the three choices collapse to two, either of which would match.
> 
> But regardless, when the actual == appears in the code, some
> determination needs to be made in order to figure out which way to go.
> 
> So I'm trying to build rules in my brain for how these things are
> "compatible-ized?"
> 
> And I'm trying to figure out when to specify which junction.

sub hyperless ($left, $right) {
    given {.isa Disjunction} {
        when $left {
            ? grep { hyperless $_, $right } states($left)
        when $right {
            ? grep { hyperless $left, $_ } states($right)
        otherwise {
            ! grep -> $a { grep -> $b { $b < $a } states($right) }
                states ($left); }  
    }
}

Assuming states() on a nonjunction just returns its argument.  This
code just gives true or false, not the junction of matching states
like it should.

I think what I have there is right, though I can't be sure.

Luke

Reply via email to