3.5.4 A First Run

An example query.

firstLambda.pl: View Download

Now, this makes semantic construction during parsing extremely easy: we simply use @ to record the required function/argument structure. (The new DCG with additional argument is part of the file firstLambda.pl.) Here is an example query:

?- s(Sem,[mary,walks],[]).
 
Sem = lambda(_G358, _G358@mary)@lambda(_G364, walk(_G364))

Or generate the semantics for ``John loves Mary'': s(Sem,[john,loves,mary],[]).

?- Question!

Where do the anonymous variables in the output of our predicate (for instance _G358 and _G364 in the above example) come from?

So now we can construct -terms for natural language sentences. But of course, we need to do more work after parsing, for we certainly want to reduce these complicated -expressions into readable first-order formulas by carrying out -conversion. Next, we will implement the predicate betaConvert/2, which will do the job.


Aljoscha Burchardt, Stephan Walter, Alexander Koller, Michael Kohlhase, Patrick Blackburn and Johan Bos
Version 1.2.5 (20030212)