Examples of computation abstractions using the Robust Ambient calculus (abbrv. ROAM).
The encodings in this repository are written in a text format used in AmbIcobjs tool. The syntax used in the examples makes the encodings easier to read and use in files and programs.
The example Ambients encodings in this repository can be run with the AmbIcobjs tool to simulate the ambient reductions and program behavior.
- Download ambicobj.jar from the AmbIcobjs website
- Go to the download directory and run the tool with
java -jar ambicobj.jar
- Once open, click the "Robust Ambient" icon (picture of a hand/glove)
- Copy one of the encoding examples and paste it into the input box
- Give the program some name (this can be whatever)
- Drag the created "program" somewhere on the grey area (just to make it more visible)
- Click the program icon
- The simulation is now running and you should eventually see the fully reduced value of the program
The JavaScript program:
let string_concat = () => (left, right) => left + right
let program = () => string_concat()("hello", "world")
program()
Is encoded as:
string_concat[
in_ call.open call.(
func[
left[in_ arg.open arg.in string.in concat]|
right[in_ arg.open arg.in string.in concat]|
string[
concat[in_ left|in_ right]|
in_ left|in_ right
]|
open_
]|
open return.open_
)
]|
program[
out_ call.in_ string_concat|
open func.open_|
call[
out program.in string_concat.open_.return[open_.in program.in func]
]|
func[in_ string_concat.open string_concat.(
arg[string[hello[]]|in left.open_]|
arg[string[world[]]|in right.open_]|
open func.open_)
]
]|
open program
Follow the instructions in setup, copy the example encoding above and paste it into the simulation tool. Once running, wonderful things will start happening and eventually it should result in:
For more examples, see the list in Encodings.