Refactored test
Extended tests of prolog term generator
Prolog term generator: added pattern calls in pattern bodies
Prolog term generator: added pattern scope arguments