[m-dev.] representation of higher-order insts

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 17 13:19:12 AEDT 2000


On 17-Feb-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> Currently the compiler records that the inst of
> 
>     X = plus1
> 
> as ground(unique, yes(pred_const_info(...))), so we no longer know the
> more specific information that X is bound to plus1

Actually it's `pred_inst_info', not `pred_const_info', but otherwise yes.

> I would like to change the representation to
> 
>     bound(unique, [functor(pred_const(ConsId, CurriedInsts))]),
>     ConsId = pred_const(PredId, ProcId, LambdaEvalMethod),
>     LambdaEvalMethod = normal,
>     CurriedInsts = []
> 
> Does anyone see anything wrong with this representation?

I think that would be OK.

There may be a few complications:

	- we need to be able to get the pred_inst_info from the
	  inst; since your inst only contains the pred_id and proc_id,
	  that means you also need the pred_table to get that
	  information.  So you may need to pass the module_info
	  or the pred_table to a few places that otherwise wouldn't need it.

	- the code in inst_match.m and inst_util.m would of course need
	  to be modified to handle the new representation, and the resulting
	  code would be a bit more complicated.

But most likely those won't cause any major problems.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list