next up previous contents index
Next: Print a VIT Up: A Library Package for Previous: Copy and Delete Information

Subsections


Check a VIT or Parts of It

  This section lists all predicates which can be used to check the VIT or parts of it. The basic tests check the syntactical wellformedness wrt. valid information described in Section gif and the language specific lexicons. Further tests run on the contextual relations between pieces of information in a VIT (see Section gif).

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 gif).

Special predicates check the wellformedness of single pieces of information, its accordance to slots and the type of its arguments (see Section gif).

VIT Checkers

 

vitCheck(+VIT) 

Combines vitCheckFormat/1 and vitCheckContent/1 (see below).



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.gif 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.

Error Reporting Options

  The error reporting can be toggled by vitReportErrors/0 (default) and vitDontReportErrors/0. The error handler's output can be redirected using vitErrorOutput/1 and reset to the default output (user_error) by vitResetErrorOutput/0. After errors have been detected and reported any further processing can be influenced using vitIgnoreError/0 (default) or vitFailOnError/0.



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.

Lexicon Compatibility Options

  The current language used by the ADT package can be switched using vitSetLanguage/1. vitSetMyLanguage/1 is used to switch to private on-line lexicons. The current language setting can be accessed using vitLanguage/1. vitAutoLanguage/0 uses the current language specified in the ``VIT ID'' slot for checking. With vitIgnoreLanguage/0 the checkers ignore the language of a VIT and use the current (manual) language setting.

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).

Checking Information Terms

  Single information can be checked using vitValidInfo/{2,3} or vitADT:validInfoCheck/3. The different types of arguments can be tested with vitInst/1, vitLabel/1, vitHole/1, and vitLabelOrHole/1.



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.gif 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)

Tests on Argument Types

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.


next up previous contents index
Next: Print a VIT Up: A Library Package for Previous: Copy and Delete Information

Michael Dorna , VM Report 238, 5/18/2000