develooper Front page | perl.perl6.language | Postings from March 2009

Re: Junction Algebra

Thread Previous | Thread Next
From:
Martin Kealey
Date:
March 30, 2009 21:21
Subject:
Re: Junction Algebra
Message ID:
alpine.DEB.1.10.0903311643190.24280@feathers.sig.net.nz
On Mon, 30 Mar 2009, Mark J. Reed wrote:
> >        ( $a <= any(-1,+1) <= $b ) == ( $a <= any(-1,+1) && any(-1,+1) <= $b )
>
> Clearly, the RHS is true for $a == $b == 0, but I'm not sure the LHS
> shouldn't also be.  Isn't it just syntactic sugar for the RHS?

I suspect not. Rather I think that

	$a <= any(-1,+1) <= $b

corresponds to

	$tmp = any(-1,+1);
	$a <= $tmp <= $b

and thence to

	$tmp = any(-1,+1);
	$a <= $tmp && $tmp <= $b

The more I think about this, the more I come to the conclusion that a
junction should appear to have a uniform (single) value in each
"eigenthread".

> Logically, you might want it to mean something like ∃$x: $x == any(-1,+1)
> && $a <= $x && $x <= $b, but I don't think it does.

I think that flows fairly cleanly from the Junction-isa-Object
implementation, and the way that references are taken.

This is not going to play well with subexpression folding: junctions have to
be considered "unclean", in that two junctions must not be merged even if
they're immutable and indistinguishable (except for object identity).

	$a = any($x, $y);
	$b = any($x, $y);
	assert $a !== $b;

Earlier Moritz suggested that one could modify an external object from
within the eigenthreads to accumulate the list of eigenstates, in defiance
of having the !eigenstates() method private.

That's almost reasonable, but it assumes that eigenthreads don't work on
separate snapshot copies of the world, and that those snapshots aren't
discarded after their results are flattened by the junctive operator.

-Martin

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About