[mercury-users] how to import legacy Prolog code

Jean-Marc Vanel jeanmarc.vanel at gmail.com
Fri Jul 2 23:07:27 AEST 2010

( after reading the page

There are three problems: cuts, assert and retract, and the generation
of statements pred and mode and type.

For the generation of statements pred, mode, the idea is that since
the Mercury compiler can detect an inconsistency between the
hand-written declaration and the implementation of the body, it can as
well produce a (tentative) declaration coherent with the
implementation body.

Also, in the some Prolog code, statements similar to Mercury are
present, like in SWI Prolog libraries [1], or in Attempto. Could the
Mercury parser make use use of them? They start with %% at the first

Note that there is already a type checker library in (SWI-)Prolog:
type_check.pl [2] , by which one  can use Mercury-style type
declarations and predicate signatures.

[1] http://www.swi-prolog.org/pldoc/doc_for?object=section(2,'5',swi('/doc/packages/pldoc.html'))
[2] http://tomschrijvers.blogspot.com/2008/02/types-for-prolog.html

Jean-Marc Vanel
Consulting, services, training,
Rule-based programming, Semantic Web
EulerGUI, a turntable GUI for Semantic Web + rules, XML, UML, eCore,
Java bytecode
+33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16
( we rarely listen to voice messages, please send a mail instead )

mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list