Subject: Re: [SWIPL] A help with the use of the module predicate.

From: Tom Breton <[email-masked]>
Date: 21 May 2001 19:18:11 -0400

"Sergio R. P. da Silva" <[email-masked]> writes:

> Hi all,
> 
> I'm trying to run the programs that come with the book "Representation and
> Inference for Natural Language" from Patrick Blackburn and Johan Bos
> (http://www.comsem.org/
> But I can't make it work since the operators defined in the module described
> below are not exported for the mainLambda.pl module.
> If I insert the code directly in the mainLambda file everything works fine,
> ie., the operators get exported to the other module as it needs to be.
> 
> Can anybody ell me if this is a problem with the code or with the module
> system behavior?

You're in luck.  I got that working some time ago.  I had to make 3
changes, but IIRC that wasn't one of them.

You need to define a rule Quintus has that SWI doesn't:

        simple(X) :- (atom(X) | number(X) | var(X) ), !.

For some reason EnglishLexicon needed to be a module, so I added:

%Tom
:- module(englishLexicon,[lexicon/4]).

And then I had to change a `consult' to a `use_module' in both curt.pl
and mainLambda.pl, as follows:

%Tom
:- use_module(englishLexicon, [lexicon/4]).

%:- [englishGrammar], [englishLexicon], [semMacrosPresupDRT].
:- [englishGrammar], [semMacrosPresupDRT].

Then it worked.  I had no trouble with comsemOperators, which appears
unchanged.

> Thank you very much in advance.

You're welcome very much in advance.  I got this working very much in
advance.  }:)

On a side-note, you have chosen well.  Blackburn and Bos is a very
fine tutorial on natural language understanding.

-- 
Tom Breton, http://world.std.com/~tob