calling prolog from pop-11 
Author Message
 calling prolog from pop-11

Hi

I have a large pop-11 program, with a NLP system written in prolog. I
wanted to use pop-11 as the base language, but I am having problems
intergrating the two languages. Basically what I'm after are methods for:

* Calling prolog procedures (i.e. calling foo(Arg1, Arg2). from pop-11)
* Reading prolog variables (i.e. the result of the foo(Arg1, Arg2). )
* Intergrating the two languages in a single file - how do I make pop-11
realise that I am writing prolog as well as pop-11?

If anyone has examples of how to do these things I would be very grateful.

David Reece

---------------------------------------------------
This message is intended only for the use of the person(s) ("the intended
recipient(s)") to whom it is addressed. It may contain information which
is privileged and confidential within the meaning of applicable law. If
you are not the intended recipient, please contact the sender as soon as
possible. The views and opinions expressed in this communication are the
sender's own and do not necessarily represent the views and opinions held
by the University of Birmingham.



Tue, 14 Oct 2003 02:01:43 GMT  
 calling prolog from pop-11
[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]


Quote:
> Date: Thu, 26 Apr 2001 18:01:43 +0000 (UTC)
> ..
> I have a large pop-11 program, with a NLP system written in prolog. I
> wanted to use pop-11 as the base language, but I am having problems
> intergrating the two languages. Basically what I'm after are methods for:

> * Calling prolog procedures (i.e. calling foo(Arg1, Arg2). from pop-11)
> * Reading prolog variables (i.e. the result of the foo(Arg1, Arg2). )

Read these files

    PROLOG HELP MIXED_LANGUAGES
        In Ved, if running prolog do
            ENTER help mixed_languages
        otherwise:
            ENTER prolog help mixed_languages
        which can be shortened to
            ENTER ploghelp mixed_languages
This tells you about

        (a)    prolog_newvar() -> <prologvar>
               (See PLOGHELP * TERMSINPOP)

        (b)    prolog_maketerm({<word|list|prologterm>}*, <word>, <integer>)
                                                            -> <prologterm>
               (See PLOGHELP * TERMSINPOP)

        (c)    prolog_deref(<prologvar:V>) -> <term>
               (See PLOGHELP * TERMSINPOP)

        (d)    prolog_full_deref(<prologvar:V>) -> <term:T>
               (See PLOGHELP * PROLOG_DEREF)

        (e)    prolog_invoke(<prolog_term>) -> <boolean>
               (See PLOGHELP * PROLOG_INVOKE)

    The file includes some examples.

See also
    HELP PLOGINPOP
    PLOGHELP PLOGTOPOP

Quote:
> * Intergrating the two languages in a single file - how do I make pop-11
> realise that I am writing prolog as well as pop-11?

The most complex example of this that I know of is the Prolog
Tracer/Tutor written by Chris Mellish. See

    $usepop/pop/plog/lib/tracer.pl

It illustrates the use of these two constructs to switch between
prolog and pop-11 in the same file:

:- prolog_language("pop11").
        Switch from Prolog to Pop-11

:- prolog_language("prolog").
        Switch from Pop-11 to Prolog.

Quote:
> If anyone has examples of how to do these things I would be very grateful.

The above should be enough to get you going.

There is more information in online documentation.

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK

PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html



Tue, 14 Oct 2003 07:52:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A POP-11 Book Available via FTP

2. Pop-11 Procedures for encoding and decoding BASE64 files (mimencode)

3. Development of Pop-11 for Windows

4. GSL interface: another Pop-11 development task?

5. vectors in pop-11

6. Running Pop-11

7. forwarding message from Steve Leach re Running Pop-11

8. Pop-11 XML tools by Steve Leach

9. Email list for discussion of poplog/pop-11 developments

10. Regular expression string pattern matching: Embedding pop-11 procedures, and more

11. popsh-0.1 : For Scripting in Poplog and Pop-11

12. looking for file processing programs written in Pop-11

 

 
Powered by phpBB® Forum Software