--
Jonathan "Dataweaver" Lang
Arguably, that's what none() is. And all() is the only junction that
is also a "normal" enumerated set. The any() junction is the set of
sets that would intersect with the corresponding all() set without
producing the null set. And the one() junction is the set of sets
corresponding to the enumeration of all().
But this is all based on enumerated sets. Oddly missing are any
Sets that are defined by rule. That would presumably take closures,
though I suppose one can attempt to enumerate the closures that have
to hold true and autothread through the calls to those closures...
Can Russel be far behind? :-)
Larry
Sure! How else will we implement the garbage collector?
;-)
--
Yuval Kogman <nothi...@woobling.org>
http://nothingmuch.woobling.org 0xEBD27418
...except that none() is a Junction, not a Set. As such, the same
arguments that say that any() and all() aren't suitable for use as
Sets apply to none(), don't they?
--
Jonathan "Dataweaver" Lang
You're confusing the map with the territory. We're trying to decide
*how* Junctions are like Sets, not defining them into two different
universes. I'm saying that all() is the Junction tha is most like
a Set. A none() Junction can be viewed as the specification for an
infinite set of sets that do not intersect with the corresponding all()
junction. Infinite sets are a bit hard to compute with directly.
A one() junction is the spec for a number of sets corresponding to the
values of the corresponding all() junction, each of which contains only
one element from that set. An any() Junction is all possible subsets
not counting the null set.
So junctional logic could be defined in terms of set theory, but not
in a necessarily computable way.
Larry
This is in ext/Recurrence:
use Recurrence;
# all integer numbers
$universe = Recurrence.new(
closure_next => sub { $_ + 1 },
closure_previous => sub { $_ - 1 },
:is_universe(1) );
# all even integers
$even_numbers = Recurrence.new(
closure_next => sub { 2 * int( $_ / 2 ) + 2 },
closure_previous => sub { 2 * int( ( $_ - 1 ) / 2 ) },
universe => $universe );
# all odd integers
$odd_numbers = $even_numbers.complement;
# all non-zero integers
$non_zero = Recurrence.new(
closure_next => sub ($x) { $x == -1 ?? 1 !! $x + 1 },
closure_previous => sub ($x) { $x == 1 ?? -1 !! $x - 1 },
complement_next => sub ($x) { $x < 0 ?? 0 !! Inf },
complement_previous => sub ($x) { $x > 0 ?? 0 !! -Inf },
universe => $universe );
- Flavio S. Glock
OK, then; what would be the specification for a _single_ set that
contains everything that doesn't intersect with a corresponding all()
Junction (the sort of thing that I'd use if I wanted to find the
largest subset of A that doesn't intersect with B)?
> A one() junction is the spec for a number of sets corresponding to the
> values of the corresponding all() junction, each of which contains only
> one element from that set. An any() Junction is all possible subsets
> not counting the null set.
Yeah; I got that.
--
Jonathan "Dataweaver" Lang
Can't do it. Here's a proof.
Suppose you could find a _single_ set that contains everything that
doesn't intersect some other set (the complement). Let S be the
complement of the empty set. S is not an element of the empty set, so
it must be a member of S, which is impossible.
Finding the complement of a set assuming some other set is not hard
though, simply by using the set difference operator.
Luke