[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A couple of questions ...




In article <13386@sophia.inria.fr>, banerjee@cis.ksu.edu (Anindya Banerjee) writes:

|> but am having difficulty with the trigger rules. 
|> 
|> The following are the judgements:
|> 
|>    judgement ();
|>    judgement  |- EXP, IDE, EXP -> EXP; [ this to stand for [E1/I]E2 ]
|> 
|> And the trigger rule is:
|> 
|>    |- exp1_tree, ide_tree, exp2_tree -> e'
|>    --------------------------------------
|>    (); 
|>      provided 
|>          gettree("exp1_typol_object", subject, exp1_tree)&
|>          gettree("ide_typol_object", subject, ide_tree)&
|>          gettree("exp2_typol_object", subject, exp2_tree);
|>      do
|>          write(e');
|> 
|> What exactly is the problem with the above trigger rule? 


In gettree(Name, Subject, Tree), the second argument may be either 
anonymous, or subject when the coerced tree is meant to be the subject
of a rule. As there is only one subject in a rule, they must be only
one gettree with subject as second argument. (subject is instantiated with
a pointer to the typol-object, and the 3 arguments are located in
different typol-objects)

So your trigger rule must be

    |- exp1_tree, ide_tree, exp2_tree -> e'
    --------------------------------------
    (); 
      provided 
          gettree("exp1_typol_object", subject, exp1_tree)&
          gettree("ide_typol_object", _, ide_tree)&
          gettree("exp2_typol_object", _, exp2_tree);
      do
          write(e');

A better idea is to use "export":

export |- exp1_tree, ide_tree, exp2_tree 
		as subst(exp1_tree, ide_tree, exp2_tree) = e';

This will build a Lisp function 
(de #:subst:subst (exp1_tree, ide_tree, exp2_tree)
   ...)
that makes the interface between Lisp and Prolog.

But I am afraid that your are using an old version of Centaur (or of
the documentation).


|> What needs to be done when the following error message occurs?
|> 
|> "Erreur fatale - zone des listes pleine"

This means that the lisp "cons" area is to small, and you have to
call centaur with a bigger one. 
centaur N
will give you a centaur with N*8k-cons (N*64k-byte).
The default is 20.

Thierry.

--
Send contributions to centaur@sophia.inria.fr. Registration and
administrative matters should be sent to centaur-request@sophia.inria.fr.
+---------------------------------------------------------------------------+
|     Thierry Despeyroux      | email: Thierry.Despeyroux@sophia.inria.fr   |
| I.N.R.I.A. Sophia-Antipolis | phone: +33 93 65 77 07 fax: +33 93 65 77 66 |
+---------------------------------------------------------------------------+