The definition for a consequence given above requires checking a very large number of possibilities. To verify that “Probability ∧ Statistics ∨ Algebra ∧ Geometry” is a consequence of “Probability ∧ Statistics” we would have to check all possible module selections and confirm that all the ones which satisfy the second statement also satisfy the first one. That’s tedious and unnecessary. If A and B are grammatically correct statements then “A ∨ B” is always a grammatically correct statement and is a consequence of A and also a consequence of B. Transformations like this which take statements and give you consequences are called “rules of inference”. The soundness, or validity, of a rule of inference, the property that the statements they produce are actually consequences, depends on the interpretation. The rule for ∨ given above is a sound rule of inference for our system with its intended interpretation.
Writing down sound rules of inference can be tricky. It might seem obvious that if A and B are each grammatically correct statements then “A ∧ B” is a grammatically correct statement and that A and B are both consequences of it. This unfortunately isn’t true. “Probability ∧ Statistics ∨ Algebra ∧ Geometry” is grammatically correct statement, as are “Probability” and “Statistics ∨ Algebra ∧ Geometry”. The second of these is indeed a consequence of “Probability ∧ Statistics ∨ Algebra ∧ Geometry” but the first is not. There are module selections for which the statement “Probability ∧ Statistics ∨ Algebra ∧ Geometry” is satisfied but the statement “Probability” is not. The student could, for example, select Algebra and Geometry, and possibly various other modules, but not Probability. The problem here is that this ∧ is an unnatural place to break the expression “Probability ∧ Statistics ∨ Algebra ∧ Geometry”. It’s possible to express this in terms of the abstract syntax tree. Breaking a statement into two pieces using an ∧ at the root of its abstract syntax tree is safe. Breaking it at an ∧ elsewhere in the tree is dangerous.
Changes to the language can help. For the prefix version of the grammar it is true that if A and B are grammatically correct then “∧ A B” is grammatically correct and they are consequences of it. The same is true for the postfix version, except now the consequence is “A B ∧”. For the fully parenthesised infix language it’s true that if A and B are grammatically correct then so is “( A ∧ B )” and they are consequences of it. In none of these cases does the rule of inference need to refer to the abstract syntax tree. Our choice of language, with infix notation and with parentheses used only where needed to override precedence rules, turns out to be a particularly unfortunate one.