Skip to content
Examples of computation abstractions using the Robust Ambients calculus
Branch: master
Clone or download
haadcode Merge pull request #9 from ambientsprotocol/edits/fix-final-monoid-en…
…coding

Corrected the final value of monoid reduction
Latest commit 8e91641 Jul 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
functors Minor change to identity functor evaluation order Jul 4, 2019
monoids Corrected the final value of monoid reduction Jul 15, 2019
LICENSE Add license Jul 9, 2019
README.md Small edit to readme Jul 2, 2019
example1.gif

README.md

Ambients Encoding Examples

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.

Encodings

Simulating Ambients

The example Ambients encodings in this repository can be run with the AmbIcobjs tool to simulate the ambient reductions and program behavior.

Example 1

Setup & Run

  1. Download ambicobj.jar from the AmbIcobjs website
  2. Go to the download directory and run the tool with java -jar ambicobj.jar
  3. Once open, click the "Robust Ambient" icon (picture of a hand/glove)
  4. Copy one of the encoding examples and paste it into the input box
  5. Give the program some name (this can be whatever)
  6. Drag the created "program" somewhere on the grey area (just to make it more visible)
  7. Click the program icon
  8. The simulation is now running and you should eventually see the fully reduced value of the program

Example

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:

Screen Shot 2019-06-03 at 18 24 32

For more examples, see the list in Encodings.

You can’t perform that action at this time.