
Participants: Luis Fariņas del Cerro, Andreas Herzig

MOLOG has been developped by the Applied Logic Group at IRIT from 1985 on. It has been supported by the ESPRIT project ALPES. Based on the modal resolution method proposed by Luis Fariñas del Cerro, a first prototype of MOLOG has been written in 1985 by R. Arthaud. Subsequently P. Bieber has implemented improved C-Prolog versions in 1986 and 1988, adapted to other Prolog interpreters by J.-F. Bosc in 1992. The principles of an abstract machine have been elaborated by M. Bricard in 1987. This work has been continued by J. Garmendia Aguirre and J.-M. Alliot and has led the latter to implementations in ADA and C in 1991.
MOLOG is a general inference machine for building a large class of meta-interpreters.
It is in particular suitable for implementing extensions of
Prolog
with non-classical logics such as logics of knowledge, belief,
time, action, uncertainty, etc.
MOLOG handles Prolog clauses (with conjunctions & and implications <--) qualified by modal operators , such as
pos:it_rains (it is possible that it rains), or
knows(a):pos:it_rains (agent a knows that it is possible that it rains).
The user has the possibility to define his modal operators.
The language can be multi-modal
(i.e., contain several modal operators at the same time).
Classical resolution is extended with modal resolution rules that define the operations that can be performed on the modal operators. These rules depend on the modal logic. The MOLOG user can either use an already existing set of resolution rules, or create his own set of rules.
The MOLOG implementation that is available is a metainterpreter written in C_Prolog. The interpreter currently runs on C-Prolog, Quintus-Prolog, Sicstus-Prolog, and SWI-Prolog.
ini m_top_level m_translate m_treat m_utilities m_predefined C_Prolog,
Quintus_Sicstus, and
SWI_Prolog Quintus_not epi_fool is for modal logic S4,
file mod_c_extnp_hypclassical epi_fool fool operator
of epistemic logic)
hyp hyp_0 hyp_mn hyp_pl hyp_sans mod_c_ext mod_exp mod_fus mpli_op np_hyp np_sans pl_sans fib rha rha_mod test_sans wise_men wise_trie
MOLOG operators Prolog predefined operators
op(1200,fy,?).
op(1200,fy,@).
op(1000,xfy,,).
...
...
...
op(300,xfx,mod)
op(150,xfy,<--).
op(100,xfy,&).
op(50,xfy,':').
In C_Prolog 1.5 and DEC_10 Prolog the precedences of the
predefined operators range between 1000 (operator `,') and 300
(operator mod). The precedence of `?' and `@' must be greater than
that of `,', and the precedence of ` <--' must be less than
that of the 'mod' operator. The interpreter currently runs on C-Prolog, Quintus-Prolog, Sicstus-Prolog, and SWI-Prolog.
DB and a goal G,
the interpreter answers yes if DB implies G in that non-classical logic.
New database clauses can be asserted with @:
@p. adds p to the current database.
In the following we explain how to use MOLOG by an example, namely
the famous wise men puzzle. The puzzle and its axiomatization are
described in the wise_men file.
The epistemic logic it uses is multimodal S4 together with a
fool agent (who knows something if everybody knows it).
The corresponding inference rules are in the file epi_fool.rule.
?- [ini].
?- molog.
** Welcome on MOLOG (the C_prolog version 1.02) **
Please give the name of the rule file you want to use:
epi_fool.
epi_fool.rule reconsulted
U> ld_fact(wise_men).
wise_men.mol consulted
yes
U> tron.
yes
comi(s3,2):p3.
yes
U> stop.
**** Goodbye, MOLOG halted ****
p
can be asserted by asking the goal
``@p.''.
Compiled rule files and fact files are not provided. The Molog predicate COMPI_RULES (resp. COMPI) may be used to compile resolution rule files (resp. fact files), producing ".rule" (resp ".mol") files. COMPI_RULES must be used in Ruler mode (type "ruler" instead of the name of a rule file) or under PROLOG after loading MOLOG.
Note: SWI-Prolog doesn't accept files compiled using other Prolog interpreters.
There are two functions T and TG,
the second one being for the translation of goal clauses.
p is a predicate then
T(p) = p, and
TG(p) = p.
T(A <-- B) = (T(A) <-- TG(B))
TG(A & B) = (TG(A) & TG(B))
T(nec(X):A) = nec(X):T(A)
T(pos(X):A) = posi(X,i):T(A)
(i must be unique )
TG(nec(X):A) = posi(X,i):T(A)
TG(pos(X):A) = pos(X):A
T(pos(X):p <-- nec(X):q & pos(X):r). Andreas.Herzig@irit.fr / http://www.irit.fr/~Andreas.Herzig
= pos(X,i):p <-- posi(X,i):q & pos(X):r)