SPL Language

Process Calculus

Behavior expressions are the core of SPL. They describe process control flow using algebraic operators over actions and behavior names.

Terminals

SymbolNameMeaning
doneSuccessful terminationProcess completes normally
BottomDeadlockProcess is stuck, cannot proceed
0Deadlock (alternative)Same as Bottom

Operators (by precedence, lowest to highest)

OperatorSyntaxNameMeaning
ParallelP1 || P2Parallel compositionInterleaved concurrent execution
ChoiceP1 + P2Nondeterministic choiceOne branch is chosen
Prefixa . PAction prefixExecute action a, then continue as P
StarP *Kleene iterationZero or more repetitions
Guard[cond] PGuarded behaviorExecute P only if cond holds

Prefix (sequential composition)

The dot . operator creates action-prefixed behaviors. a . P means "execute action a, then behave as P".

// Execute action a, then b, then terminate
P0 = a . b . done ;

When the left side of . is a named reference with arguments, it is parsed as an action prefix:

P0 = selectValidator(timeSlot) . P1 ;

Choice (nondeterministic)

The + operator models nondeterministic choice between alternatives:

// Either go left or go right
P0 = goLeft . P1 + goRight . P2 ;

N-ary choice is supported — multiple + alternatives are flattened:

P0 = action1 . P1
   + action2 . P2
   + action3 . P3 ;

Parallel composition

The || operator composes behaviors concurrently. Actions interleave nondeterministically:

// Two processes run concurrently
System = ProcessA || ProcessB ;

Guard

Square brackets [cond] create conditional guards:

Idle = [state == INVALID] HandleMiss
     + [state != INVALID] HandleHit ;

Guards are essential for modeling conditional branching.

Star (iteration)

The * postfix operator models repetition — zero or more executions:

P0 = (action . done) * ;

Recursion

Behavioral equations support mutual recursion through name references:

behavior {
    // P0 → P1 → P0 → P1 → ... (infinite loop)
    P0 = action1 . P1 ;
    P1 = action2 . P0 ;
}

A common pattern is looping back with a termination option:

behavior {
    P0 = processItem . P0    // loop
       + done ;              // or terminate
}

Parentheses

Use () to group sub-expressions:

P0 = a . (b . P1 + c . P2) ;

Algebraic laws

The substrate satisfies these laws (applied automatically during normalization):

LawEquation
Choice is commutativeP1 + P2 = P2 + P1
Choice is associative(P1 + P2) + P3 = P1 + (P2 + P3)
Choice is idempotentP + P = P
Deadlock is choice identityP + 0 = P
done is seq identity (left)done . P = P
done is seq identity (right)P . done = P
Deadlock is seq zero (left)0 . P = 0
Deadlock propagates (seq)P . 0 = 0
Right distributivity(P1 + P2) . P3 = P1 . P3 + P2 . P3
done is parallel identityP || done = P
Deadlock propagates (parallel)P || 0 = 0
Expansion lawa.P1 || b.P2 = a.(P1 || b.P2) + b.(a.P1 || P2)