Example of a Program Action


Action:



| | | | give 3
| | | then 
| | | | bind "k" to the given datum
| | before 
| | | | | give 4
| | | | and 
| | | | | allocate a cell
| | | then 
| | | | | bind "x" to the given cell # 2
| | | | and 
| | | | | store (the given datum # 1) in (the given cell # 2)
| before 
| | recursively bind "inc" to (closure abstraction of 
| | | | | rebind
| | | | moreover 
| | | | | bind "n" to the given datum
| | | hence 
| | | | | | give (the datum bound to "n")
| | | | | and 
| | | | | | give 1
| | | | then 
| | | | | give (sum ( (the given integer # 1) , (the given integer # 2) ))
| | )
hence 
| | | | | give (the datum stored in (the cell bound to "x"))
| | | | and 
| | | | | give (the datum bound to "k")
| | | then 
| | | | give (sum ( (the given integer # 1) , (the given integer # 2) ))
| | then 
| | | store (the given datum) in (the cell bound to "x")
| and then 
| | | | give (the datum stored in (the cell bound to "x"))
| | | then 
| | | | enact (application (the abstraction bound to "inc") to (the given datum))
| | then 
| | | store (the given datum) in (the cell bound to "x")

Informal description:

The above action is the meaning of the following Specimen program:

program inc4 =
const k : int = 3;
var x : int := 4;
fun inc n : int -> int = n + 1
in
x := x + k;
x := inc (x)
end

Try this action using Java ANI.


RAT| People

[Created by Luis Carlos. Last edited at 16 Apr 2004 by Luis Carlos]