The Prolog mode of the Shen MRS

23 views
Skip to first unread message

Antti Ylikoski

unread,
Jun 2, 2015, 4:44:11 PM6/2/15
to qil...@googlegroups.com
The Prolog mode of the Shen MRS would be created (roughly) as follows.
Interfacing Prolog to the MRS system would be done as below, in the
Shen MRS.  I have written the below code in Common LISP, but it really
concerns the Shen implementation of the MRS system.

First create the way to query the Shen Prolog by means the Shen MRS.
Here, meta level variables start with the letter !.  In the original
MRS, they began with the character &, but in the Common LISP
implementation, that cannot be done, since it would confuse the
compiler.

------------------------------------------------------------

(stash '(totruep (fibonacci !a) prolog-truep))

(defun prolog-truep (pred arg1)
  ;; Call the Shen Prolog (prolog? (pred Arg1) .....) facility
  )

------------------------------------------------------------

Then, create a way to assert Prolog databases from the Shen MRS:

------------------------------------------------------------

(stash '(toassert (fibonacci !formulas) prolog-assert))

(defun prolog-assert (pred args)
  ;; Call the Shen Prolog (defprolog pred ...) facility
  )

------------------------------------------------------------

After this, write the Fibonacci program with the Shen Prolog with the
above MRS interface, i. e. with the (assert (fibonacci ......))
interface.

Then we can do the following.  Ordinary variables start with $ in the
MRS and in the Shen MRS.

------------------------------------------------------------

;;; To compute the 10th Fibonacci number with the MRS-Prolog interface:

(truep '(fibonacci 10 $fibonacci-number))

------------------------------------------------------------

regards, Dr A. J. Y.
Helsinki, Finland

Reply all
Reply to author
Forward
0 new messages