finderrors(dataset / ruleset) → number
The subroutine finderrors takes a dataset or a ruleset as argument, checks for errors and potential problems (involving arity, safety, stratification, and so forth), and returns as value the number of answers found. For each error found, it also prints a corresponding message using console.log.
Call: finderrors(readdata('p(a,b) p(b,c)'))
Exit: 0
Call: Call: finderrors(readdata('r(X,Z) :- p(X,Y) & ~r(Y)'))
Safety error in r(X,Z) :- p(X,Y) & ~r(Y).
Stratification error in r(X,Z) :- p(X,Y) & ~r(Y).
Exit: 1
|