Did you know ... Search Documentation:
Predicate template_to_pattern/5
 template_to_pattern(+Template, -Pattern, -Post, -Vars, -Aggregate)[private]
Determine which parts of the goal we must remember in the findall/3 pattern.
Arguments:
Post- is a body-term that evaluates expressions to reduce storage requirements.
Vars- is a list of intermediate variables that must be added to the existential variables for bagof/3.
Aggregate- defines the aggregation operation to execute.