🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2140

Re: PC Prolog Compilers

#2140
From: Chris D S Moss
Date: Mon, 23 Nov 1992 18:23
47 lines
2851 bytes
>In article <721489167.F00001@ocitor.fidonet> Carl.Lemp@f2206.n124.z1.fidonet.org (Carl Lemp) writes:
>>I have used an old version of Turbo Prolog, do its limitations ( No 
>>univ, no functor, no asserting rules, typed variables ) rally get in 
>>the way for applications like Natural Language Processing?
>
In article <1992Nov15.184348.24877@athena.cs.uga.edu> mcovingt@aisun3.ai.uga.edu (Michael Covington) writes:
>Yes, because typically, in natural language processing, you'll want to
>accept some natural language input, translate it into a Prolog query, and
>then execute that query.  The lack of a "call" procedure in Turbo makes
>this either clumsy or impossible depending on exactly how you set it up.

I'm not sure I agree with this. There's an excellent example of a nl
query system in the Turbo Toolbox (do look at it), which sidesteps this 
problem with ease.

Basically, most nl systems turn the query into an internal set of queries
which map on to the predicates into the database. There is usually a quite
small number of these, so it is easy to provide a SPECIAL PURPOSE form of
call, of the form:
	call(dept(A,B)) :- dept(A,B).
	call(manages(A,B)) :- manages(A,B).
	...

This has two advantages over the lazy Prolog programmer's approach of
simply writing call and letting the implementation do the work.

1. It runs much quicker: a (compiled) procedure call is MUCH faster than
a metacall.
2. It's more robust. If you produce a rubbishy node in your tree it
fails cleanly (or you can trap it cleanly) rather than having a totally
undefined effect.

You CAN do functor and univ the same way, but it's clearly more tedious,
though I'm not clear that they are crucial in nl applications. As for
types, well, it's harder to input them, but there is some payback in
correcting errors as well as the efficiency gain, though most people
don't like them for that sort of programming as they limit many of the
general purpose predicates one can write. 

However, PDC has said it will bring out an environment compatible 
with the ISO standard, which doesn't
have types, so maybe you can wait for that.

One other thing: Turbo (PDC) doesn't have a grammar rule translator, or
didn't last time I looked. Though it's not essential it does save effort.

Chris Moss
Technical Details
Message-ID: <1er7j7INNon3@swan.doc.ic.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!doc.ic.ac.uk!doc.ic.ac.uk!not-for-mail
References: <721489167.F00001@ocitor.fidonet> <1992Nov15.184348.24877@athena.cs.uga.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!doc.ic.ac.uk!doc.ic.ac.uk!not-for-mail
From: cdsm@doc.ic.ac.uk (Chris D S Moss)
Newsgroups: comp.lang.prolog
Subject: Re: PC Prolog Compilers
Date: 23 Nov 1992 18:23:35 -0000
Organization: Department of Computing, Imperial College, University of London, UK.
Lines: 48
Message-ID: <1er7j7INNon3@swan.doc.ic.ac.uk>
References: <721489167.F00001@ocitor.fidonet> <1992Nov15.184348.24877@athena.cs.uga.edu>
NNTP-Posting-Host: swan.doc.ic.ac.uk