User loginNavigation |
"Prep" in programming languages"Prep" is a neglected topic in programming languages. Consider the following example of unbounded nondeterminism: CreateUnbounded.[ ]:Integer ≡ Let aCounter ← SimpleCounter.[ ]。 // let aCounter be a new Counter Prep □aCounter.go[ ]。 // send aCounter a go message and concurrently □aCounter.stop[ ]▮ // return the result of sending aCounter a stop message CreateUnbounded.[ ] is an unbounded integer. As a notational convenience, when an Actor receives message then it can send an arbitrary message to itself by prefixing it with “..” as in the following example: Actor SimpleCounter[ ] count ≔ 0, // the variable count is initially 0 continue ≔ True。 implements Counter using stop[ ] → count // return count afterward continue ≔ False¶ // continue is updated to False for the next message received go[ ] → continue � True ⦂ Prep count ≔ count+1⚫。 // increment count hole ..go[ ] ⍌ // In a hole of the cheese, send go[ ] to this counter False ⦂ Void▮ // if continue is False, return Void Interface Counter with stop[ ] ↦ Integer, go[] ↦ Void▮ By Hewitt at 2015-07-22 00:35 | LtU Forum | previous forum topic | next forum topic | other blogs | 9845 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 2 days ago
22 weeks 2 days ago
22 weeks 2 days ago
44 weeks 3 days ago
48 weeks 5 days ago
50 weeks 2 days ago
50 weeks 2 days ago
1 year 6 days ago
1 year 5 weeks ago
1 year 5 weeks ago