Re: Global predicates in SWI and Sicstus Prolog
From: Christoph Quix (cqx_at_gmx.de)
Date: 08/23/04
- Previous message: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- In reply to: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- Next in thread: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"
- Reply: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"
- Reply: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 23 Aug 2004 14:09:42 +0200
Bart Demoen wrote:
>>
>> So, if I would use the same directive in a second module,
>> the predicates would be different.
>
>
> Ok. Second try. Checked it in SICStus and in SWI. Maybe not what you are
> after.
> [...]
> % file2.pl
> :- module(global,[bar/1]).
> [...]
Thanks. I have already had about the same idea. The main disadvantage
of this approach is that global:bar/1 and bar/1 are not the same
predicates anymore. We have a few places in our code where we load
rules (or facts) from a file, so it would not be enough to write
just bla(....) in that file. Or would it be enough to do the load_file('global.pl',...)
so that terms read by read/2 are actually read with the intended module qualifiers?
I have to check this.
> If I needed to convert a set of modules from MasterProlog to SWI, I
> would first adapt the program so that it did not use module user anymore
> in MasterProlog - and then move to SWI.
> I would expect that module user is your smallest problem when moving
> from MasterProlog to SWI: metapredicates require more changes, no ?
> And the $ syntax, and the module/3 predicate ...
The external language interface is a lot of work, too.
I almost solved the problem with different syntax and (nearly) all
builtin predicates, one can do this easily with search and replace.
A problem are the "hidden" meta predicates, MasterProlog did not
require an extra declaration for that, SWI and SICStus require
module_transparent or meta_predicate definitions.
> The module qualification defaulting rules in MasterProlog are quite
> different from those in SICStus, SWI (and others probably).
> [I know because I implemented the ones in MasterProlog.]
Grrr, now I know who I have to thank for all this work. ;-) (just joking)
BTW, as you are an insider of MasterProlog, do you know what happened
to the system? Is it now just laying somewhere on a backup tape
at BMC software, or does somebody have access to it (may be you)?
It was quite a hassle to get a new license key from BMC earlier this year.
Christoph
- Previous message: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- In reply to: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- Next in thread: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"
- Reply: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"
- Reply: Bart Demoen: "Re: Global predicates in SWI and Sicstus Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|