DirectiveTestsUtils
Shared helpers for TestDirectives, covering directive-related behavior (dynamic/1, static/1, initialization/1, solve/1, flag/operator-setting directives, and how a Solver/MutableSolver reacts to loading a theory built from them) that would otherwise require boilerplate repeated across every test case.
Functions
Builds a theory of size facts f1., f2., ..., optionally followed by one last clause; used by TestDirectives.testDirectiveLoadingQuickly to check that loading a large static knowledge base does not incur pathological (e.g. quadratic) loading time.
A single-clause sequence containing the directive dynamic(functor/arity)..
The four equivalent ways a given can end up as a solver's knowledge base: as the static or dynamic theory passed to SolverFactory.solverOf, or loaded after the fact into a fresh MutableSolver via MutableSolver.loadStaticKb/MutableSolver.loadDynamicKb. TestDirectives runs its directive-loading assertions against every one of these, since a directive (e.g. dynamic/1) must behave the same way regardless of how its enclosing theory was loaded.
Same four loading strategies as solverInitializers, but built with default built-ins and each paired with the mutable event list its solver's stdOut/stdErr/warnings channels append to — so a caller can load a theory containing initialization/1/solve/1/writing directives and then assert on what was written or warned about during loading.
A single-clause sequence containing the directive static(functor/arity)..