Operator Precedence

Expression operators#

Lowest binding at the top, highest at the bottom.

LevelOperatorsDescriptionAssociativity
1<=>Biconditionalleft
2=>Implicationleft: a => b => c is (a => b) => c
3||, orDisjunctionleft
4&&, andConjunctionleft
5!, notNegationprefix; looser than comparisons: !a == b is !(a == b)
6== != < <= > >= in subset <u <=u >u >=u <s <=s >s >=sComparison, membershipnone: a < b < c is an error
7+ -Addition, subtractionleft
8* / % *u /u %u *s /s %sMultiplicativeleft
9& | ^Bitwise (tighter than *)left
10<< >> >>>Shifts (tightest binary)left
11- ~Unary minus, complementprefix
12literals, names, calls, a[i], a.f, ( … ), if … then … else …, quantifiers, lambda, extract<hi, lo>(e), Memory<N>(a)Primary—

A quantifier body and the else branch of a conditional extend as far to the right as possible: forall (i : Int) in [0..n) . a && b quantifies over a && b.

Behavior operators#

LevelOperatorNotes
1P || QParallel, lowest
2P + QChoice
3a . P, [c] P, P *Prefix (right-associative); a guard covers one prefix chain; * applies to the term just before it
4actions, names, terminals, ( … ), atomic { … }, branch …Atoms

See Process Calculus.

↑ ↓ to moveEnter to openEsc to close