Expanded discussion of Prolog.
Added tracing at per-pattern level.