Next: Print a VIT
Up: A Library Package for
Previous: Copy and Delete Information
After error detection several options regulate the reporting and
behaviour of the ADT package. Other options control the language
selection and the treatment of lexical gaps in the on-line lexicons
(see Section
).
Special predicates check the wellformedness of single pieces of
information, its accordance to slots and the type of its arguments
(see Section
).
vitCheckFormat(+VIT)
Checks the syntax of the information in a given VIT. Currently, the
checking covers the following:
vitCheckContent(+VIT)
Checks dependencies between information in a given VIT.
Currently, the checking covers the following:
vitDeepCheck(+VIT)
Checks connections
between information in a given VIT.
Currently, the
checking covers the following:
vitCheckGroupings(+VIT,-VIT)
Checks
and repairs groupings, e.g., removes nested groupings or tries to
break cyclic groupings.
vitCheckSubord(+VIT,-VIT)
Checks and
repairs eq/2 constraints, top labels, cycles, and redundant
leq/2 constraints.
vitReportErrors
All detected errors are
reported after checking (default).
vitDontReportErrors
No errors are
reported even if some were detected during checking.
vitIgnoreError
Switches the checkers
error handler to ``ignore'', i.e. even if an error occured, the
checkers succeed (default).
vitFailOnError
Switches the checkers error handler to ``fail'', i.e. an error
forces a failure.
vitErrorOutput(+File)
Redirects the
checkers error output to a file or stream. File needs to be an
accessible and writeable file or a Prolog output stream. Default is
user_error.
vitResetErrorOutput
Switches error
output to the default output, i.e. sets output to
user_error.
vitLazyCheck/0 changes the behaviour of vitCheckFormat/1 and vitAdd/{2,3} to be lazy with respect to the language specific parts of a VIT. This is important when using information which is not known to the ADT package. This kind of information is assumed to be part of the Conditions slot. The system will report every detection of unknown information during processing but will not fail. To switch off this mode use vitRegularCheck/0 (default).
vitAutoLanguage
The ADT selects a VIT's
language, e.g. for checking the contents, based on its
CurrentLanguage value (default).
vitIgnoreLanguage
The current ADT
language has to be manually specified, e.g. using
vitSetLanguage/1.
vitLanguage(?Language)
Reports current
language setting.
vitSetLanguage(+Language/+VIT)
Switches
the ADT to a given language or the current language of a VIT
(encoded in the SegmentID).
vitSetMyLanguage(+Atom)
Switches the
ADT to a user defined lexicon in a Prolog module named
Atom.
vitLazyCheck
Using this mode
vitCheckFormat/1 and vitAdd/{2,3} try to handle
syntactically unknown information.
vitRegularCheck
This mode assumes all
information in a VIT to be known to the ADT package (default).
vitValidInfo(+Info, +Check)
Same as vitValidInfo(Info, Check, _) (see below).
vitValidInfo(+Info, +Check, ?Slot)
Checks
syntax of a given information and if it is valid for a slot. If
Check == shape, only the form (functor and arity) of
Info will be checked. In any other case, a regular check
will be performed assuming Info to be a valid instance.
Example:
| ?- vitValidInfo(s_sort(i1,_),shape,S).
S = 'Sorts'
| ?- vitValidInfo(s_sort(i1,thing),ground,'Semantics').
no
| ?- vitValidInfo(s_sort(i1,thing),ground,Slot).
Slot = 'Sorts'
vitADT:validInfoCheck(+Info,?Slot,-Code)
Reports checks for a given information Info. The valid slot
for Info is unified with Slot. Code is
callable Prolog code for checking the arguments of an
information.
Note: This
predicate is not exported by the vitADT module!
Example:
| ?- vitADT:validInfoCheck(pers(X,Y),Slot,Code).
Slot = 'Syntax',
Code = vitInst(X),personValue(Y)
There are type checks implemented for all kinds of information in a VIT. If you need some other tests than the ones described below, check the code!
vitInst(+Inst)
Checks the syntax of an instance.
Example:
| ?- vitInst(l1).
no
| ?- vitInst(it1).
yes
vitLabel(+Label)
Checks the syntax of a label.
vitHole(+Hole)
Checks the syntax of a hole.
vitLabelOrHole(+LabelOrHole)
Checks the syntax of either a label or a hole.
Michael Dorna , VM Report 238, 5/18/2000