Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

E6: Small Junctions

7 views
Skip to first unread message

Dave Whipp

unread,
Aug 1, 2003, 12:54:57 PM8/1/03
to perl6-l...@perl.org
In E6, Damian write: "A junction is a single scalar value that can act like
two or more values at once".

Whenever I see a statement like this, I tend ask myself "What happenned to
zero and one?". Perhaps its intentional; perhaps its sloppy writing. What
issues arise with junctions of 0 or 1 members?

A junction on one element is almost always redundant, and can be cast
directly into the scalar that is its eigenstate. The only issue with doing
that is that certain junction methods might not be available. However, in
the case of a C<none>, an abjunction of one member is meaningful.

Junctions of zero elements are interesting in another way. Consider:

if $a > any(@values) {...}

If there are no @values, is the condition true or false? I think intuition
says its false (because there is no value of @values for which it is true)

if $a <= all(@values) {...}

I find this one slightly harder to intuit. It appears to be a direct flip of
the previous case (there are no members of @values that are greater than @a;
so all must be less than or equal to a). But there are no members of
@values, so its never true, either. Perhaps the result is none(true,false)
which, given that we don't have true/false keywords, becomes: none(
none(0,"",undef), any(0,"",undef) ), which I think simplifies to
"none(none())".

So is a junctions of zero and one elements valid? Abjunctions don't seem to
have any problems with the concept.


Dave.


Mark J. Reed

unread,
Aug 1, 2003, 1:00:03 PM8/1/03
to perl6-l...@perl.org
On 2003-08-01 at 09:54:57, Dave Whipp wrote:
> A junction on one element is almost always redundant, and can be cast
> directly into the scalar that is its eigenstate. The only issue with doing
> that is that certain junction methods might not be available. However, in
> the case of a C<none>, an abjunction of one member is meaningful.

Quick, dumb question: what is an "abjunction"? How does it differ
from a junction?

-Mark

Dave Whipp

unread,
Aug 1, 2003, 1:09:26 PM8/1/03
to perl6-l...@perl.org
"Mark J. Reed" <mark...@turner.com>

> Quick, dumb question: what is an "abjunction"? How does it differ
> from a junction?

An abjuction requires that none of its members match. For example,
($a == none(1,2,3)) is true for any value of $a except 1, 2 or 3.

Dave.


Luke Palmer

unread,
Aug 1, 2003, 1:14:15 PM8/1/03
to da...@whipp.name, perl6-l...@perl.org
> In E6, Damian write: "A junction is a single scalar value that can act like
> two or more values at once".
>
> Whenever I see a statement like this, I tend ask myself "What happenned to
> zero and one?". Perhaps its intentional; perhaps its sloppy writing. What
> issues arise with junctions of 0 or 1 members?

[snip]



> So is a junctions of zero and one elements valid? Abjunctions don't seem to
> have any problems with the concept.

See Damian's reply to "Perl 6 and Set Theory" for all the formal
logical operations.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=3DF2FE76.6050602%40conway.org&rnum=2

I'll explain here by example:

if $something > any() { "Never executed" }
if $something > all() { "Always executed" }
if $something > one() { "Never executed" }
if $something > none() { "Always executed" }

That has to do with whether the selector is universal or existential.
Basically, for any() and one(), there don't exist any elements to make
the hypothesis true. For all() and none(), there don't exist any
elements to refute the hypothesis.

For each one of these except none(), a junction of one element is
exactly equivalent to that single element itself (plus the junctive
operations).

Luke


>
> Dave.

Luke Palmer

unread,
Aug 1, 2003, 1:20:22 PM8/1/03
to da...@whipp.name, perl6-l...@perl.org

Actually, no :-)

disjunction: any()
conjunction: all()
abjunction: one()
injunction: none()

So an abjunction is a junction requiring that exactly one of its
elements match. I don't see much use for it, but I haven't worked
with Perl 6 junctions in practice yet. It'll probably come in handy
about as often as logical xor does.

Luke

> Dave.

0 new messages