(0) CHARACTERISTICS
-type specified: stac
-features: deterministic, parameterized
-foreign types:
-parameters: stacksize: int
(1) SYNTAX
ACCESS-PROGRAMS
Arg#1 | Arg#2 | Result Type | PUSH | stac:VO | int:V | | POP | stac:VO | | | TOP | stac: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-PROGRAMSLegality(PUSH((n, T), x)) = %legal%
PUSH((n, T) , x) =
Condition | Value |
---|---|
length(T) < stacksize | T.PUSH(*, x) |
length(T) = stacksize | S1.PUSH(*, x) where S1:<stac>; y:<int> [T = PUSH(*, y).S1 ] |
Legality(POP((n, T))) =
Condition | Value |
---|---|
T = _ | %empty% |
T _ | %legal% |
POP((n, T) ) = S1 where S1:<stac>; x:<int> [T = S1.PUSH(*, x) ]
Legality(TOP(T)) =
Condition | Value |
---|---|
T = _ | %empty% |
T _ | %legal% |
TOP(T) = x mod 255 where T1:<stac>; x:<int> [T = T1.PUSH(*, x) ]