<< Prev | - Up - | Next >> |
An example query.
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.
<< Prev | - Up - | Next >> |