Since we need a formal language anyway might as well dispense with everything superfluous and replace “The student is taking Probability and Statistics or Algebra and Geometry” with just “Probability and Statistics or Algebra and Geometry”. There’s no point in starting every single rule with “The student is taking”. Our language will then consist of module names joined by the logical operator “and”, “or” and “not” according to fixed rules.
We’ll avoid the ambiguity of whether “Probability and Statistics” is one module or two by insisting that every module title is one word, beginning with a capital letter. In a real system you would probably use some other mechanism, like using module codes instead of names, or using symbols unlikely to occur in a module name to stand in for “and”, “or” and “not”.
We’ll resolve the ambiguity about how to split up a compound phrase like “Probability and Statistics or Algebra and Geometry” by declaring that “not” takes precedence over “and”, which in turn takes precedence over “or”. By precedence we mean that it binds more tightly, so given the choice between binding the names “Probability” and “Statistics” with an “and” or “Statistics” and “Algebra” with an “or” we prefer to bind “Probability” and “Statistics” together first. Only after “Probability” and “Statistics” have been bound together with “and” and “Algebra” and “Geometry” do we bind the two larger phrases “Probability and Statistics” and “Algebra and Geometry” together with an “or”. While not strictly necessary, it is convenient to allow the use of parentheses to override these precedence rules. The alternative interpretation described earlier could then be written as “Probability and (Statistics or Algebra) and Geometry”. This could also expressed without parentheses as “Probability and Statistics and Geometry or Probability and Algebra and Geometry”, but this is longer and harder to read than the version with parentheses.
Note that this use of the word precedence may not match your intuitions. If you parse statements in a top down manner, which is the way humans generally do, then you start with the operators of lowest precedence and work your way up to those of higher precedence.