Patent ID: 8156145

Claim:
A method for processing queries, comprising the computer-implemented steps of: receiving a query that comprises a model clause, said model clause comprising a rule, wherein said rule comprises: a first left-side expression, said first left-side expression including a for-loop predicate that indicates one or more iterations, wherein said one or more iterations identify one or more left-side expressions; and a first right-side expression; compiling said query; after compiling said query, executing said query to generate a relation, wherein said step of executing comprises: unfolding said for-loop predicate by performing said one or more iterations; and at each of said one or more iterations, performing the steps of: substituting said first left-side expression in said rule with one of said one or more left-side expressions; and after substituting said first left-side expression, evaluating said rule; and wherein the steps of the method are performed by one or more computer systems.