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…

Corrected the final value of monoid reduction
Latest commit 8e91641 Jul 22, 2019
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 Small edit to readme Jul 2, 2019

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.


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


The JavaScript program:

let string_concat = () => (left, right) => left + right
let program = () => string_concat()("hello", "world")

Is encoded as:

  in_ call.(
      left[in_ concat]|
      right[in_ concat]|
        concat[in_ left|in_ right]|
        in_ left|in_ right
    open return.open_
  out_ call.in_ string_concat|
  open func.open_|

    out string_concat.open_.return[ func]
  func[in_ 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.