[mercury-users] Indexing & operational semantics

Thomas Conway conway at cs.mu.OZ.AU
Tue Feb 1 13:16:38 AEDT 2000


On Tue, Feb 01, 2000 at 12:28:50PM EST, Peter Schachte wrote:
> Keeping conjunction commutative seems very desirable (let's not get
> into EDCG issues here ;-), and the if-then-else form is rather bulky
> and ugly, so it's really a shame to have to make this choice.  Maybe
> it's time to put in an "and then" (sequential conjunction) operator?
> Didn't Tom have one in his work on concurrency?  In any case, it seems
> like a generally useful construct.  I expect Ralph would rather write
> something like
> 
> 	translate(functor(Name, Args, Ctxt), Out) :-
> 		Name = atom("/\") &&
> 		require(list__length(Args) = 2, "/\ must have two args"),
> 		Out = f(Args).

No, I only had "A & B" for parallel conjunction. I guess parallel
implies commutativity, though at present, A and B have to be independent.
I agree that it would be nice in some cases to have a sequential conjunction,
especially as it implies a "nice" translation of if-then-else:
	(if A then B else C)
<=>
	(A && B ; not A && C)

It has always seemed unfortunate to me that we can't reorder stuff between
the `cond' and `then' parts of an if then else, even if only for optimization.

Thomas
-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list