Re: Global predicates in SWI and Sicstus Prolog

From: Christoph Quix (cqx_at_gmx.de)
Date: 08/23/04

  • Next message: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"
    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


  • Next message: Jan Wielemaker: "Re: Global predicates in SWI and Sicstus Prolog"

    Relevant Pages

    • Re: Global predicates in SWI and Sicstus Prolog
      ... Checked it in SICStus and in SWI. ... You would have to put all global predicates in such a global module. ... The module qualification defaulting rules in MasterProlog are quite ...
      (comp.lang.prolog)
    • Re: Correct Error Handling Idiom
      ... predicates that expand the terms found in an input file. ... I'm using SWI if that matters. ... SWI can live with an unbound second argument of the error ... ISO error, you can invent your own term. ...
      (comp.lang.prolog)
    • Re: (SWI Prolog) numbervars option
      ... Przemyslaw Madzik wrote: ... > predicates like numbervars/3)? ... Which version of SWI do you have? ...
      (comp.lang.prolog)