Created
December 15, 2015 07:37
-
-
Save Locke/7e86fc814b45dfbf354a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @maxsteps 10 | |
CoreASM SelfUndef | |
use Standard | |
option DebugInfo.activeChannels ALL | |
option Signature.TypeChecking strict | |
option Signature.NoUndefinedId strict | |
init Initialize | |
function dataList : -> LIST | |
function data : Agents -> NUMBER | |
rule Initialize = { | |
seq | |
dataList := [1, 2, 3, 4, 5, 6, 7, 8, 9] | |
next | |
forall x in dataList do { | |
extend Agents with a do { | |
data(a) := x | |
program(a) := @Run | |
} | |
} | |
program(self) := undef | |
} | |
/* | |
* @require "calculate(test) = test_1" | |
* @require "calculate(test) = test_2" | |
* @require "calculate(test) = test_3" | |
* @require "calculate(test) = test_4" | |
* @require "calculate(test) = test_5" | |
* @require "calculate(test) = test_6" | |
* @require "calculate(test) = test_7" | |
* @require "calculate(test) = test_8" | |
* @require "calculate(test) = test_9" | |
* @refuse "Run.self = undef" | |
*/ | |
rule Run = { | |
print "Run.self = " + self | |
let x = calculate("test") in { | |
print "calculate(test) = " + x | |
} | |
} | |
function res : -> STRING | |
/* | |
* @refuse "calculate.self = undef" | |
*/ | |
derived calculate(x) = return res in { | |
print "calculate.self = " + self | |
res := x + "_" + data(self) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment