The function takes a variable number of parameters. It seeks first to remove all non-essential elements or reduce the complexity of the expression.

Then it arbitrarily breaks the expression into constituents according to a fixed number of rules applied in a specific order.

Then it arbitrary assigns a height to each constituent, each forming a node, and constructs the structure of the expression.

Then, the algorithm must test against its sample population of grammatical sentences for similar structures (similar relations) between constituents (and check for known exceptions) in order to assign a score of grammaticality (interpretability) to the expression.

The algorithm must be able to generate new structures, and new rules according to basic, general rules of rule-making.