Given that a parse is valid only if we can contract it to a tree with only lexical leaves and the Goal node as its root, this means that all positive and negative atomic formulas need to be eliminated. Since each substitution cancels a positive and a negative atomic formula of the same type, this makes the count check an easy verification to perform to exclude graphs which are sure to be invalid.
If a lexical lookup is invalid, Grail will print an error message to
the terminal - indicating one of the atomic categories which occurs
either too few or too many times - and continue with the next lookup and if no other lookups
exist for the sentence, Grail will fail. In order to verify your
grammar is correct, open the file lookup.dot
which is in
your current working directory. This lists all the possible lexical
lookups for each word and allows you to verify there is a problem with
your grammar.
A second option is that your sentence passes the count check for at least one of its lookups but that the optimization parameters specified for the grammar excludes all substitutions for your grammar. We'll deal with how to correct this next.
g3 nozeroheap
command line option. This will show all
possible axiom linking for the current lexical lookup even if one or
more atoms have zero substitution possibilities.
%
to it) . The declarations to comment out are:
continuous
and continuous_dia
declarations,
custom_first_order
predicate definitions
inert
and inert_dia
declarations.
grail_log
logs all attempts at connecting axioms and
indicates which of the first order labeling or the inert
declarations is to blame for a connection failures.
Of course, this automatically means Grail can derive the current sentence in the word order indicated. If this is not what you want, there is probably an error in either your lexicon or your structural rules.
Similarly, if Grail fails to derive the desired word order, this can be a problem of missing graph in the lexicon or a missing structural rule in the grammar. When writing a grammar, you should always strive to strike a careful balance between lexical ambiguity and the number of structural rules in your grammar. Ideally, your grammar should both have a restricted number of lexical graphs for each word and a restricted number of structural rules.
external
modes. This is especially the case for grammars created by editing a
file. When Grail has succeeded performing all contractions, it filters
the resulting shared forest keeping only the modes which have been
declared as external by your grammar. In case there are no
trees consisting exclusively of branches of external modes, the parse
is considered to have failed.
The quick fix is to add the following declarations to your grammar
external(_).
external_dia(_).
Though a powerful a commonly used tool, the use of external declarations should be used with care and their complete absence is almost certainly an error of the grammar writer.
grail_log
in the current working
directory (the same directory where Grail puts all the output files
for Graphviz and LaTeX).
Grail puts a lot of information in this file, so if you want to
inspect the grail_log
, it is recommended that you