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 | 9827 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 4 days ago
16 weeks 4 days ago
16 weeks 4 days ago
38 weeks 5 days ago
43 weeks 13 hours ago
44 weeks 4 days ago
44 weeks 4 days ago
47 weeks 2 days ago
51 weeks 6 days ago
52 weeks 1 hour ago