[m-rev.] State variable syntax transformation

Simon Taylor stayl at cs.mu.OZ.AU
Sun Feb 17 00:46:05 AEDT 2002


On 16-Feb-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Simon Taylor, Thursday, 14 February 2002:
> > On 12-Feb-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > On 07-Feb-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > > +xform_compound(S,
> > > > +        functor(atom(","), [P0, Q0], C),
> > > > +        functor(atom(","), [P,  Q ], C),
> > > > +        VS0, VS
> > > > +) :-
> > > 
> > > prog_io_state_vars should be called after the goal has been parsed by
> > > prog_io_goal. This will avoid problems if new syntax is added.
> > > For example, you haven't handled parallel conjunctions (&).
> > 
> > I've given this some more thought. This problem and the problems
> > with lambda expressions mentioned in other messages are caused by
> > trying to perform the transformation on a parse tree that isn't
> > parsed enough. prog_data__goal isn't parsed enough either (lambda
> > expressions aren't parsed until make_hlds). You may want to consider
> > doing the state variable transformation as part of make_hlds__transform.
> 
> There may be a problem in making the transformation during
> make_hlds__transform, namely that the transformation needs to see terms
> of the form
> 
> 	p(X, Y, Z, !.IO, !:IO)
> 
> not the sequence 
> 
> 	Tmp1 = !.IO,
> 	Tmp2 = !:IO,
> 	p(X, Y, Z, Tmp1, Tmp2)
> 
> since the important ordering-between-goals property is lost.

The idea was that the state variables would be replaced by ordinary
variables in unravel_unification (which is the predicate which does
the flattening you mention above). State variable pairs (!IO) would be 
expanded in {insert,append}_arg_unifications.

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list