library(plunit) provides a Prolog unit-test framework. 
automaton/9 takes several new options that allow capturing
properties of the input string, such as the number of occurrences of
given patterns, into domain variables. 
 +: Body, which define
dedicated propagators as indexicals.  In particular, propositional
combinations of arithmetic constraints are allowed.