### Abruptly terminating
[
Funcon stuck
Entity abrupted
Funcon finalise-abrupting
Funcon abrupt
Funcon handle-abrupt
Funcon finally
]
Meta-variables
T, T′, T′′ <: values
Funcon
stuck : =>empty-type
*/
Entity
_ --abrupted(_:values?)-> _
*/
Funcon finalise-abrupting(X:=>T) : =>T|null-type
~> handle-abrupt(X, null-value)
*/
Funcon
abrupt(_:values) :=>empty-type
*/
Rule
abrupt(V:values) --abrupted(V)-> stuck
Funcon
handle-abrupt(_:T′=>T, _:T′′=>T) : T′=>T
*/
Rule
X --abrupted( )-> X′
--------------------------------------------------------
handle-abrupt(X, Y) --abrupted( )-> handle-abrupt(X′, Y)
Rule
X --abrupted(V:T′′)-> X′
----------------------------------------------
handle-abrupt(X, Y) --abrupted( )-> give(V, Y)
Rule
handle-abrupt(V:T, Y) ~> V
Funcon
finally(_:=>T, _:=>null-type) : =>T
*/
Rule
X --abrupted( )-> X′
--------------------------------------------
finally(X, Y) --abrupted( )-> finally(X′, Y)
Rule
X --abrupted(V:values)-> X′
-----------------------------------------------------
finally(X, Y) --abrupted()-> sequential(Y, abrupt(V))
Rule
finally(V:T, Y) ~> sequential(Y,V)
/*
`stuck` does not have any computation. It is used to represent the result of a transition that causes the computation to terminate abruptly.