<< Prev | - Up - |
This section introduces the driver predicate clls/0
for CLLS-based semantic construction, and contains links to all files needed for running the program.
Now, it is time to present the driver predicate clls
. Here it is:
clls :-
readLine(Sentence),
parse(Sentence,UsSem),
resetVars,vars2atoms(UsSem),
% printRepresentations([UsSem]),
solve(UsSem,Sems),
% printRepresentations(Sems),
usr2LambdaList(Sems,LambdaTerms),
% printRepresentations(LambdaTerms),
betaConvertList(LambdaTerms,Converted),
printRepresentations(Converted).
You have already seen the first three calls triggering the semantics construction and instantiating the Prolog variables in Section 2.5. Once we have constructed the constraint, solve/2
computes all its solved forms. Finally, usr2LambdaList/2
translates the list of solved forms to a list of "traditional" -terms. All that is left to do is to
-convert these terms.
Check it out!
Here, you can see the five readings for ``Every owner of a siamese cat loves a therapist'': clls(silent,[every,owner,of,a,siamese,cat,loves,a,therapist]).
You may uncomment any of the calls of printRepresentations/1
if you wish to inspect the constraint graphs more closely. For the above example, it will look like this: clls(verbose,[every,owner,of,a,siamese,cat,loves,a,therapist]).
Code Summary
Driver, | |
Solving: normalization and distribution. | |
Working with USRs, tree predicates, translation of solved forms into | |
The DCG-rules and the lexicon (using module | |
| |
Auxiliaries. | |
Operator definitions. | |
Generating new variables | |
Reading the input from stdin. |
<< Prev | - Up - |