| Did you know ... | Search Documentation: |
| check.pl -- Consistency checking |
This library provides some consistency checks for the loaded Prolog program. The predicate make/0 runs list_undefined/0 to find undefined predicates in `user' modules.
check is detThe checker can be expanded or restricted by modifying the dynamic multifile hook checker/2.
The checker may be used in batch, e.g., for CI workflows by calling
SWI-Prolog as below. Note that by using -l to load the program,
the program is not started if it used initialization/2 of type
main to start the program.
swipl -q --on-warning=status --on-error=status \
-g check -t halt -l myprogram.pl
list_undefined is det
list_undefined(+Options) is det[user]. For example, to include the
libraries into the examination, use [user,library].
list_autoload is det
list_redefineduser as
well as in a normal module; that is, predicates for which the
local definition overrules the global default definition.
list_cross_module_calls is det
list_void_declarations is det
list_trivial_fails is det
list_trivial_fails(+Options) is det[user]. For example, to include the
libraries into the examination, use [user,library].
trivial_fail_goal(:Goal)[multifile]
list_strings is det
list_strings(+Options) is detdouble_quotes from codes to string, creating packed string
objects. Warnings may be suppressed using the following
multifile hooks:
list_rationals is det
list_rationals(+Options) is detrational_syntax to natural, creating rational numbers from
<integer>/<nonneg>. Options:
true (default false) also warn on rationals appearing
in arithmetic expressions.
list_format_errors is det
list_format_errors(+Options) is det
string_predicate(:PredicateIndicator)[multifile]
valid_string_goal(+Goal) is semidet[multifile]format("Hello world~n") is considered proper use of
string constants.
checker(:Goal, +Message:text) is nondet[multifile]my_checks
module defines a predicate list_format_mistakes/0:
:- multifile check:checker/2.
check:checker(my_checks:list_format_mistakes,
"errors with format/2 arguments").
The predicate is dynamic, so you can disable checks with retract/1. For example, to stop reporting redefined predicates:
retract(check:checker(list_redefined,_)).
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
list_undefined is det
list_undefined(+Options) is det[user]. For example, to include the
libraries into the examination, use [user,library].
list_trivial_fails is det
list_trivial_fails(+Options) is det[user]. For example, to include the
libraries into the examination, use [user,library].
list_strings is det
list_strings(+Options) is detdouble_quotes from codes to string, creating packed string
objects. Warnings may be suppressed using the following
multifile hooks:
list_rationals is det
list_rationals(+Options) is detrational_syntax to natural, creating rational numbers from
<integer>/<nonneg>. Options:
true (default false) also warn on rationals appearing
in arithmetic expressions.
list_format_errors is det
list_format_errors(+Options) is detThe following predicates are exported, but not or incorrectly documented.