Files @ 3ffeb97c88a7
Branch filter:

Location: CSY/reowolf/examples/eg_protocols.pdl

MH
Add docs for implementing infinite types in a value based language.

Since we are a value based language and do not have the concept of
pointers, then if we want to lay out the memory of datatypes we run
into a problem when the types represent recursive datastructures:
these are infinite in size. So we have an algorithm for turning
some types into pointer-like things, such that we can lay everything
out in memory.
primitive pres_2(in i, out o) {
  synchronous {
    put(o, get(i));
  }
}
primitive together(in ia, in ib, out oa, out ob){
  while(true) synchronous {
    if(fires(ia)) {
      put(oa, get(ia));
      put(ob, get(ib));
    }
  }	
}

primitive alt_round_merger(in a, in b, out c){
  while(true) {
    synchronous{ put(c, get(a)); }
    synchronous{ put(c, get(b)); }
  }	
}