[mercury-users] vanilla in Mercury

Randall Helzerman rahelzer at ichips.intel.com
Wed Sep 8 09:54:46 AEST 1999


I'm trying to port an application from prolog to Mercury.  It makes
extensive use of a very simple metainterpreter (vanilla):

demo([]).
demo([G|Gs]) :-
        axiom(G,Gs1),
        append(Gs1,Gs,Gs2),
        demo(Gs2).

or simple modifications thereof (abduction, goal delaying,
negation-as-failure--things like that).

Can such a simple meta-interpreter be coded in Mercury?  I looked at
the interpreter.m code which was supplied in the samples directory, and
was discouraged.  Compared with the simple version above, it seems rather
complex, and as this particular applications uses many many slightly-warped
versions of vanilla, it would be very clumsy to use the interpreter.m code
as a base.

I know what you are probably thinking now--that in Mercury, the use of
higher-order code and polymorphism lessens the need for the use of
metainterpreters.  This may be true in general, but my particular 
application is based on an inference engine which is an abductive
metainterpreter, and the availability of vanilla makes for very
concise, simple code.

Thanks for any help,
Randy
--------------------------------------------------------------------------
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