Overflow_Integer_Stack(...) Module Interface Specification

(0) CHARACTERISTICS

-type specified: stac

-features: deterministic, parameterized

-foreign types:

-parameters: stacksize: int

(1) SYNTAX

ACCESS-PROGRAMS

Program Name
Arg#1Arg#2Result Type
PUSHstac:VOint:V 
POPstac:VO   
TOPstac:V  int

(2) CANONICAL TRACES

canonical(T) n:<int>; x[1]..x[n]:<int> [T = [PUSH(*, x[i])]i=1..n n stacksize]

(3) SEMANTICS

ACCESS-PROGRAMS

Legality(PUSH((n, T), x)) = %legal%

PUSH((n, T) , x) =

ConditionValue
length(T) < stacksizeT.PUSH(*, x)
length(T) = stacksize S1.PUSH(*, x) where S1:<stac>; y:<int> [T = PUSH(*, y).S1 ]

Legality(POP((n, T))) =

ConditionValue
T = _ %empty%
T _%legal%

POP((n, T) ) = S1 where S1:<stac>; x:<int> [T = S1.PUSH(*, x) ]

Legality(TOP(T)) =

ConditionValue
T = _ %empty%
T _%legal%

TOP(T) = x mod 255 where T1:<stac>; x:<int> [T = T1.PUSH(*, x) ]