diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
commit | b96af395b9af2ff9df94b3e82213171f30827c8d (patch) | |
tree | 17c8c12648ccc25625e2534ec8d74fbe8f1542cc /cpp | |
parent | 2e3b597fe85b654e82b891c22d50754fa5a26156 (diff) | |
download | mu-b96af395b9af2ff9df94b3e82213171f30827c8d.tar.gz |
1276 - make C++ version the default
I've tried to update the Readme, but there are at least a couple of issues.
Diffstat (limited to 'cpp')
261 files changed, 0 insertions, 33514 deletions
diff --git a/cpp/.traces/add b/cpp/.traces/add deleted file mode 100644 index 51c64f81..00000000 --- a/cpp/.traces/add +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: add -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: add ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- add/2 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 23 -run/0: ingredient 1 is 2 -mem/0: location 2 is 34 -run/0: product 0 is 57 -mem/0: storing 57 in location 3 diff --git a/cpp/.traces/add_literal b/cpp/.traces/add_literal deleted file mode 100644 index c6dc982e..00000000 --- a/cpp/.traces/add_literal +++ /dev/null @@ -1,14 +0,0 @@ -parse/0: instruction: add -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: add ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "23", value: 23, type: 0, properties: ["23": "literal"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 23 -run/0: ingredient 1 is 34 -run/0: product 0 is 57 -mem/0: storing 57 in location 1 diff --git a/cpp/.traces/and b/cpp/.traces/and deleted file mode 100644 index d354b1a9..00000000 --- a/cpp/.traces/and +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: and -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: and ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- and/7 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1 -run/0: ingredient 1 is 2 -mem/0: location 2 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/array-from-args b/cpp/.traces/array-from-args deleted file mode 100644 index 695f32cb..00000000 --- a/cpp/.traces/array-from-args +++ /dev/null @@ -1,329 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ", value: 0, type: 0, properties: [" - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ", value: 0, type: 0, properties: [" - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ": "literal-string"]} -after-brace/0: recipe array-from-args -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: array-from-args -run/0: instruction array-from-args/0 -run/0: run/45 {name: " - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ", value: 0, type: 0, properties: [" - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ": "literal-string"]} -parse/0: instruction: init-array -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "deref": ]} -parse/0: product: {name: "2", value: 0, type: 5-1, properties: ["2": "array":"location"]} -after-brace/0: recipe run1001 -after-brace/0: init-array ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"location"]} <- init-array/114 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction init-array/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-array/1 -run/0: {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1002 -run/0: instruction init-array/3 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/4 -run/0: break-unless/12 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1004 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction init-array/5 -run/0: {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1002 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1002 -run/0: instruction init-array/6 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 3 -run/0: instruction init-array/3 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1 -mem/0: storing 1 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/4 -run/0: break-unless/12 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1004 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction init-array/5 -run/0: {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1002 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1002 -run/0: instruction init-array/6 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 3 -run/0: instruction init-array/3 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/4 -run/0: break-unless/12 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1004 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction init-array/5 -run/0: {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1002 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1002 -run/0: instruction init-array/6 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 3 -run/0: instruction init-array/3 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1004 -run/0: instruction init-array/4 -run/0: break-unless/12 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1004 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction init-array/8 -run/0: {name: "result", value: 4, type: 2-5-1, properties: ["result": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1002 is 3 -mem/0: array size is 3 -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1005 -run/0: instruction init-array/9 -run/0: rewind-ingredients/31 -run/0: instruction init-array/10 -run/0: {name: "i", value: 5, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1006 -run/0: instruction init-array/12 -run/0: {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 0 -run/0: ingredient 1 is capacity -mem/0: location 1002 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1007 -run/0: instruction init-array/13 -run/0: break-if/11 {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1007 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction init-array/14 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/15 -run/0: assert/19 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "error in rewinding ingredients to init-array", value: 0, type: 0, properties: ["error in rewinding ingredients to init-array": "literal-string"]} -run/0: ingredient 0 is exists? -mem/0: location 1004 is 1 -run/0: instruction init-array/16 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location"]} <- index-address/27 {name: "result", value: 4, type: 2-5-1, properties: ["result": "address":"array":"location", "deref": ]}, {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1005 is 1031 -run/0: ingredient 1 is {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -mem/0: location 1006 is 0 -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1008 -run/0: instruction init-array/17 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location", "deref": ]} <- copy/1 {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]} -run/0: ingredient 0 is curr-value -mem/0: location 1003 is 0 -mem/0: location 1008 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-array/18 -run/0: {name: "i", value: 5, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1006 -run/0: instruction init-array/19 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 12 -run/0: instruction init-array/12 -run/0: {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 1 -run/0: ingredient 1 is capacity -mem/0: location 1002 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1007 -run/0: instruction init-array/13 -run/0: break-if/11 {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1007 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction init-array/14 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1 -mem/0: storing 1 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/15 -run/0: assert/19 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "error in rewinding ingredients to init-array", value: 0, type: 0, properties: ["error in rewinding ingredients to init-array": "literal-string"]} -run/0: ingredient 0 is exists? -mem/0: location 1004 is 1 -run/0: instruction init-array/16 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location"]} <- index-address/27 {name: "result", value: 4, type: 2-5-1, properties: ["result": "address":"array":"location", "deref": ]}, {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1005 is 1031 -run/0: ingredient 1 is {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -mem/0: location 1006 is 1 -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1008 -run/0: instruction init-array/17 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location", "deref": ]} <- copy/1 {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]} -run/0: ingredient 0 is curr-value -mem/0: location 1003 is 1 -mem/0: location 1008 is 1033 -mem/0: storing 1 in location 1033 -run/0: instruction init-array/18 -run/0: {name: "i", value: 5, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1006 -run/0: instruction init-array/19 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 12 -run/0: instruction init-array/12 -run/0: {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 2 -run/0: ingredient 1 is capacity -mem/0: location 1002 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1007 -run/0: instruction init-array/13 -run/0: break-if/11 {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1007 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction init-array/14 -run/0: {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]}, {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 1003 -mem/0: storing 1 in location 1004 -run/0: instruction init-array/15 -run/0: assert/19 {name: "exists?", value: 3, type: 3, properties: ["exists?": "boolean"]}, {name: "error in rewinding ingredients to init-array", value: 0, type: 0, properties: ["error in rewinding ingredients to init-array": "literal-string"]} -run/0: ingredient 0 is exists? -mem/0: location 1004 is 1 -run/0: instruction init-array/16 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location"]} <- index-address/27 {name: "result", value: 4, type: 2-5-1, properties: ["result": "address":"array":"location", "deref": ]}, {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1005 is 1031 -run/0: ingredient 1 is {name: "i", value: 5, type: 1, properties: ["i": "integer"]} -mem/0: location 1006 is 2 -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1008 -run/0: instruction init-array/17 -run/0: {name: "tmp", value: 7, type: 2-1, properties: ["tmp": "address":"location", "deref": ]} <- copy/1 {name: "curr-value", value: 2, type: 1, properties: ["curr-value": "location"]} -run/0: ingredient 0 is curr-value -mem/0: location 1003 is 2 -mem/0: location 1008 is 1034 -mem/0: storing 2 in location 1034 -run/0: instruction init-array/18 -run/0: {name: "i", value: 5, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1006 -run/0: instruction init-array/19 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 12 -run/0: instruction init-array/12 -run/0: {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 5, type: 1, properties: ["i": "integer"]}, {name: "capacity", value: 1, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1006 is 3 -run/0: ingredient 1 is capacity -mem/0: location 1002 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1007 -run/0: instruction init-array/13 -run/0: break-if/11 {name: "done?", value: 6, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1007 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 20 -run/0: instruction init-array/21 -run/0: reply/33 {name: "result", value: 4, type: 2-5-1, properties: ["result": "address":"array":"location"]} -mem/0: location 1005 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 5-1, properties: ["2": "array":"location"]} <- copy/1 {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"location", "deref": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -mem/0: location 1031 is 3 -mem/0: location 1032 is 0 -mem/0: location 1033 is 1 -mem/0: location 1034 is 2 -mem/0: storing 3 in location 2 -mem/0: storing 0 in location 3 -mem/0: storing 1 in location 4 -mem/0: storing 2 in location 5 -run/0: instruction array-from-args/1 -run/0: memory-should-contain/46 {name: " - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ", value: 0, type: 0, properties: [" - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 diff --git a/cpp/.traces/array_length b/cpp/.traces/array_length deleted file mode 100644 index 514e67b5..00000000 --- a/cpp/.traces/array_length +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: length -parse/0: ingredient: {name: "1", value: 0, type: 5-1, properties: ["1": "array":"integer"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: length ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- length/28 {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]} -mem/0: storing 3 in location 5 diff --git a/cpp/.traces/assert b/cpp/.traces/assert deleted file mode 100644 index 74ca6ecf..00000000 --- a/cpp/.traces/assert +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: instruction: assert -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: ingredient: {name: "this is an assert in mu", value: 0, type: 0, properties: ["this is an assert in mu": "literal-string"]} -after-brace/0: recipe main -after-brace/0: assert ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: assert/19 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "this is an assert in mu", value: 0, type: 0, properties: ["this is an assert in mu": "literal-string"]} -run/0: ingredient 0 is 0 -warn/0: this is an assert in mu diff --git a/cpp/.traces/brace_conversion b/cpp/.traces/brace_conversion deleted file mode 100644 index 99c3b723..00000000 --- a/cpp/.traces/brace_conversion +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: label: { -parse/0: instruction: break -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 0) -brace/0: push (close, 3) -after-brace/0: recipe main -after-brace/0: jump 1:offset -after-brace/0: copy ... diff --git a/cpp/.traces/brace_conversion_and_run b/cpp/.traces/brace_conversion_and_run deleted file mode 100644 index 172de7f0..00000000 --- a/cpp/.traces/brace_conversion_and_run +++ /dev/null @@ -1,195 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean"]} -parse/0: instruction: break-if -parse/0: ingredient: {name: "3", value: 0, type: 3, properties: ["3": "boolean"]} -parse/0: instruction: multiply -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: subtract -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: loop -parse/0: label: } -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -brace/0: 1000: push (open, 2) -brace/0: push (close, 8) -after-brace/0: recipe test-factorial -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: equal ... -after-brace/0: jump-if 3, 3:offset -after-brace/0: multiply ... -after-brace/0: subtract ... -after-brace/0: jump -5:offset -after-brace/0: 7: {name: "", value: -5, type: , properties: ["": ]} -after-brace/0: 7: {name: "", value: -5, type: , properties: ["": ]} -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: test-factorial -run/0: instruction test-factorial/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 1 -run/0: instruction test-factorial/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 2 -run/0: instruction test-factorial/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction test-factorial/4 -run/0: break-if/11 {name: "3", value: 3, type: 3, properties: ["3": "boolean"]}, {name: "", value: 3, type: , properties: ["": ]} -mem/0: location 3 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction test-factorial/5 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- multiply/4 {name: "2", value: 2, type: 1, properties: ["2": "integer"]}, {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 1 -run/0: ingredient 1 is 1 -mem/0: location 1 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 2 -run/0: instruction test-factorial/6 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- subtract/3 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction test-factorial/7 -run/0: loop/10 {name: "", value: -5, type: , properties: ["": ]} -run/0: ingredient 0 is -5 -run/0: jumping to instruction 3 -run/0: instruction test-factorial/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction test-factorial/4 -run/0: break-if/11 {name: "3", value: 3, type: 3, properties: ["3": "boolean"]}, {name: "", value: 3, type: , properties: ["": ]} -mem/0: location 3 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction test-factorial/5 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- multiply/4 {name: "2", value: 2, type: 1, properties: ["2": "integer"]}, {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 5 -run/0: ingredient 1 is 1 -mem/0: location 1 is 4 -run/0: ingredient 1 is 4 -run/0: product 0 is 20 -mem/0: storing 20 in location 2 -run/0: instruction test-factorial/6 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- subtract/3 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction test-factorial/7 -run/0: loop/10 {name: "", value: -5, type: , properties: ["": ]} -run/0: ingredient 0 is -5 -run/0: jumping to instruction 3 -run/0: instruction test-factorial/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction test-factorial/4 -run/0: break-if/11 {name: "3", value: 3, type: 3, properties: ["3": "boolean"]}, {name: "", value: 3, type: , properties: ["": ]} -mem/0: location 3 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction test-factorial/5 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- multiply/4 {name: "2", value: 2, type: 1, properties: ["2": "integer"]}, {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 20 -run/0: ingredient 1 is 1 -mem/0: location 1 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 60 -mem/0: storing 60 in location 2 -run/0: instruction test-factorial/6 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- subtract/3 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction test-factorial/7 -run/0: loop/10 {name: "", value: -5, type: , properties: ["": ]} -run/0: ingredient 0 is -5 -run/0: jumping to instruction 3 -run/0: instruction test-factorial/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction test-factorial/4 -run/0: break-if/11 {name: "3", value: 3, type: 3, properties: ["3": "boolean"]}, {name: "", value: 3, type: , properties: ["": ]} -mem/0: location 3 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction test-factorial/5 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- multiply/4 {name: "2", value: 2, type: 1, properties: ["2": "integer"]}, {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 60 -run/0: ingredient 1 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 120 -mem/0: storing 120 in location 2 -run/0: instruction test-factorial/6 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- subtract/3 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction test-factorial/7 -run/0: loop/10 {name: "", value: -5, type: , properties: ["": ]} -run/0: ingredient 0 is -5 -run/0: jumping to instruction 3 -run/0: instruction test-factorial/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction test-factorial/4 -run/0: break-if/11 {name: "3", value: 3, type: 3, properties: ["3": "boolean"]}, {name: "", value: 3, type: , properties: ["": ]} -mem/0: location 3 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction test-factorial/9 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 120 -mem/0: storing 120 in location 4 diff --git a/cpp/.traces/break_cascading b/cpp/.traces/break_cascading deleted file mode 100644 index c9c2dedd..00000000 --- a/cpp/.traces/break_cascading +++ /dev/null @@ -1,17 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: break -parse/0: label: } -parse/0: label: { -parse/0: instruction: break -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: push (close, 3) -brace/0: 1000: push (open, 4) -brace/0: push (close, 6) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: jump 0:offset -after-brace/0: jump 0:offset diff --git a/cpp/.traces/break_cascading2 b/cpp/.traces/break_cascading2 deleted file mode 100644 index 636bf3d4..00000000 --- a/cpp/.traces/break_cascading2 +++ /dev/null @@ -1,25 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: break -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -parse/0: label: { -parse/0: instruction: break -parse/0: label: } -brace/0: 1000: push (open, 2) -brace/0: push (close, 5) -brace/0: 1000: push (open, 6) -brace/0: push (close, 8) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump 1:offset -after-brace/0: copy ... -after-brace/0: jump 0:offset diff --git a/cpp/.traces/break_empty_block b/cpp/.traces/break_empty_block deleted file mode 100644 index f31738bb..00000000 --- a/cpp/.traces/break_empty_block +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: break -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: push (close, 3) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: jump 0:offset diff --git a/cpp/.traces/break_if b/cpp/.traces/break_if deleted file mode 100644 index 109f95f4..00000000 --- a/cpp/.traces/break_if +++ /dev/null @@ -1,26 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: break-if -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -parse/0: label: { -parse/0: instruction: break -parse/0: label: } -brace/0: 1000: push (open, 2) -brace/0: push (close, 5) -brace/0: 1000: push (open, 6) -brace/0: push (close, 8) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump-if 2, 1:offset -after-brace/0: copy ... -after-brace/0: jump 0:offset diff --git a/cpp/.traces/break_label b/cpp/.traces/break_label deleted file mode 100644 index 5dc39132..00000000 --- a/cpp/.traces/break_label +++ /dev/null @@ -1,12 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: break -parse/0: ingredient: {name: "+foo", value: 0, type: 0, properties: ["+foo": "offset"]} -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: push (close, 3) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: jump +foo:offset diff --git a/cpp/.traces/break_nested b/cpp/.traces/break_nested deleted file mode 100644 index 088b4742..00000000 --- a/cpp/.traces/break_nested +++ /dev/null @@ -1,27 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: break -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: 1000: push (open, 4) -brace/0: push (close, 6) -brace/0: push (close, 8) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump 4:offset -after-brace/0: copy ... -after-brace/0: copy ... diff --git a/cpp/.traces/break_nested_degenerate b/cpp/.traces/break_nested_degenerate deleted file mode 100644 index 649afcdb..00000000 --- a/cpp/.traces/break_nested_degenerate +++ /dev/null @@ -1,23 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: break -parse/0: label: { -parse/0: label: } -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: 1000: push (open, 4) -brace/0: push (close, 5) -brace/0: push (close, 7) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump 3:offset -after-brace/0: copy ... diff --git a/cpp/.traces/break_nested_degenerate2 b/cpp/.traces/break_nested_degenerate2 deleted file mode 100644 index 46a5d360..00000000 --- a/cpp/.traces/break_nested_degenerate2 +++ /dev/null @@ -1,19 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: break -parse/0: label: { -parse/0: label: } -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: 1000: push (open, 4) -brace/0: push (close, 5) -brace/0: push (close, 6) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump 2:offset diff --git a/cpp/.traces/break_unless b/cpp/.traces/break_unless deleted file mode 100644 index 059b99ca..00000000 --- a/cpp/.traces/break_unless +++ /dev/null @@ -1,20 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: break-unless -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 2) -brace/0: push (close, 5) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump-unless 2, 1:offset -after-brace/0: copy ... diff --git a/cpp/.traces/buffer-append-works b/cpp/.traces/buffer-append-works deleted file mode 100644 index e60333a7..00000000 --- a/cpp/.traces/buffer-append-works +++ /dev/null @@ -1,1146 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:buffer <- init-buffer 3:literal - s1:address:array:character <- get x:address:buffer/deref, data:offset - x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' - x:address:buffer <- buffer-append x:address:buffer, 98:literal # 'b' - x:address:buffer <- buffer-append x:address:buffer, 99:literal # 'c' - s2:address:array:character <- get x:address:buffer/deref, data:offset - 1:boolean/raw <- equal s1:address:array:character, s2:address:array:character -#? $print s2:address:array:character -#? $print [ -#? ] -#? $print 1060:integer/raw -#? $print [ -#? ] -#? $print 1061:integer/raw -#? $print [ -#? ] -#? $print 1062:integer/raw -#? $print [ -#? ] -#? $print 1063:integer/raw -#? $print [ -#? ] -#? $print 1064:integer/raw -#? $print [ -#? ] -#? $print 1065:integer/raw -#? $print [ -#? ] - 2:array:character/raw <- copy s2:address:array:character/deref - +buffer-filled - x:address:buffer <- buffer-append x:address:buffer, 100:literal # 'd' - s3:address:array:character <- get x:address:buffer/deref, data:offset - 10:boolean/raw <- equal s1:address:array:character, s3:address:array:character - 11:integer/raw <- get x:address:buffer/deref, length:offset - 12:array:character/raw <- copy s3:address:array:character/deref - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:buffer <- init-buffer 3:literal - s1:address:array:character <- get x:address:buffer/deref, data:offset - x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' - x:address:buffer <- buffer-append x:address:buffer, 98:literal # 'b' - x:address:buffer <- buffer-append x:address:buffer, 99:literal # 'c' - s2:address:array:character <- get x:address:buffer/deref, data:offset - 1:boolean/raw <- equal s1:address:array:character, s2:address:array:character -#? $print s2:address:array:character -#? $print [ -#? ] -#? $print 1060:integer/raw -#? $print [ -#? ] -#? $print 1061:integer/raw -#? $print [ -#? ] -#? $print 1062:integer/raw -#? $print [ -#? ] -#? $print 1063:integer/raw -#? $print [ -#? ] -#? $print 1064:integer/raw -#? $print [ -#? ] -#? $print 1065:integer/raw -#? $print [ -#? ] - 2:array:character/raw <- copy s2:address:array:character/deref - +buffer-filled - x:address:buffer <- buffer-append x:address:buffer, 100:literal # 'd' - s3:address:array:character <- get x:address:buffer/deref, data:offset - 10:boolean/raw <- equal s1:address:array:character, s3:address:array:character - 11:integer/raw <- get x:address:buffer/deref, length:offset - 12:array:character/raw <- copy s3:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - # before +buffer-filled - 1 <- 1 # no change in data pointer - 2 <- 3 # size of data - 3 <- 97 # data - 4 <- 98 - 5 <- 99 - # in the end - 10 <- 0 # data pointer has grown - 11 <- 4 # final length - 12 <- 6 # but data's capacity has doubled - 13 <- 97 # data - 14 <- 98 - 15 <- 99 - 16 <- 100 - 17 <- 0 - 18 <- 0 - ", value: 0, type: 0, properties: [" - # before +buffer-filled - 1 <- 1 # no change in data pointer - 2 <- 3 # size of data - 3 <- 97 # data - 4 <- 98 - 5 <- 99 - # in the end - 10 <- 0 # data pointer has grown - 11 <- 4 # final length - 12 <- 6 # but data's capacity has doubled - 13 <- 97 # data - 14 <- 98 - 15 <- 99 - 16 <- 100 - 17 <- 0 - 18 <- 0 - ": "literal-string"]} -after-brace/0: recipe buffer-append-works -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: buffer-append-works -run/0: instruction buffer-append-works/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:buffer <- init-buffer 3:literal - s1:address:array:character <- get x:address:buffer/deref, data:offset - x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' - x:address:buffer <- buffer-append x:address:buffer, 98:literal # 'b' - x:address:buffer <- buffer-append x:address:buffer, 99:literal # 'c' - s2:address:array:character <- get x:address:buffer/deref, data:offset - 1:boolean/raw <- equal s1:address:array:character, s2:address:array:character -#? $print s2:address:array:character -#? $print [ -#? ] -#? $print 1060:integer/raw -#? $print [ -#? ] -#? $print 1061:integer/raw -#? $print [ -#? ] -#? $print 1062:integer/raw -#? $print [ -#? ] -#? $print 1063:integer/raw -#? $print [ -#? ] -#? $print 1064:integer/raw -#? $print [ -#? ] -#? $print 1065:integer/raw -#? $print [ -#? ] - 2:array:character/raw <- copy s2:address:array:character/deref - +buffer-filled - x:address:buffer <- buffer-append x:address:buffer, 100:literal # 'd' - s3:address:array:character <- get x:address:buffer/deref, data:offset - 10:boolean/raw <- equal s1:address:array:character, s3:address:array:character - 11:integer/raw <- get x:address:buffer/deref, length:offset - 12:array:character/raw <- copy s3:address:array:character/deref - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:buffer <- init-buffer 3:literal - s1:address:array:character <- get x:address:buffer/deref, data:offset - x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' - x:address:buffer <- buffer-append x:address:buffer, 98:literal # 'b' - x:address:buffer <- buffer-append x:address:buffer, 99:literal # 'c' - s2:address:array:character <- get x:address:buffer/deref, data:offset - 1:boolean/raw <- equal s1:address:array:character, s2:address:array:character -#? $print s2:address:array:character -#? $print [ -#? ] -#? $print 1060:integer/raw -#? $print [ -#? ] -#? $print 1061:integer/raw -#? $print [ -#? ] -#? $print 1062:integer/raw -#? $print [ -#? ] -#? $print 1063:integer/raw -#? $print [ -#? ] -#? $print 1064:integer/raw -#? $print [ -#? ] -#? $print 1065:integer/raw -#? $print [ -#? ] - 2:array:character/raw <- copy s2:address:array:character/deref - +buffer-filled - x:address:buffer <- buffer-append x:address:buffer, 100:literal # 'd' - s3:address:array:character <- get x:address:buffer/deref, data:offset - 10:boolean/raw <- equal s1:address:array:character, s3:address:array:character - 11:integer/raw <- get x:address:buffer/deref, length:offset - 12:array:character/raw <- copy s3:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: init-buffer -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer", "deref": ]} -parse/0: ingredient: {name: "data", value: 0, type: 0, properties: ["data": "offset"]} -parse/0: product: {name: "s1", value: 0, type: 2-5-4, properties: ["s1": "address":"array":"character"]} -parse/0: instruction: buffer-append -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: instruction: buffer-append -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: ingredient: {name: "98", value: 0, type: 0, properties: ["98": "literal"]} -parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: instruction: buffer-append -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: ingredient: {name: "99", value: 0, type: 0, properties: ["99": "literal"]} -parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer", "deref": ]} -parse/0: ingredient: {name: "data", value: 0, type: 0, properties: ["data": "offset"]} -parse/0: product: {name: "s2", value: 0, type: 2-5-4, properties: ["s2": "address":"array":"character"]} -parse/0: instruction: equal -parse/0: ingredient: {name: "s1", value: 0, type: 2-5-4, properties: ["s1": "address":"array":"character"]} -parse/0: ingredient: {name: "s2", value: 0, type: 2-5-4, properties: ["s2": "address":"array":"character"]} -parse/0: product: {name: "1", value: 0, type: 3, properties: ["1": "boolean", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "s2", value: 0, type: 2-5-4, properties: ["s2": "address":"array":"character", "deref": ]} -parse/0: product: {name: "2", value: 0, type: 5-4, properties: ["2": "array":"character", "raw": ]} -parse/0: label: +buffer-filled -parse/0: instruction: buffer-append -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: ingredient: {name: "100", value: 0, type: 0, properties: ["100": "literal"]} -parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer", "deref": ]} -parse/0: ingredient: {name: "data", value: 0, type: 0, properties: ["data": "offset"]} -parse/0: product: {name: "s3", value: 0, type: 2-5-4, properties: ["s3": "address":"array":"character"]} -parse/0: instruction: equal -parse/0: ingredient: {name: "s1", value: 0, type: 2-5-4, properties: ["s1": "address":"array":"character"]} -parse/0: ingredient: {name: "s3", value: 0, type: 2-5-4, properties: ["s3": "address":"array":"character"]} -parse/0: product: {name: "10", value: 0, type: 3, properties: ["10": "boolean", "raw": ]} -parse/0: instruction: get -parse/0: ingredient: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer", "deref": ]} -parse/0: ingredient: {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -parse/0: product: {name: "11", value: 0, type: 1, properties: ["11": "integer", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "s3", value: 0, type: 2-5-4, properties: ["s3": "address":"array":"character", "deref": ]} -parse/0: product: {name: "12", value: 0, type: 5-4, properties: ["12": "array":"character", "raw": ]} -new/0: location -> 1 -name/0: assign x 1 -name/0: element data of type buffer is at offset 1 -name/0: assign s1 2 -name/0: element data of type buffer is at offset 1 -name/0: assign s2 3 -name/0: element data of type buffer is at offset 1 -name/0: assign s3 4 -name/0: element length of type buffer is at offset 0 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: init-buffer ... -after-brace/0: get ... -after-brace/0: buffer-append ... -after-brace/0: buffer-append ... -after-brace/0: buffer-append ... -after-brace/0: get ... -after-brace/0: equal ... -after-brace/0: copy ... -after-brace/0: buffer-append ... -after-brace/0: get ... -after-brace/0: equal ... -after-brace/0: get ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- init-buffer/101 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: instruction init-buffer/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1031 -run/0: instruction init-buffer/1 -run/0: {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} <- new/44 {name: "buffer", value: 9, type: 0, properties: ["buffer": "type"]} -mem/0: new alloc: 1062 -mem/0: storing 1062 in location 1033 -run/0: instruction init-buffer/2 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1034 -run/0: instruction init-buffer/3 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1034 is 1062 -mem/0: storing 0 in location 1062 -run/0: instruction init-buffer/4 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: product 0 is 1063 -mem/0: storing 1063 in location 1035 -run/0: instruction init-buffer/5 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1036 -run/0: instruction init-buffer/6 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1036 is 3 -mem/0: array size is 3 -mem/0: new alloc: 1064 -mem/0: location 1035 is 1063 -mem/0: storing 1064 in location 1063 -run/0: instruction init-buffer/7 -run/0: reply/33 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} -mem/0: location 1033 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1002 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1003 -run/0: instruction run1001/3 -run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append/104 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 1002 is 1062 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1070 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1071 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1070 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1101 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1101 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1102 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1101 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1103 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1103 is 1064 -mem/0: storing 3 in location 1104 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1102 is 0 -run/0: ingredient 1 is capacity -mem/0: location 1104 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1105 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1105 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1072 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1072 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1070 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1073 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1070 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1074 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1074 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1073 is 1062 -mem/0: location 1062 is 0 -run/0: address to copy is 1065 -run/0: product 0 is 1065 -mem/0: storing 1065 in location 1075 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1071 is 97 -mem/0: location 1075 is 1065 -mem/0: storing 97 in location 1065 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1073 is 1062 -mem/0: location 1062 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1073 is 1062 -mem/0: storing 1 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1070 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1002 -run/0: instruction run1001/4 -run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append/104 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "98", value: 98, type: 0, properties: ["98": "literal"]} -mem/0: location 1002 is 1062 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1132 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 98 -mem/0: storing 98 in location 1133 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1132 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1161 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1163 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1163 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1164 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1163 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1165 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1165 is 1064 -mem/0: storing 3 in location 1166 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1164 is 1 -run/0: ingredient 1 is capacity -mem/0: location 1166 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1167 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1167 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1134 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1134 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1132 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1135 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1132 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1136 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1136 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1135 is 1062 -mem/0: location 1062 is 1 -run/0: address to copy is 1066 -run/0: product 0 is 1066 -mem/0: storing 1066 in location 1137 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1133 is 98 -mem/0: location 1137 is 1066 -mem/0: storing 98 in location 1066 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1135 is 1062 -mem/0: location 1062 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1135 is 1062 -mem/0: storing 2 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1132 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1002 -run/0: instruction run1001/5 -run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append/104 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "99", value: 99, type: 0, properties: ["99": "literal"]} -mem/0: location 1002 is 1062 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1192 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1194 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 99 -mem/0: storing 99 in location 1195 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1194 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1223 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1225 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1225 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 1226 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1225 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1227 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1227 is 1064 -mem/0: storing 3 in location 1228 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1226 is 2 -run/0: ingredient 1 is capacity -mem/0: location 1228 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1229 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1229 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1196 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1196 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1194 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1197 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1194 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1198 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1198 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1197 is 1062 -mem/0: location 1062 is 2 -run/0: address to copy is 1067 -run/0: product 0 is 1067 -mem/0: storing 1067 in location 1199 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1195 is 99 -mem/0: location 1199 is 1067 -mem/0: storing 99 in location 1067 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1197 is 1062 -mem/0: location 1062 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1197 is 1062 -mem/0: storing 3 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1194 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1002 -run/0: instruction run1001/6 -run/0: {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1002 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1004 -run/0: instruction run1001/7 -run/0: {name: "1", value: 1, type: 3, properties: ["1": "boolean", "raw": ]} <- equal/13 {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]}, {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character"]} -run/0: ingredient 0 is s1 -mem/0: location 1003 is 1064 -run/0: ingredient 1 is s2 -mem/0: location 1004 is 1064 -run/0: product 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction run1001/8 -run/0: {name: "2", value: 2, type: 5-4, properties: ["2": "array":"character", "raw": ]} <- copy/1 {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character", "deref": ]} -run/0: ingredient 0 is s2 -mem/0: location 1004 is 1064 -mem/0: location 1064 is 3 -mem/0: location 1065 is 97 -mem/0: location 1066 is 98 -mem/0: location 1067 is 99 -mem/0: storing 3 in location 2 -mem/0: storing 97 in location 3 -mem/0: storing 98 in location 4 -mem/0: storing 99 in location 5 -run/0: instruction run1001/10 -run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append/104 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "100", value: 100, type: 0, properties: ["100": "literal"]} -mem/0: location 1002 is 1062 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1254 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1256 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 100 -mem/0: storing 100 in location 1257 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1256 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1285 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1287 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1287 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1288 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1287 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1289 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1289 is 1064 -mem/0: storing 3 in location 1290 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1288 is 3 -run/0: ingredient 1 is capacity -mem/0: location 1290 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1291 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1291 is 1 -run/0: result 0 is 1 -mem/0: storing 1 in location 1258 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1258 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction buffer-append/6 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- grow-buffer/102 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1256 is 1062 -run/0: instruction grow-buffer/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1316 -run/0: instruction grow-buffer/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1318 -run/0: instruction grow-buffer/2 -run/0: {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1318 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: product 0 is 1063 -mem/0: storing 1063 in location 1319 -run/0: instruction grow-buffer/3 -run/0: {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]} <- length/28 {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": , "deref": ]} -mem/0: location 1319 is 1063 -mem/0: location 1063 is 1064 -mem/0: storing 3 in location 1320 -run/0: instruction grow-buffer/4 -run/0: {name: "newlen", value: 4, type: 1, properties: ["newlen": "integer"]} <- multiply/4 {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is oldlen -mem/0: location 1320 is 3 -run/0: ingredient 1 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 6 -mem/0: storing 6 in location 1321 -run/0: instruction grow-buffer/5 -run/0: {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character"]} <- copy/1 {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": ]} -run/0: ingredient 0 is x -mem/0: location 1319 is 1063 -mem/0: location 1063 is 1064 -mem/0: storing 1064 in location 1322 -run/0: instruction grow-buffer/6 -run/0: {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "newlen", value: 4, type: 1, properties: ["newlen": "integer"]} -mem/0: location 1321 is 6 -mem/0: array size is 6 -mem/0: new alloc: 1347 -mem/0: location 1319 is 1063 -mem/0: storing 1347 in location 1063 -run/0: instruction grow-buffer/7 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1323 -run/0: instruction grow-buffer/9 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 0 -run/0: ingredient 1 is oldlen -mem/0: location 1320 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1324 -run/0: instruction grow-buffer/10 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1324 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction grow-buffer/11 -run/0: {name: "src", value: 8, type: 4, properties: ["src": "character"]} <- index/26 {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]} -mem/0: location 1322 is 1064 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 0 -run/0: address to copy is 1065 -run/0: its type is 4 -mem/0: location 1065 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1325 -run/0: instruction grow-buffer/12 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": , "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is x -mem/0: location 1319 is 1063 -mem/0: location 1063 is 1347 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 0 -run/0: address to copy is 1348 -run/0: product 0 is 1348 -mem/0: storing 1348 in location 1326 -run/0: instruction grow-buffer/13 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 8, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1325 is 97 -mem/0: location 1326 is 1348 -mem/0: storing 97 in location 1348 -run/0: instruction grow-buffer/14 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1323 -run/0: instruction grow-buffer/15 -run/0: loop/10 {name: "", value: -7, type: , properties: ["": ]} -run/0: ingredient 0 is -7 -run/0: jumping to instruction 9 -run/0: instruction grow-buffer/9 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 1 -run/0: ingredient 1 is oldlen -mem/0: location 1320 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1324 -run/0: instruction grow-buffer/10 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1324 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction grow-buffer/11 -run/0: {name: "src", value: 8, type: 4, properties: ["src": "character"]} <- index/26 {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]} -mem/0: location 1322 is 1064 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 1 -run/0: address to copy is 1066 -run/0: its type is 4 -mem/0: location 1066 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1325 -run/0: instruction grow-buffer/12 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": , "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is x -mem/0: location 1319 is 1063 -mem/0: location 1063 is 1347 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 1 -run/0: address to copy is 1349 -run/0: product 0 is 1349 -mem/0: storing 1349 in location 1326 -run/0: instruction grow-buffer/13 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 8, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1325 is 98 -mem/0: location 1326 is 1349 -mem/0: storing 98 in location 1349 -run/0: instruction grow-buffer/14 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1323 -run/0: instruction grow-buffer/15 -run/0: loop/10 {name: "", value: -7, type: , properties: ["": ]} -run/0: ingredient 0 is -7 -run/0: jumping to instruction 9 -run/0: instruction grow-buffer/9 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 2 -run/0: ingredient 1 is oldlen -mem/0: location 1320 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1324 -run/0: instruction grow-buffer/10 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1324 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction grow-buffer/11 -run/0: {name: "src", value: 8, type: 4, properties: ["src": "character"]} <- index/26 {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "olddata", value: 5, type: 2-5-4, properties: ["olddata": "address":"array":"character", "deref": ]} -mem/0: location 1322 is 1064 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 2 -run/0: address to copy is 1067 -run/0: its type is 4 -mem/0: location 1067 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1325 -run/0: instruction grow-buffer/12 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "x", value: 2, type: 2-2-5-4, properties: ["x": "address":"address":"array":"character", "deref": , "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is x -mem/0: location 1319 is 1063 -mem/0: location 1063 is 1347 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1323 is 2 -run/0: address to copy is 1350 -run/0: product 0 is 1350 -mem/0: storing 1350 in location 1326 -run/0: instruction grow-buffer/13 -run/0: {name: "dest", value: 9, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 8, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1325 is 99 -mem/0: location 1326 is 1350 -mem/0: storing 99 in location 1350 -run/0: instruction grow-buffer/14 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1323 -run/0: instruction grow-buffer/15 -run/0: loop/10 {name: "", value: -7, type: , properties: ["": ]} -run/0: ingredient 0 is -7 -run/0: jumping to instruction 9 -run/0: instruction grow-buffer/9 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "oldlen", value: 3, type: 1, properties: ["oldlen": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1323 is 3 -run/0: ingredient 1 is oldlen -mem/0: location 1320 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1324 -run/0: instruction grow-buffer/10 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1324 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 16 -run/0: instruction grow-buffer/17 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1318 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1256 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1256 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1259 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1256 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1347 -run/0: product 0 is 1347 -mem/0: storing 1347 in location 1260 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1260 is 1347 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1259 is 1062 -mem/0: location 1062 is 3 -run/0: address to copy is 1351 -run/0: product 0 is 1351 -mem/0: storing 1351 in location 1261 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1257 is 100 -mem/0: location 1261 is 1351 -mem/0: storing 100 in location 1351 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1259 is 1062 -mem/0: location 1062 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: location 1259 is 1062 -mem/0: storing 4 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1256 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1002 -run/0: instruction run1001/11 -run/0: {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1002 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1347 -run/0: product 0 is 1347 -mem/0: storing 1347 in location 1005 -run/0: instruction run1001/12 -run/0: {name: "10", value: 10, type: 3, properties: ["10": "boolean", "raw": ]} <- equal/13 {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]}, {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character"]} -run/0: ingredient 0 is s1 -mem/0: location 1003 is 1064 -run/0: ingredient 1 is s3 -mem/0: location 1005 is 1347 -run/0: product 0 is 0 -mem/0: storing 0 in location 10 -run/0: instruction run1001/13 -run/0: {name: "11", value: 11, type: 1, properties: ["11": "integer", "raw": ]} <- get/24 {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1002 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 4 -run/0: product 0 is 4 -mem/0: storing 4 in location 11 -run/0: instruction run1001/14 -run/0: {name: "12", value: 12, type: 5-4, properties: ["12": "array":"character", "raw": ]} <- copy/1 {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character", "deref": ]} -run/0: ingredient 0 is s3 -mem/0: location 1005 is 1347 -mem/0: location 1347 is 6 -mem/0: location 1348 is 97 -mem/0: location 1349 is 98 -mem/0: location 1350 is 99 -mem/0: location 1351 is 100 -mem/0: location 1352 is 0 -mem/0: location 1353 is 0 -mem/0: storing 6 in location 12 -mem/0: storing 97 in location 13 -mem/0: storing 98 in location 14 -mem/0: storing 99 in location 15 -mem/0: storing 100 in location 16 -mem/0: storing 0 in location 17 -mem/0: storing 0 in location 18 -run/0: instruction buffer-append-works/1 -run/0: memory-should-contain/46 {name: " - # before +buffer-filled - 1 <- 1 # no change in data pointer - 2 <- 3 # size of data - 3 <- 97 # data - 4 <- 98 - 5 <- 99 - # in the end - 10 <- 0 # data pointer has grown - 11 <- 4 # final length - 12 <- 6 # but data's capacity has doubled - 13 <- 97 # data - 14 <- 98 - 15 <- 99 - 16 <- 100 - 17 <- 0 - 18 <- 0 - ", value: 0, type: 0, properties: [" - # before +buffer-filled - 1 <- 1 # no change in data pointer - 2 <- 3 # size of data - 3 <- 97 # data - 4 <- 98 - 5 <- 99 - # in the end - 10 <- 0 # data pointer has grown - 11 <- 4 # final length - 12 <- 6 # but data's capacity has doubled - 13 <- 97 # data - 14 <- 98 - 15 <- 99 - 16 <- 100 - 17 <- 0 - 18 <- 0 - ": "literal-string"]} -run/0: checking location 1 -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 -run/0: checking location 10 -run/0: checking location 11 -run/0: checking location 12 -run/0: checking location 13 -run/0: checking location 14 -run/0: checking location 15 -run/0: checking location 16 -run/0: checking location 17 -run/0: checking location 18 diff --git a/cpp/.traces/calling_recipe b/cpp/.traces/calling_recipe deleted file mode 100644 index a7a66682..00000000 --- a/cpp/.traces/calling_recipe +++ /dev/null @@ -1,19 +0,0 @@ -parse/0: instruction: f -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: add ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 -run/0: instruction f/0 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 3 diff --git a/cpp/.traces/channel b/cpp/.traces/channel deleted file mode 100644 index 1e3128c7..00000000 --- a/cpp/.traces/channel +++ /dev/null @@ -1,430 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer, 1:address:channel <- read 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer, 1:address:channel <- read 1:address:channel - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 34 - ", value: 0, type: 0, properties: [" - 2 <- 34 - ": "literal-string"]} -after-brace/0: recipe channel -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel -run/0: instruction channel/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer, 1:address:channel <- read 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer, 1:address:channel <- read 1:address:channel - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: read -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: read ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1042 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1041 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1070 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1072 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1073 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1072 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1101 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1103 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1103 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1104 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1104 is 1034 -mem/0: storing 4 in location 1105 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1105 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1074 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 1 -run/0: ingredient 1 is len -mem/0: location 1074 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1075 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1076 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1076 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1073 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1077 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1077 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1045 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1046 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1045 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1047 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1042 is 34 -mem/0: location 1047 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1046 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1045 is 1034 -mem/0: storing 4 in location 1048 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1048 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1041 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]}, {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- read/111 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction read/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1132 -run/0: instruction read/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1134 -run/0: instruction read/3 -run/0: {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]} <- channel-empty?/112 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1134 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1163 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1165 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1166 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1167 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1166 is 0 -run/0: ingredient 1 is free -mem/0: location 1167 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1168 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1168 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1135 -run/0: instruction read/4 -run/0: break-unless/12 {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1135 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction read/8 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1137 -run/0: instruction read/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1138 -run/0: instruction read/10 -run/0: {name: "result", value: 6, type: 1, properties: ["result": "location"]} <- index/26 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1138 is 1034 -run/0: ingredient 1 is {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -mem/0: location 1137 is 1031 -mem/0: location 1031 is 0 -run/0: address to copy is 1035 -run/0: its type is 1 -mem/0: location 1035 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 1139 -run/0: instruction read/11 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- add/2 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is full -mem/0: location 1137 is 1031 -mem/0: location 1031 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1137 is 1031 -mem/0: storing 1 in location 1031 -run/0: instruction read/13 -run/0: {name: "len", value: 7, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1138 is 1034 -mem/0: storing 4 in location 1140 -run/0: instruction read/14 -run/0: {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "len", value: 7, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1137 is 1031 -mem/0: location 1031 is 1 -run/0: ingredient 1 is len -mem/0: location 1140 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1141 -run/0: instruction read/15 -run/0: break-unless/12 {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1141 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 17 -run/0: instruction read/18 -run/0: reply/33 {name: "result", value: 6, type: 1, properties: ["result": "location"]}, {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1139 is 34 -mem/0: location 1134 is 1031 -run/0: result 0 is 34 -mem/0: storing 34 in location 2 -run/0: result 1 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction channel/1 -run/0: memory-should-contain/46 {name: " - 2 <- 34 - ", value: 0, type: 0, properties: [" - 2 <- 34 - ": "literal-string"]} -run/0: checking location 2 diff --git a/cpp/.traces/channel-initialization b/cpp/.traces/channel-initialization deleted file mode 100644 index cb6d3026..00000000 --- a/cpp/.traces/channel-initialization +++ /dev/null @@ -1,147 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 0 # first-full - 3 <- 0 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 0 # first-full - 3 <- 0 # first-free - ": "literal-string"]} -after-brace/0: recipe channel-initialization -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-initialization -run/0: instruction channel-initialization/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -name/0: element first-full of type channel is at offset 0 -name/0: element first-free of type channel is at offset 1 -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: get ... -after-brace/0: get ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction channel-initialization/1 -run/0: memory-should-contain/46 {name: " - 2 <- 0 # first-full - 3 <- 0 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 0 # first-full - 3 <- 0 # first-free - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-new-empty-not-full b/cpp/.traces/channel-new-empty-not-full deleted file mode 100644 index e0a165c2..00000000 --- a/cpp/.traces/channel-new-empty-not-full +++ /dev/null @@ -1,262 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 1 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 1 # empty? - 3 <- 0 # full? - ": "literal-string"]} -after-brace/0: recipe channel-new-empty-not-full -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-new-empty-not-full -run/0: instruction channel-new-empty-not-full/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: channel-empty? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: channel-full? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: channel-empty? ... -after-brace/0: channel-full? ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- channel-empty?/112 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1042 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1042 is 0 -run/0: ingredient 1 is free -mem/0: location 1043 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1044 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1044 is 1 -run/0: result 0 is 1 -mem/0: storing 1 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- channel-full?/110 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1070 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1072 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1073 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1072 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1101 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1103 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1103 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1104 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1104 is 1034 -mem/0: storing 4 in location 1105 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1105 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1074 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 1 -run/0: ingredient 1 is len -mem/0: location 1074 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1075 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1076 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1076 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1073 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1077 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1077 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction channel-new-empty-not-full/1 -run/0: memory-should-contain/46 {name: " - 2 <- 1 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 1 # empty? - 3 <- 0 # full? - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-read-increments-full b/cpp/.traces/channel-read-increments-full deleted file mode 100644 index 61cc50a4..00000000 --- a/cpp/.traces/channel-read-increments-full +++ /dev/null @@ -1,474 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 1 # first-full - 3 <- 1 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 1 # first-full - 3 <- 1 # first-free - ": "literal-string"]} -after-brace/0: recipe channel-read-increments-full -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-read-increments-full -run/0: instruction channel-read-increments-full/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: read -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -name/0: element first-full of type channel is at offset 0 -name/0: element first-free of type channel is at offset 1 -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: read ... -after-brace/0: get ... -after-brace/0: get ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1042 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1041 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1070 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1072 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1073 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1072 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1101 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1103 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1103 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1104 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1104 is 1034 -mem/0: storing 4 in location 1105 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1105 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1074 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 1 -run/0: ingredient 1 is len -mem/0: location 1074 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1075 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1076 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1076 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1073 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1077 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1077 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1045 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1046 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1045 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1047 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1042 is 34 -mem/0: location 1047 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1046 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1045 is 1034 -mem/0: storing 4 in location 1048 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1048 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1041 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- read/111 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction read/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1132 -run/0: instruction read/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1134 -run/0: instruction read/3 -run/0: {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]} <- channel-empty?/112 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1134 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1163 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1165 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1166 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1167 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1166 is 0 -run/0: ingredient 1 is free -mem/0: location 1167 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1168 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1168 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1135 -run/0: instruction read/4 -run/0: break-unless/12 {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1135 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction read/8 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1137 -run/0: instruction read/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1138 -run/0: instruction read/10 -run/0: {name: "result", value: 6, type: 1, properties: ["result": "location"]} <- index/26 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1138 is 1034 -run/0: ingredient 1 is {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -mem/0: location 1137 is 1031 -mem/0: location 1031 is 0 -run/0: address to copy is 1035 -run/0: its type is 1 -mem/0: location 1035 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 1139 -run/0: instruction read/11 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- add/2 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is full -mem/0: location 1137 is 1031 -mem/0: location 1031 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1137 is 1031 -mem/0: storing 1 in location 1031 -run/0: instruction read/13 -run/0: {name: "len", value: 7, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1138 is 1034 -mem/0: storing 4 in location 1140 -run/0: instruction read/14 -run/0: {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "len", value: 7, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1137 is 1031 -mem/0: location 1031 is 1 -run/0: ingredient 1 is len -mem/0: location 1140 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1141 -run/0: instruction read/15 -run/0: break-unless/12 {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1141 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 17 -run/0: instruction read/18 -run/0: reply/33 {name: "result", value: 6, type: 1, properties: ["result": "location"]}, {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1139 is 34 -mem/0: location 1134 is 1031 -run/0: result 0 is 34 -run/0: result 1 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/3 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 2 -run/0: instruction run1001/4 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction channel-read-increments-full/1 -run/0: memory-should-contain/46 {name: " - 2 <- 1 # first-full - 3 <- 1 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 1 # first-full - 3 <- 1 # first-free - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-read-not-full b/cpp/.traces/channel-read-not-full deleted file mode 100644 index 4d9e19b2..00000000 --- a/cpp/.traces/channel-read-not-full +++ /dev/null @@ -1,592 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 1 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 1 # empty? - 3 <- 0 # full? - ": "literal-string"]} -after-brace/0: recipe channel-read-not-full -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-read-not-full -run/0: instruction channel-read-not-full/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: read -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: channel-empty? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: channel-full? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: read ... -after-brace/0: channel-empty? ... -after-brace/0: channel-full? ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "1", value: 1, type: 0, properties: ["1": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 1 -mem/0: storing 1 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 2 -mem/0: array size is 2 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1039 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1040 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1039 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1070 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1071 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1071 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1070 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1101 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1101 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1102 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1102 is 1034 -mem/0: storing 2 in location 1103 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1103 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1072 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 1 -run/0: ingredient 1 is len -mem/0: location 1072 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1073 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1074 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1074 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1071 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1075 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1041 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1041 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1043 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1044 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1043 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1045 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1040 is 34 -mem/0: location 1045 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1044 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1043 is 1034 -mem/0: storing 2 in location 1046 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1046 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1039 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- read/111 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction read/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction read/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1132 -run/0: instruction read/3 -run/0: {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]} <- channel-empty?/112 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1132 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1161 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1163 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1164 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1165 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1164 is 0 -run/0: ingredient 1 is free -mem/0: location 1165 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1166 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1166 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1133 -run/0: instruction read/4 -run/0: break-unless/12 {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1133 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction read/8 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1135 -run/0: instruction read/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1136 -run/0: instruction read/10 -run/0: {name: "result", value: 6, type: 1, properties: ["result": "location"]} <- index/26 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1136 is 1034 -run/0: ingredient 1 is {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -mem/0: location 1135 is 1031 -mem/0: location 1031 is 0 -run/0: address to copy is 1035 -run/0: its type is 1 -mem/0: location 1035 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 1137 -run/0: instruction read/11 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- add/2 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is full -mem/0: location 1135 is 1031 -mem/0: location 1031 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1135 is 1031 -mem/0: storing 1 in location 1031 -run/0: instruction read/13 -run/0: {name: "len", value: 7, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1136 is 1034 -mem/0: storing 2 in location 1138 -run/0: instruction read/14 -run/0: {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "len", value: 7, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1135 is 1031 -mem/0: location 1031 is 1 -run/0: ingredient 1 is len -mem/0: location 1138 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1139 -run/0: instruction read/15 -run/0: break-unless/12 {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1139 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 17 -run/0: instruction read/18 -run/0: reply/33 {name: "result", value: 6, type: 1, properties: ["result": "location"]}, {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1137 is 34 -mem/0: location 1132 is 1031 -run/0: result 0 is 34 -run/0: result 1 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/3 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- channel-empty?/112 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1192 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1194 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1194 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1195 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1194 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1196 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1195 is 1 -run/0: ingredient 1 is free -mem/0: location 1196 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1197 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1197 is 1 -run/0: result 0 is 1 -mem/0: storing 1 in location 2 -run/0: instruction run1001/4 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- channel-full?/110 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1223 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1225 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1225 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1226 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1226 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1226 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1225 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1254 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1256 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1256 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1257 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1257 is 1034 -mem/0: storing 2 in location 1258 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1258 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1227 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1226 is 2 -run/0: ingredient 1 is len -mem/0: location 1227 is 2 -run/0: product 0 is 1 -mem/0: storing 1 in location 1228 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1228 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction channel-full?/8 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1226 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1225 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1229 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1229 is 1 -run/0: ingredient 1 is tmp -mem/0: location 1226 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1230 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1230 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction channel-read-not-full/1 -run/0: memory-should-contain/46 {name: " - 2 <- 1 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 1 # empty? - 3 <- 0 # full? - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-wrap b/cpp/.traces/channel-wrap deleted file mode 100644 index 935f3955..00000000 --- a/cpp/.traces/channel-wrap +++ /dev/null @@ -1,882 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity - # write and read a value - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - # first-free will now be 1 - 2:integer <- get 1:address:channel/deref, first-free:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - # write second value, verify that first-free wraps - 1:address:channel <- write 1:address:channel, 34:literal - 4:integer <- get 1:address:channel/deref, first-free:offset - # read second value, verify that first-full wraps - _, 1:address:channel <- read 1:address:channel - 5:integer <- get 1:address:channel/deref, first-full:offset - ", value: 0, type: 0, properties: [" - # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity - # write and read a value - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - # first-free will now be 1 - 2:integer <- get 1:address:channel/deref, first-free:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - # write second value, verify that first-free wraps - 1:address:channel <- write 1:address:channel, 34:literal - 4:integer <- get 1:address:channel/deref, first-free:offset - # read second value, verify that first-full wraps - _, 1:address:channel <- read 1:address:channel - 5:integer <- get 1:address:channel/deref, first-full:offset - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 1 # first-free after first write - 3 <- 1 # first-full after first read - 4 <- 0 # first-free after second write, wrapped - 5 <- 0 # first-full after second read, wrapped - ", value: 0, type: 0, properties: [" - 2 <- 1 # first-free after first write - 3 <- 1 # first-full after first read - 4 <- 0 # first-free after second write, wrapped - 5 <- 0 # first-full after second read, wrapped - ": "literal-string"]} -after-brace/0: recipe channel-wrap -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-wrap -run/0: instruction channel-wrap/0 -run/0: run/45 {name: " - # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity - # write and read a value - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - # first-free will now be 1 - 2:integer <- get 1:address:channel/deref, first-free:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - # write second value, verify that first-free wraps - 1:address:channel <- write 1:address:channel, 34:literal - 4:integer <- get 1:address:channel/deref, first-free:offset - # read second value, verify that first-full wraps - _, 1:address:channel <- read 1:address:channel - 5:integer <- get 1:address:channel/deref, first-full:offset - ", value: 0, type: 0, properties: [" - # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity - # write and read a value - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - # first-free will now be 1 - 2:integer <- get 1:address:channel/deref, first-free:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - # write second value, verify that first-free wraps - 1:address:channel <- write 1:address:channel, 34:literal - 4:integer <- get 1:address:channel/deref, first-free:offset - # read second value, verify that first-full wraps - _, 1:address:channel <- read 1:address:channel - 5:integer <- get 1:address:channel/deref, first-full:offset - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: read -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: read -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -name/0: element first-free of type channel is at offset 1 -name/0: element first-free of type channel is at offset 1 -name/0: element first-free of type channel is at offset 1 -name/0: element first-full of type channel is at offset 0 -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: read ... -after-brace/0: get ... -after-brace/0: get ... -after-brace/0: write ... -after-brace/0: get ... -after-brace/0: read ... -after-brace/0: get ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "1", value: 1, type: 0, properties: ["1": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 1 -mem/0: storing 1 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 2 -mem/0: array size is 2 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1039 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1040 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1039 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1070 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1071 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1071 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1070 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1101 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1101 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1102 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1102 is 1034 -mem/0: storing 2 in location 1103 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1103 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1072 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 1 -run/0: ingredient 1 is len -mem/0: location 1072 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1073 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1074 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1074 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1071 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1075 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1041 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1041 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1043 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1044 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1043 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1045 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1040 is 34 -mem/0: location 1045 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1044 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1043 is 1034 -mem/0: storing 2 in location 1046 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1046 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1039 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- read/111 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction read/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction read/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1132 -run/0: instruction read/3 -run/0: {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]} <- channel-empty?/112 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1132 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1161 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1163 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1164 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1165 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1164 is 0 -run/0: ingredient 1 is free -mem/0: location 1165 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1166 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1166 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1133 -run/0: instruction read/4 -run/0: break-unless/12 {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1133 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction read/8 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1135 -run/0: instruction read/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1136 -run/0: instruction read/10 -run/0: {name: "result", value: 6, type: 1, properties: ["result": "location"]} <- index/26 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1136 is 1034 -run/0: ingredient 1 is {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -mem/0: location 1135 is 1031 -mem/0: location 1031 is 0 -run/0: address to copy is 1035 -run/0: its type is 1 -mem/0: location 1035 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 1137 -run/0: instruction read/11 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- add/2 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is full -mem/0: location 1135 is 1031 -mem/0: location 1031 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1135 is 1031 -mem/0: storing 1 in location 1031 -run/0: instruction read/13 -run/0: {name: "len", value: 7, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1136 is 1034 -mem/0: storing 2 in location 1138 -run/0: instruction read/14 -run/0: {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "len", value: 7, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1135 is 1031 -mem/0: location 1031 is 1 -run/0: ingredient 1 is len -mem/0: location 1138 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1139 -run/0: instruction read/15 -run/0: break-unless/12 {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1139 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 17 -run/0: instruction read/18 -run/0: reply/33 {name: "result", value: 6, type: 1, properties: ["result": "location"]}, {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1137 is 34 -mem/0: location 1132 is 1031 -run/0: result 0 is 34 -run/0: result 1 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/3 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 2 -run/0: instruction run1001/4 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction run1001/5 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1192 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1194 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1195 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1194 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1223 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1225 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1225 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1226 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1226 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1226 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1225 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1254 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1256 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1256 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1257 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1257 is 1034 -mem/0: storing 2 in location 1258 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1258 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1227 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1226 is 2 -run/0: ingredient 1 is len -mem/0: location 1227 is 2 -run/0: product 0 is 1 -mem/0: storing 1 in location 1228 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1228 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction channel-full?/8 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1226 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1225 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1229 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1229 is 1 -run/0: ingredient 1 is tmp -mem/0: location 1226 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1230 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1230 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1196 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1196 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1194 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1198 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1194 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1199 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1198 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1199 is 1032 -mem/0: location 1032 is 1 -run/0: address to copy is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1200 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1195 is 34 -mem/0: location 1200 is 1036 -mem/0: storing 34 in location 1036 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1199 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1199 is 1032 -mem/0: storing 2 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1198 is 1034 -mem/0: storing 2 in location 1201 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1199 is 1032 -mem/0: location 1032 is 2 -run/0: ingredient 1 is len -mem/0: location 1201 is 2 -run/0: product 0 is 1 -mem/0: storing 1 in location 1202 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1202 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction write/18 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1199 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1194 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/6 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 4 -run/0: instruction run1001/7 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- read/111 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction read/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1285 -run/0: instruction read/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1287 -run/0: instruction read/3 -run/0: {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]} <- channel-empty?/112 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1287 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1316 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1318 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1318 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1319 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1318 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1320 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1319 is 1 -run/0: ingredient 1 is free -mem/0: location 1320 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1321 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1321 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1288 -run/0: instruction read/4 -run/0: break-unless/12 {name: "empty", value: 2, type: 3, properties: ["empty": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1288 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction read/8 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1287 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1290 -run/0: instruction read/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1287 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1291 -run/0: instruction read/10 -run/0: {name: "result", value: 6, type: 1, properties: ["result": "location"]} <- index/26 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1291 is 1034 -run/0: ingredient 1 is {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} -mem/0: location 1290 is 1031 -mem/0: location 1031 is 1 -run/0: address to copy is 1036 -run/0: its type is 1 -mem/0: location 1036 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 1292 -run/0: instruction read/11 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- add/2 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is full -mem/0: location 1290 is 1031 -mem/0: location 1031 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1290 is 1031 -mem/0: storing 2 in location 1031 -run/0: instruction read/13 -run/0: {name: "len", value: 7, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1291 is 1034 -mem/0: storing 2 in location 1293 -run/0: instruction read/14 -run/0: {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]}, {name: "len", value: 7, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1290 is 1031 -mem/0: location 1031 is 2 -run/0: ingredient 1 is len -mem/0: location 1293 is 2 -run/0: product 0 is 1 -mem/0: storing 1 in location 1294 -run/0: instruction read/15 -run/0: break-unless/12 {name: "at-end?", value: 8, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1294 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction read/16 -run/0: {name: "full", value: 4, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1290 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction read/18 -run/0: reply/33 {name: "result", value: 6, type: 1, properties: ["result": "location"]}, {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1292 is 34 -mem/0: location 1287 is 1031 -run/0: result 0 is 34 -run/0: result 1 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/8 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 5 -run/0: instruction channel-wrap/1 -run/0: memory-should-contain/46 {name: " - 2 <- 1 # first-free after first write - 3 <- 1 # first-full after first read - 4 <- 0 # first-free after second write, wrapped - 5 <- 0 # first-full after second read, wrapped - ", value: 0, type: 0, properties: [" - 2 <- 1 # first-free after first write - 3 <- 1 # first-full after first read - 4 <- 0 # first-free after second write, wrapped - 5 <- 0 # first-full after second read, wrapped - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 diff --git a/cpp/.traces/channel-write-full b/cpp/.traces/channel-write-full deleted file mode 100644 index d91949f4..00000000 --- a/cpp/.traces/channel-write-full +++ /dev/null @@ -1,457 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 0 # empty? - 3 <- 1 # full? - ", value: 0, type: 0, properties: [" - 2 <- 0 # empty? - 3 <- 1 # full? - ": "literal-string"]} -after-brace/0: recipe channel-write-full -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-write-full -run/0: instruction channel-write-full/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: channel-empty? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: channel-full? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: channel-empty? ... -after-brace/0: channel-full? ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "1", value: 1, type: 0, properties: ["1": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 1 -mem/0: storing 1 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 2 -mem/0: array size is 2 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1039 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1040 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1039 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1070 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1071 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1071 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1070 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1101 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1101 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1102 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1102 is 1034 -mem/0: storing 2 in location 1103 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1103 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1072 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1071 is 1 -run/0: ingredient 1 is len -mem/0: location 1072 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1073 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1070 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1074 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1074 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1071 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1075 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1041 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1041 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1043 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1039 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1044 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1043 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1045 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1040 is 34 -mem/0: location 1045 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1044 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1043 is 1034 -mem/0: storing 2 in location 1046 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1044 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1046 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1039 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- channel-empty?/112 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1132 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1133 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1132 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1134 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1133 is 0 -run/0: ingredient 1 is free -mem/0: location 1134 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1135 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1135 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- channel-full?/110 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1161 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1163 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1164 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1164 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1164 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1163 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1192 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1194 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1194 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1195 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1195 is 1034 -mem/0: storing 2 in location 1196 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1196 is 2 -run/0: result 0 is 2 -mem/0: storing 2 in location 1165 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1164 is 2 -run/0: ingredient 1 is len -mem/0: location 1165 is 2 -run/0: product 0 is 1 -mem/0: storing 1 in location 1166 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1166 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction channel-full?/8 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1164 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1163 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1167 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1167 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1164 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1168 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1168 is 1 -run/0: result 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction channel-write-full/1 -run/0: memory-should-contain/46 {name: " - 2 <- 0 # empty? - 3 <- 1 # full? - ", value: 0, type: 0, properties: [" - 2 <- 0 # empty? - 3 <- 1 # full? - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-write-increments-free b/cpp/.traces/channel-write-increments-free deleted file mode 100644 index aa3aa317..00000000 --- a/cpp/.traces/channel-write-increments-free +++ /dev/null @@ -1,339 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 0 # first-full - 3 <- 1 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 0 # first-full - 3 <- 1 # first-free - ": "literal-string"]} -after-brace/0: recipe channel-write-increments-free -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-write-increments-free -run/0: instruction channel-write-increments-free/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel", "deref": ]} -parse/0: ingredient: {name: "first-free", value: 0, type: 0, properties: ["first-free": "offset"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -name/0: element first-full of type channel is at offset 0 -name/0: element first-free of type channel is at offset 1 -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: get ... -after-brace/0: get ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1042 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1041 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1070 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1072 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1073 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1072 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1101 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1103 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1103 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1104 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1104 is 1034 -mem/0: storing 4 in location 1105 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1105 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1074 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 1 -run/0: ingredient 1 is len -mem/0: location 1074 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1075 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1076 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1076 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1073 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1077 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1077 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1045 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1046 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1045 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1047 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1042 is 34 -mem/0: location 1047 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1046 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1045 is 1034 -mem/0: storing 4 in location 1048 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1048 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1041 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- get/24 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction channel-write-increments-free/1 -run/0: memory-should-contain/46 {name: " - 2 <- 0 # first-full - 3 <- 1 # first-free - ", value: 0, type: 0, properties: [" - 2 <- 0 # first-full - 3 <- 1 # first-free - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/channel-write-not-empty b/cpp/.traces/channel-write-not-empty deleted file mode 100644 index 47b4f426..00000000 --- a/cpp/.traces/channel-write-not-empty +++ /dev/null @@ -1,454 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 0 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 0 # empty? - 3 <- 0 # full? - ": "literal-string"]} -after-brace/0: recipe channel-write-not-empty -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: channel-write-not-empty -run/0: instruction channel-write-not-empty/0 -run/0: run/45 {name: " - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ", value: 0, type: 0, properties: [" - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ": "literal-string"]} -parse/0: instruction: init-channel -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "capacity": ]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: write -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: instruction: channel-empty? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: channel-full? -parse/0: ingredient: {name: "1", value: 0, type: 2-10, properties: ["1": "address":"channel"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: init-channel ... -after-brace/0: write ... -after-brace/0: channel-empty? ... -after-brace/0: channel-full? ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- init-channel/108 {name: "3", value: 3, type: 0, properties: ["3": "literal", "capacity": ]} -run/0: instruction init-channel/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-channel/1 -run/0: {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} <- new/44 {name: "channel", value: 10, type: 0, properties: ["channel": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-channel/2 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1003 -run/0: instruction init-channel/3 -run/0: {name: "full", value: 2, type: 2-1, properties: ["full": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1003 is 1031 -mem/0: storing 0 in location 1031 -run/0: instruction init-channel/4 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1004 -run/0: instruction init-channel/5 -run/0: {name: "free", value: 3, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1004 is 1032 -mem/0: storing 0 in location 1032 -run/0: instruction init-channel/6 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1005 -run/0: instruction init-channel/7 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- add/2 {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is capacity -mem/0: location 1005 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1005 -run/0: instruction init-channel/8 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location"]} <- get-address/25 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1006 -run/0: instruction init-channel/9 -run/0: {name: "dest", value: 5, type: 2-2-5-1, properties: ["dest": "address":"address":"array":"location", "deref": ]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1005 is 4 -mem/0: array size is 4 -mem/0: new alloc: 1034 -mem/0: location 1006 is 1033 -mem/0: storing 1034 in location 1033 -run/0: instruction init-channel/10 -run/0: reply/33 {name: "result", value: 1, type: 2-10, properties: ["result": "address":"channel"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} <- write/109 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]}, {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction write/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction write/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction write/2 -run/0: {name: "val", value: 2, type: 1, properties: ["val": "location"]} <- next-ingredient/30 -run/0: product 0 is 34 -mem/0: storing 34 in location 1042 -run/0: instruction write/4 -run/0: {name: "full", value: 3, type: 3, properties: ["full": "boolean"]} <- channel-full?/110 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1041 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1070 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1072 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1073 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1073 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1072 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1101 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1103 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1103 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1104 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1104 is 1034 -mem/0: storing 4 in location 1105 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1105 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1074 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1073 is 1 -run/0: ingredient 1 is len -mem/0: location 1074 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1075 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1075 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1072 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1076 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1076 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1073 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1077 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1077 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction write/5 -run/0: break-unless/12 {name: "full", value: 3, type: 3, properties: ["full": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 8 -run/0: instruction write/9 -run/0: {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1045 -run/0: instruction write/10 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer"]} <- get-address/25 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1041 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1046 -run/0: instruction write/11 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location"]} <- index-address/27 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]}, {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -run/0: ingredient 0 is circular-buffer -mem/0: location 1045 is 1034 -run/0: ingredient 1 is {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1047 -run/0: instruction write/12 -run/0: {name: "dest", value: 7, type: 2-1, properties: ["dest": "address":"location", "deref": ]} <- copy/1 {name: "val", value: 2, type: 1, properties: ["val": "location"]} -run/0: ingredient 0 is val -mem/0: location 1042 is 34 -mem/0: location 1047 is 1035 -mem/0: storing 34 in location 1035 -run/0: instruction write/13 -run/0: {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]} <- add/2 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1046 is 1032 -mem/0: storing 1 in location 1032 -run/0: instruction write/15 -run/0: {name: "len", value: 8, type: 1, properties: ["len": "integer"]} <- length/28 {name: "circular-buffer", value: 5, type: 2-5-1, properties: ["circular-buffer": "address":"array":"location", "deref": ]} -mem/0: location 1045 is 1034 -mem/0: storing 4 in location 1048 -run/0: instruction write/16 -run/0: {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "free", value: 6, type: 2-1, properties: ["free": "address":"integer", "deref": ]}, {name: "len", value: 8, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is free -mem/0: location 1046 is 1032 -mem/0: location 1032 is 1 -run/0: ingredient 1 is len -mem/0: location 1048 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction write/17 -run/0: break-unless/12 {name: "at-end?", value: 9, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 19 -run/0: instruction write/20 -run/0: reply/33 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "same-as-ingredient": "0"]} -mem/0: location 1041 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- channel-empty?/112 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-empty?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1132 -run/0: instruction channel-empty?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1134 -run/0: instruction channel-empty?/2 -run/0: {name: "full", value: 2, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1135 -run/0: instruction channel-empty?/3 -run/0: {name: "free", value: 3, type: 1, properties: ["free": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1134 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1136 -run/0: instruction channel-empty?/4 -run/0: {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 2, type: 1, properties: ["full": "integer"]}, {name: "free", value: 3, type: 1, properties: ["free": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1135 is 0 -run/0: ingredient 1 is free -mem/0: location 1136 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1137 -run/0: instruction channel-empty?/5 -run/0: reply/33 {name: "result", value: 4, type: 3, properties: ["result": "boolean"]} -mem/0: location 1137 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- channel-full?/110 {name: "1", value: 1, type: 2-10, properties: ["1": "address":"channel"]} -mem/0: location 1 is 1031 -run/0: instruction channel-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1163 -run/0: instruction channel-full?/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1165 -run/0: instruction channel-full?/2 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-free", value: 1, type: 0, properties: ["first-free": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-free -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1166 -run/0: instruction channel-full?/3 -run/0: {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} <- add/2 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is tmp -mem/0: location 1166 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1166 -run/0: instruction channel-full?/5 -run/0: {name: "len", value: 3, type: 1, properties: ["len": "integer"]} <- channel-capacity/113 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} -mem/0: location 1165 is 1031 -run/0: instruction channel-capacity/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1194 -run/0: instruction channel-capacity/1 -run/0: {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1196 -run/0: instruction channel-capacity/2 -run/0: {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "data", value: 2, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1196 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1033 -run/0: its type is 2 -mem/0: location 1033 is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1197 -run/0: instruction channel-capacity/3 -run/0: {name: "result", value: 3, type: 1, properties: ["result": "integer"]} <- length/28 {name: "q", value: 2, type: 2-5-1, properties: ["q": "address":"array":"location", "deref": ]} -mem/0: location 1197 is 1034 -mem/0: storing 4 in location 1198 -run/0: instruction channel-capacity/4 -run/0: reply/33 {name: "result", value: 3, type: 1, properties: ["result": "integer"]} -mem/0: location 1198 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 1167 -run/0: instruction channel-full?/6 -run/0: {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]} <- greater-or-equal/16 {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]}, {name: "len", value: 3, type: 1, properties: ["len": "integer"]} -run/0: ingredient 0 is tmp -mem/0: location 1166 is 2 -run/0: ingredient 1 is len -mem/0: location 1167 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1168 -run/0: instruction channel-full?/7 -run/0: break-unless/12 {name: "at-end?", value: 4, type: 3, properties: ["at-end?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1168 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 9 -run/0: instruction channel-full?/10 -run/0: {name: "full", value: 5, type: 1, properties: ["full": "integer"]} <- get/24 {name: "chan", value: 1, type: 2-10, properties: ["chan": "address":"channel", "deref": ]}, {name: "first-full", value: 0, type: 0, properties: ["first-full": "offset"]} -run/0: ingredient 0 is chan -mem/0: location 1165 is 1031 -run/0: ingredient 1 is first-full -run/0: address to copy is 1031 -run/0: its type is 1 -mem/0: location 1031 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1169 -run/0: instruction channel-full?/11 -run/0: {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} <- equal/13 {name: "full", value: 5, type: 1, properties: ["full": "integer"]}, {name: "tmp", value: 2, type: 1, properties: ["tmp": "integer"]} -run/0: ingredient 0 is full -mem/0: location 1169 is 0 -run/0: ingredient 1 is tmp -mem/0: location 1166 is 2 -run/0: product 0 is 0 -mem/0: storing 0 in location 1170 -run/0: instruction channel-full?/12 -run/0: reply/33 {name: "result", value: 6, type: 3, properties: ["result": "boolean"]} -mem/0: location 1170 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction channel-write-not-empty/1 -run/0: memory-should-contain/46 {name: " - 2 <- 0 # empty? - 3 <- 0 # full? - ", value: 0, type: 0, properties: [" - 2 <- 0 # empty? - 3 <- 0 # full? - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/check_string_in_memory b/cpp/.traces/check_string_in_memory deleted file mode 100644 index 783c9702..00000000 --- a/cpp/.traces/check_string_in_memory +++ /dev/null @@ -1,78 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 3:literal - 2:character <- copy 97:literal # 'a' - 3:character <- copy 98:literal # 'b' - 4:character <- copy 99:literal # 'c' - ", value: 0, type: 0, properties: [" - 1:integer <- copy 3:literal - 2:character <- copy 97:literal # 'a' - 3:character <- copy 98:literal # 'b' - 4:character <- copy 99:literal # 'c' - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1:string <- [abc] - ", value: 0, type: 0, properties: [" - 1:string <- [abc] - ": "literal-string"]} -after-brace/0: recipe check_string_in_memory -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: check_string_in_memory -run/0: instruction check_string_in_memory/0 -run/0: run/45 {name: " - 1:integer <- copy 3:literal - 2:character <- copy 97:literal # 'a' - 3:character <- copy 98:literal # 'b' - 4:character <- copy 99:literal # 'c' - ", value: 0, type: 0, properties: [" - 1:integer <- copy 3:literal - 2:character <- copy 97:literal # 'a' - 3:character <- copy 98:literal # 'b' - 4:character <- copy 99:literal # 'c' - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "2", value: 0, type: 4, properties: ["2": "character"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "98", value: 0, type: 0, properties: ["98": "literal"]} -parse/0: product: {name: "3", value: 0, type: 4, properties: ["3": "character"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "99", value: 0, type: 0, properties: ["99": "literal"]} -parse/0: product: {name: "4", value: 0, type: 4, properties: ["4": "character"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 4, properties: ["2": "character"]} <- copy/1 {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -run/0: ingredient 0 is 97 -mem/0: storing 97 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 4, properties: ["3": "character"]} <- copy/1 {name: "98", value: 98, type: 0, properties: ["98": "literal"]} -run/0: ingredient 0 is 98 -mem/0: storing 98 in location 3 -run/0: instruction run1001/3 -run/0: {name: "4", value: 4, type: 4, properties: ["4": "character"]} <- copy/1 {name: "99", value: 99, type: 0, properties: ["99": "literal"]} -run/0: ingredient 0 is 99 -mem/0: storing 99 in location 4 -run/0: instruction check_string_in_memory/1 -run/0: memory-should-contain/46 {name: " - 1:string <- [abc] - ", value: 0, type: 0, properties: [" - 1:string <- [abc] - ": "literal-string"]} -run/0: checking string length at 1 -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 diff --git a/cpp/.traces/check_trace b/cpp/.traces/check_trace deleted file mode 100644 index 17b68c94..00000000 --- a/cpp/.traces/check_trace +++ /dev/null @@ -1,41 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - mem: storing 4 in location 1 - ", value: 0, type: 0, properties: [" - mem: storing 4 in location 1 - ": "literal-string"]} -after-brace/0: recipe check_trace -after-brace/0: run ... -after-brace/0: trace-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: check_trace -run/0: instruction check_trace/0 -run/0: run/45 {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: add ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction check_trace/1 -run/0: trace-should-contain/47 {name: " - mem: storing 4 in location 1 - ", value: 0, type: 0, properties: [" - mem: storing 4 in location 1 - ": "literal-string"]} diff --git a/cpp/.traces/check_trace_instruction b/cpp/.traces/check_trace_instruction deleted file mode 100644 index a1642099..00000000 --- a/cpp/.traces/check_trace_instruction +++ /dev/null @@ -1,37 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - trace [foo], [aaa] - ", value: 0, type: 0, properties: [" - trace [foo], [aaa] - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - foo: aaa - ", value: 0, type: 0, properties: [" - foo: aaa - ": "literal-string"]} -after-brace/0: recipe check_trace_instruction -after-brace/0: run ... -after-brace/0: trace-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: check_trace_instruction -run/0: instruction check_trace_instruction/0 -run/0: run/45 {name: " - trace [foo], [aaa] - ", value: 0, type: 0, properties: [" - trace [foo], [aaa] - ": "literal-string"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "foo", value: 0, type: 0, properties: ["foo": "literal-string"]} -parse/0: ingredient: {name: "aaa", value: 0, type: 0, properties: ["aaa": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: trace/18 {name: "foo", value: 0, type: 0, properties: ["foo": "literal-string"]}, {name: "aaa", value: 0, type: 0, properties: ["aaa": "literal-string"]} -foo/0: aaa -run/0: instruction check_trace_instruction/1 -run/0: trace-should-contain/47 {name: " - foo: aaa - ", value: 0, type: 0, properties: [" - foo: aaa - ": "literal-string"]} diff --git a/cpp/.traces/check_trace_negative b/cpp/.traces/check_trace_negative deleted file mode 100644 index c65bac12..00000000 --- a/cpp/.traces/check_trace_negative +++ /dev/null @@ -1,41 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - mem: storing 5 in location 1 - ", value: 0, type: 0, properties: [" - mem: storing 5 in location 1 - ": "literal-string"]} -after-brace/0: recipe check_trace_negative -after-brace/0: run ... -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: check_trace_negative -run/0: instruction check_trace_negative/0 -run/0: run/45 {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: add ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction check_trace_negative/1 -run/0: trace-should-not-contain/48 {name: " - mem: storing 5 in location 1 - ", value: 0, type: 0, properties: [" - mem: storing 5 in location 1 - ": "literal-string"]} diff --git a/cpp/.traces/clear-line-erases-printed-characters b/cpp/.traces/clear-line-erases-printed-characters deleted file mode 100644 index edf9997d..00000000 --- a/cpp/.traces/clear-line-erases-printed-characters +++ /dev/null @@ -1,1170 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - # print a character - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - # move cursor to start of line - 1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column - # clear line - 1:address:screen <- clear-line 1:address:screen - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ", value: 0, type: 0, properties: [" -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - # print a character - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - # move cursor to start of line - 1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column - # clear line - 1:address:screen <- clear-line 1:address:screen - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 6 # width*height - 4 <- 0 - 5 <- 0 - 6 <- 0 - 7 <- 0 - 8 <- 0 - 9 <- 0 - ", value: 0, type: 0, properties: [" - 3 <- 6 # width*height - 4 <- 0 - 5 <- 0 - 6 <- 0 - 7 <- 0 - 8 <- 0 - 9 <- 0 - ": "literal-string"]} -after-brace/0: recipe clear-line-erases-printed-characters -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: clear-line-erases-printed-characters -run/0: instruction clear-line-erases-printed-characters/0 -run/0: run/45 {name: " -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - # print a character - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - # move cursor to start of line - 1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column - # clear line - 1:address:screen <- clear-line 1:address:screen - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ", value: 0, type: 0, properties: [" -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - # print a character - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - # move cursor to start of line - 1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column - # clear line - 1:address:screen <- clear-line 1:address:screen - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: init-fake-screen -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "width": ]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal", "height": ]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: move-cursor -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal", "row": ]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal", "column": ]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: clear-line -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen", "deref": ]} -parse/0: ingredient: {name: "data", value: 0, type: 0, properties: ["data": "offset"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]} -parse/0: product: {name: "3", value: 0, type: 5-4, properties: ["3": "array":"character"]} -name/0: element data of type screen is at offset 4 -after-brace/0: recipe run1001 -after-brace/0: init-fake-screen ... -after-brace/0: print-character ... -after-brace/0: move-cursor ... -after-brace/0: clear-line ... -after-brace/0: get ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- init-fake-screen/115 {name: "3", value: 3, type: 0, properties: ["3": "literal", "width": ]}, {name: "2", value: 2, type: 0, properties: ["2": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1003 is 1032 -mem/0: storing 3 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: location 1004 is 1031 -mem/0: storing 2 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 3 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 6 -mem/0: storing 6 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 6 -mem/0: array size is 6 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1043 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1045 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1045 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1045 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1046 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1046 is 1036 -mem/0: storing 6 in location 1047 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 6 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 1 -mem/0: storing 1 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1045 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- print-character/117 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1074 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1076 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1077 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1076 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1078 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1079 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1080 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1078 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1081 is 0 -run/0: ingredient 1 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1082 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1082 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1081 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1083 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1077 is 97 -mem/0: location 1083 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1084 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1084 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1079 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1076 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- move-cursor/120 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "row": ]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "column": ]} -mem/0: location 1 is 1031 -run/0: instruction move-cursor/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1105 -run/0: instruction move-cursor/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1107 -run/0: instruction move-cursor/2 -run/0: {name: "new-row", value: 2, type: 1, properties: ["new-row": "integer"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1108 -run/0: instruction move-cursor/3 -run/0: {name: "new-column", value: 3, type: 1, properties: ["new-column": "integer"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1109 -run/0: instruction move-cursor/5 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1107 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction move-cursor/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1107 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1110 -run/0: instruction move-cursor/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "new-row", value: 2, type: 1, properties: ["new-row": "integer"]} -run/0: ingredient 0 is new-row -mem/0: location 1108 is 0 -mem/0: location 1110 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction move-cursor/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1107 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1111 -run/0: instruction move-cursor/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "new-column", value: 3, type: 1, properties: ["new-column": "integer"]} -run/0: ingredient 0 is new-column -mem/0: location 1109 is 0 -mem/0: location 1111 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction move-cursor/10 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1107 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/3 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- clear-line/118 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} -mem/0: location 1 is 1031 -run/0: instruction clear-line/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1136 -run/0: instruction clear-line/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1138 -run/0: instruction clear-line/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1138 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-line/4 -run/0: {name: "n", value: 2, type: 1, properties: ["n": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1138 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1139 -run/0: instruction clear-line/5 -run/0: {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1138 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1140 -run/0: instruction clear-line/6 -run/0: {name: "original-column", value: 4, type: 1, properties: ["original-column": "integer"]} <- copy/1 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is column -mem/0: location 1140 is 1034 -mem/0: location 1034 is 0 -mem/0: storing 0 in location 1141 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1140 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is n -mem/0: location 1139 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1142 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1142 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1138 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1167 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1169 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1170 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1169 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1169 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1171 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1169 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1172 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1169 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1173 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1171 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1173 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1174 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1174 is 0 -run/0: ingredient 1 is column -mem/0: location 1172 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1174 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1169 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1175 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1175 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1174 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1176 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1170 is 0 -mem/0: location 1176 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1172 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1173 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1177 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1177 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1172 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1172 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1169 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1140 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is n -mem/0: location 1139 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1142 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1142 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1138 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1198 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1200 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1201 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1200 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1200 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1202 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1200 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1203 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1200 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1204 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1202 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1204 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1205 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1205 is 0 -run/0: ingredient 1 is column -mem/0: location 1203 is 1034 -mem/0: location 1034 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1205 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1200 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1206 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1206 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1205 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1207 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1201 is 0 -mem/0: location 1207 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1203 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is width -mem/0: location 1204 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1208 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1208 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1203 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1203 is 1034 -mem/0: storing 2 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1200 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1140 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is n -mem/0: location 1139 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1142 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1142 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1138 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1229 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1231 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1232 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1231 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1231 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1233 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1231 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1234 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1231 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1235 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1233 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1235 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1236 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1236 is 0 -run/0: ingredient 1 is column -mem/0: location 1234 is 1034 -mem/0: location 1034 is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 1236 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1231 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1237 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1237 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1236 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1238 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1232 is 0 -mem/0: location 1238 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1234 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is width -mem/0: location 1235 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1239 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1239 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1234 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1234 is 1034 -mem/0: storing 3 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1231 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1140 is 1034 -mem/0: location 1034 is 3 -run/0: ingredient 1 is n -mem/0: location 1139 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1142 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1142 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 12 -run/0: instruction clear-line/13 -run/0: {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "original-column", value: 4, type: 1, properties: ["original-column": "integer"]} -run/0: ingredient 0 is original-column -mem/0: location 1141 is 0 -mem/0: location 1140 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction clear-line/14 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1138 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/4 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character"]} <- get/24 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 2 -run/0: instruction run1001/5 -run/0: {name: "3", value: 3, type: 5-4, properties: ["3": "array":"character"]} <- copy/1 {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 1036 -mem/0: location 1036 is 6 -mem/0: location 1037 is 0 -mem/0: location 1038 is 0 -mem/0: location 1039 is 0 -mem/0: location 1040 is 0 -mem/0: location 1041 is 0 -mem/0: location 1042 is 0 -mem/0: storing 6 in location 3 -mem/0: storing 0 in location 4 -mem/0: storing 0 in location 5 -mem/0: storing 0 in location 6 -mem/0: storing 0 in location 7 -mem/0: storing 0 in location 8 -mem/0: storing 0 in location 9 -run/0: instruction clear-line-erases-printed-characters/1 -run/0: memory-should-contain/46 {name: " - 3 <- 6 # width*height - 4 <- 0 - 5 <- 0 - 6 <- 0 - 7 <- 0 - 8 <- 0 - 9 <- 0 - ", value: 0, type: 0, properties: [" - 3 <- 6 # width*height - 4 <- 0 - 5 <- 0 - 6 <- 0 - 7 <- 0 - 8 <- 0 - 9 <- 0 - ": "literal-string"]} -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 -run/0: checking location 9 diff --git a/cpp/.traces/clear-line-erases-printed-characters2 b/cpp/.traces/clear-line-erases-printed-characters2 deleted file mode 100644 index 20ffbd1c..00000000 --- a/cpp/.traces/clear-line-erases-printed-characters2 +++ /dev/null @@ -1,1718 +0,0 @@ -parse/0: instruction: assume-screen -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal", "width": ]} -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "height": ]} -parse/0: instruction: run -parse/0: ingredient: {name: " - # print a character - screen:address <- print-character screen:address, 97:literal # 'a' - # move cursor to start of line - screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column - # clear line - screen:address <- clear-line screen:address - ", value: 0, type: 0, properties: [" - # print a character - screen:address <- print-character screen:address, 97:literal # 'a' - # move cursor to start of line - screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column - # clear line - screen:address <- clear-line screen:address - ": "literal-string"]} -parse/0: instruction: screen-should-contain -parse/0: ingredient: {name: " - . . - . . - . . - ", value: 0, type: 0, properties: [" - . . - . . - . . - ": "literal-string"]} -after-brace/0: recipe clear-line-erases-printed-characters2 -after-brace/0: assume-screen ... -after-brace/0: run ... -after-brace/0: screen-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: clear-line-erases-printed-characters2 -run/0: instruction clear-line-erases-printed-characters2/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- assume-screen/115 {name: "5", value: 5, type: 0, properties: ["5": "literal", "width": ]}, {name: "3", value: 3, type: 0, properties: ["3": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 5 -mem/0: location 1003 is 1032 -mem/0: storing 5 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1004 is 1031 -mem/0: storing 3 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 5 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 15 -mem/0: storing 15 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 15 -mem/0: array size is 15 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1052 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1054 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1054 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1054 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1055 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1055 is 1036 -mem/0: storing 15 in location 1056 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1057 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 6 -run/0: address to copy is 1043 -run/0: product 0 is 1043 -mem/0: storing 1043 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1043 -mem/0: storing 0 in location 1043 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 7 -run/0: address to copy is 1044 -run/0: product 0 is 1044 -mem/0: storing 1044 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1044 -mem/0: storing 0 in location 1044 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 8 -run/0: address to copy is 1045 -run/0: product 0 is 1045 -mem/0: storing 1045 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1045 -mem/0: storing 0 in location 1045 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 9 -run/0: address to copy is 1046 -run/0: product 0 is 1046 -mem/0: storing 1046 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1046 -mem/0: storing 0 in location 1046 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 10 -run/0: address to copy is 1047 -run/0: product 0 is 1047 -mem/0: storing 1047 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1047 -mem/0: storing 0 in location 1047 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 11 -run/0: address to copy is 1048 -run/0: product 0 is 1048 -mem/0: storing 1048 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1048 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is 1 -run/0: product 0 is 12 -mem/0: storing 12 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 12 -run/0: address to copy is 1049 -run/0: product 0 is 1049 -mem/0: storing 1049 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1049 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is 1 -run/0: product 0 is 13 -mem/0: storing 13 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 13 -run/0: address to copy is 1050 -run/0: product 0 is 1050 -mem/0: storing 1050 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1050 -mem/0: storing 0 in location 1050 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is 1 -run/0: product 0 is 14 -mem/0: storing 14 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 14 -run/0: address to copy is 1051 -run/0: product 0 is 1051 -mem/0: storing 1051 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1051 -mem/0: storing 0 in location 1051 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is 1 -run/0: product 0 is 15 -mem/0: storing 15 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 15 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 1 -mem/0: storing 1 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1054 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction clear-line-erases-printed-characters2/1 -run/0: run/45 {name: " - # print a character - screen:address <- print-character screen:address, 97:literal # 'a' - # move cursor to start of line - screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column - # clear line - screen:address <- clear-line screen:address - ", value: 0, type: 0, properties: [" - # print a character - screen:address <- print-character screen:address, 97:literal # 'a' - # move cursor to start of line - screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column - # clear line - screen:address <- clear-line screen:address - ": "literal-string"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: instruction: move-cursor -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal", "row": ]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal", "column": ]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: instruction: clear-line -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -after-brace/0: recipe run1001 -after-brace/0: print-character ... -after-brace/0: move-cursor ... -after-brace/0: clear-line ... -run/0: instruction run1001/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- print-character/117 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 900 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1083 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1085 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1086 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1085 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1087 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1088 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1089 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1087 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1090 is 0 -run/0: ingredient 1 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1091 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1091 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1090 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1092 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1086 is 97 -mem/0: location 1092 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1093 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1093 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1088 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1085 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction run1001/1 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- move-cursor/120 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "row": ]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "column": ]} -mem/0: location 900 is 1031 -run/0: instruction move-cursor/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1114 -run/0: instruction move-cursor/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1116 -run/0: instruction move-cursor/2 -run/0: {name: "new-row", value: 2, type: 1, properties: ["new-row": "integer"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1117 -run/0: instruction move-cursor/3 -run/0: {name: "new-column", value: 3, type: 1, properties: ["new-column": "integer"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1118 -run/0: instruction move-cursor/5 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1116 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction move-cursor/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1116 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1119 -run/0: instruction move-cursor/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "new-row", value: 2, type: 1, properties: ["new-row": "integer"]} -run/0: ingredient 0 is new-row -mem/0: location 1117 is 0 -mem/0: location 1119 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction move-cursor/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1116 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1120 -run/0: instruction move-cursor/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "new-column", value: 3, type: 1, properties: ["new-column": "integer"]} -run/0: ingredient 0 is new-column -mem/0: location 1118 is 0 -mem/0: location 1120 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction move-cursor/10 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1116 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction run1001/2 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- clear-line/118 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} -mem/0: location 900 is 1031 -run/0: instruction clear-line/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1145 -run/0: instruction clear-line/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1147 -run/0: instruction clear-line/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1147 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-line/4 -run/0: {name: "n", value: 2, type: 1, properties: ["n": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1147 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1148 -run/0: instruction clear-line/5 -run/0: {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1147 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1149 -run/0: instruction clear-line/6 -run/0: {name: "original-column", value: 4, type: 1, properties: ["original-column": "integer"]} <- copy/1 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 0 -mem/0: storing 0 in location 1150 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1147 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1176 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1178 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1179 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1178 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1178 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1180 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1178 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1181 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1178 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1182 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1180 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1182 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1183 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1183 is 0 -run/0: ingredient 1 is column -mem/0: location 1181 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1183 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1178 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1184 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1184 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1183 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1185 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1179 is 0 -mem/0: location 1185 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1181 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1182 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1186 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1186 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1181 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1181 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1178 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1147 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1207 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1209 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1210 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1209 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1209 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1211 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1209 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1212 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1209 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1213 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1211 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1213 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1214 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1214 is 0 -run/0: ingredient 1 is column -mem/0: location 1212 is 1034 -mem/0: location 1034 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1214 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1209 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1215 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1215 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1214 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1216 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1210 is 0 -mem/0: location 1216 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1212 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is width -mem/0: location 1213 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1217 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1217 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1212 is 1034 -mem/0: location 1034 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1212 is 1034 -mem/0: storing 2 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1209 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1147 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1238 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1240 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1241 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1240 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1240 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1242 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1240 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1243 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1240 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1244 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1242 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1244 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1245 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1245 is 0 -run/0: ingredient 1 is column -mem/0: location 1243 is 1034 -mem/0: location 1034 is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 1245 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1240 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1246 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1246 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1245 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1247 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1241 is 0 -mem/0: location 1247 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1243 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is width -mem/0: location 1244 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1248 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1248 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1243 is 1034 -mem/0: location 1034 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1243 is 1034 -mem/0: storing 3 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1240 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 3 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1147 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1269 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1271 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1272 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1271 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1271 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1273 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1271 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1274 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1271 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1275 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1273 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1275 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1276 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1276 is 0 -run/0: ingredient 1 is column -mem/0: location 1274 is 1034 -mem/0: location 1034 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1276 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1271 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1277 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1277 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1276 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1278 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1272 is 0 -mem/0: location 1278 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1274 is 1034 -mem/0: location 1034 is 3 -run/0: ingredient 1 is width -mem/0: location 1275 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1279 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1279 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1274 is 1034 -mem/0: location 1034 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: location 1274 is 1034 -mem/0: storing 4 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1271 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 4 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-line/10 -run/0: print-character/117 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -mem/0: location 1147 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1300 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1302 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1303 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1302 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1302 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1304 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1302 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1305 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1302 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1306 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1304 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1306 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1307 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1307 is 0 -run/0: ingredient 1 is column -mem/0: location 1305 is 1034 -mem/0: location 1034 is 4 -run/0: product 0 is 4 -mem/0: storing 4 in location 1307 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1302 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1308 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1308 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1307 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1309 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1303 is 0 -mem/0: location 1309 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1305 is 1034 -mem/0: location 1034 is 4 -run/0: ingredient 1 is width -mem/0: location 1306 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1310 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1310 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1305 is 1034 -mem/0: location 1034 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: location 1305 is 1034 -mem/0: storing 5 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1302 is 1031 -run/0: instruction clear-line/11 -run/0: loop/10 {name: "", value: -4, type: , properties: ["": ]} -run/0: ingredient 0 is -4 -run/0: jumping to instruction 8 -run/0: instruction clear-line/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "n", value: 2, type: 1, properties: ["n": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1149 is 1034 -mem/0: location 1034 is 5 -run/0: ingredient 1 is n -mem/0: location 1148 is 5 -run/0: product 0 is 1 -mem/0: storing 1 in location 1151 -run/0: instruction clear-line/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1151 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 12 -run/0: instruction clear-line/13 -run/0: {name: "column", value: 3, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "original-column", value: 4, type: 1, properties: ["original-column": "integer"]} -run/0: ingredient 0 is original-column -mem/0: location 1150 is 0 -mem/0: location 1149 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction clear-line/14 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1147 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction clear-line-erases-printed-characters2/2 -run/0: screen-should-contain/62 {name: " - . . - . . - . . - ", value: 0, type: 0, properties: [" - . . - . . - . . - ": "literal-string"]} -run/0: checking screen size at 1036 -run/0: checking location 1037 -run/0: checking location 1038 -run/0: checking location 1039 -run/0: checking location 1040 -run/0: checking location 1041 -run/0: checking location 1042 -run/0: checking location 1043 -run/0: checking location 1044 -run/0: checking location 1045 -run/0: checking location 1046 -run/0: checking location 1047 -run/0: checking location 1048 -run/0: checking location 1049 -run/0: checking location 1050 -run/0: checking location 1051 diff --git a/cpp/.traces/closure b/cpp/.traces/closure deleted file mode 100644 index dd3a750e..00000000 --- a/cpp/.traces/closure +++ /dev/null @@ -1,140 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: init-counter -parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} -parse/0: instruction: increment-counter -parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer", "raw": ]} -parse/0: instruction: increment-counter -parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "y", value: 0, type: 1, properties: ["y": "integer"]} -parse/0: instruction: reply -parse/0: ingredient: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "space", value: 0, type: 0, properties: ["space": "literal"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "init-counter"]} -parse/0: instruction: add -parse/0: ingredient: {name: "y", value: 0, type: 1, properties: ["y": "integer", "space": "1"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "y", value: 0, type: 1, properties: ["y": "integer", "space": "1"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "234", value: 0, type: 0, properties: ["234": "literal"]} -parse/0: product: {name: "y", value: 0, type: 1, properties: ["y": "integer"]} -parse/0: instruction: reply -parse/0: ingredient: {name: "y", value: 0, type: 1, properties: ["y": "integer", "space": "1"]} -name/0: recipe increment-counter is surrounded by init-counter -new/0: location -> 1 -new/0: location -> 1 -name/0: assign x 1 -name/0: assign y 2 -new/0: space -> 0 -name/0: assign y 1 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: init-counter ... -after-brace/0: increment-counter ... -after-brace/0: increment-counter ... -after-brace/0: recipe init-counter -after-brace/0: new ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: reply ... -after-brace/0: recipe increment-counter -after-brace/0: new ... -after-brace/0: next-ingredient ... -after-brace/0: add ... -after-brace/0: copy ... -after-brace/0: reply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction main/1 -run/0: {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} <- init-counter/1001 -run/0: instruction init-counter/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1031 -run/0: instruction init-counter/1 -run/0: {name: "x", value: 1, type: 1, properties: ["x": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1033 -run/0: instruction init-counter/2 -run/0: {name: "y", value: 2, type: 1, properties: ["y": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1034 -run/0: instruction init-counter/3 -run/0: reply/33 {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction main/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer", "raw": ]} <- increment-counter/1002 {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} -mem/0: location 1002 is 1031 -run/0: instruction increment-counter/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "space", value: 0, type: 0, properties: ["space": "literal"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1062 -run/0: instruction increment-counter/1 -run/0: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "init-counter"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1063 -run/0: instruction increment-counter/2 -run/0: {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]} <- add/2 {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is y -mem/0: location 1034 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1034 -run/0: instruction increment-counter/3 -run/0: {name: "y", value: 1, type: 1, properties: ["y": "integer"]} <- copy/1 {name: "234", value: 234, type: 0, properties: ["234": "literal"]} -run/0: ingredient 0 is 234 -mem/0: storing 234 in location 1064 -run/0: instruction increment-counter/4 -run/0: reply/33 {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]} -mem/0: location 1034 is 4 -run/0: result 0 is 4 -mem/0: storing 4 in location 2 -run/0: instruction main/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer", "raw": ]} <- increment-counter/1002 {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} -mem/0: location 1002 is 1031 -run/0: instruction increment-counter/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "space", value: 0, type: 0, properties: ["space": "literal"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1093 -run/0: instruction increment-counter/1 -run/0: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "init-counter"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1094 -run/0: instruction increment-counter/2 -run/0: {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]} <- add/2 {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is y -mem/0: location 1034 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1034 -run/0: instruction increment-counter/3 -run/0: {name: "y", value: 1, type: 1, properties: ["y": "integer"]} <- copy/1 {name: "234", value: 234, type: 0, properties: ["234": "literal"]} -run/0: ingredient 0 is 234 -mem/0: storing 234 in location 1095 -run/0: instruction increment-counter/4 -run/0: reply/33 {name: "y", value: 2, type: 1, properties: ["y": "integer", "space": "1"]} -mem/0: location 1034 is 5 -run/0: result 0 is 5 -mem/0: storing 5 in location 3 diff --git a/cpp/.traces/container b/cpp/.traces/container deleted file mode 100644 index 4f0dac52..00000000 --- a/cpp/.traces/container +++ /dev/null @@ -1,5 +0,0 @@ -parse/0: reading container foo -parse/0: element name: x -parse/0: type: 1 -parse/0: element name: y -parse/0: type: 1 diff --git a/cpp/.traces/convert_names b/cpp/.traces/convert_names deleted file mode 100644 index 5420908d..00000000 --- a/cpp/.traces/convert_names +++ /dev/null @@ -1,12 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} -name/0: assign x 1 -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "x", value: 1, type: 1, properties: ["x": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 diff --git a/cpp/.traces/convert_names_handles_containers b/cpp/.traces/convert_names_handles_containers deleted file mode 100644 index 1b50d2fb..00000000 --- a/cpp/.traces/convert_names_handles_containers +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "a", value: 0, type: 6, properties: ["a": "point"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "b", value: 0, type: 1, properties: ["b": "integer"]} -name/0: assign a 1 -name/0: assign b 3 -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... diff --git a/cpp/.traces/convert_names_passes_default_space b/cpp/.traces/convert_names_passes_default_space deleted file mode 100644 index 1897c72a..00000000 --- a/cpp/.traces/convert_names_passes_default_space +++ /dev/null @@ -1,12 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 1, properties: ["default-space": "integer"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} -name/0: assign x 1 -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "default-space", value: 0, type: 1, properties: ["default-space": "integer"]}, {name: "x", value: 1, type: 1, properties: ["x": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 diff --git a/cpp/.traces/convert_names_passes_dummy b/cpp/.traces/convert_names_passes_dummy deleted file mode 100644 index 6a79d0a3..00000000 --- a/cpp/.traces/convert_names_passes_dummy +++ /dev/null @@ -1,12 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} -name/0: assign x 1 -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "x", value: 1, type: 1, properties: ["x": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 diff --git a/cpp/.traces/convert_names_passes_raw b/cpp/.traces/convert_names_passes_raw deleted file mode 100644 index bb1c42ae..00000000 --- a/cpp/.traces/convert_names_passes_raw +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer", "raw": ]} -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "x", value: 0, type: 1, properties: ["x": "integer", "raw": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 0 diff --git a/cpp/.traces/convert_names_transforms_container_elements b/cpp/.traces/convert_names_transforms_container_elements deleted file mode 100644 index 4232571c..00000000 --- a/cpp/.traces/convert_names_transforms_container_elements +++ /dev/null @@ -1,35 +0,0 @@ -parse/0: instruction: get -parse/0: ingredient: {name: "0", value: 0, type: 6, properties: ["0": "point"]} -parse/0: ingredient: {name: "y", value: 0, type: 0, properties: ["y": "offset"]} -parse/0: product: {name: "a", value: 0, type: 1, properties: ["a": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "0", value: 0, type: 6, properties: ["0": "point"]} -parse/0: ingredient: {name: "x", value: 0, type: 0, properties: ["x": "offset"]} -parse/0: product: {name: "b", value: 0, type: 1, properties: ["b": "integer"]} -name/0: element y of type point is at offset 1 -name/0: assign a 1 -name/0: element x of type point is at offset 0 -name/0: assign b 2 -after-brace/0: recipe main -after-brace/0: get ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "a", value: 1, type: 1, properties: ["a": "integer"]} <- get/24 {name: "0", value: 0, type: 6, properties: ["0": "point"]}, {name: "y", value: 1, type: 0, properties: ["y": "offset"]} -run/0: ingredient 0 is 0 -run/0: ingredient 1 is y -run/0: address to copy is 1 -run/0: its type is 1 -mem/0: location 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1 -run/0: instruction main/1 -run/0: {name: "b", value: 2, type: 1, properties: ["b": "integer"]} <- get/24 {name: "0", value: 0, type: 6, properties: ["0": "point"]}, {name: "x", value: 0, type: 0, properties: ["x": "offset"]} -run/0: ingredient 0 is 0 -run/0: ingredient 1 is x -run/0: address to copy is 0 -run/0: its type is 1 -mem/0: location 0 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 2 diff --git a/cpp/.traces/convert_names_warns b/cpp/.traces/convert_names_warns deleted file mode 100644 index 4615bbe6..00000000 --- a/cpp/.traces/convert_names_warns +++ /dev/null @@ -1,14 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "y", value: 0, type: 1, properties: ["y": "integer"]} -parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} -warn/0: use before set: y in main -name/0: assign x 1 -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "x", value: 1, type: 1, properties: ["x": "integer"]} <- copy/1 {name: "y", value: 0, type: 1, properties: ["y": "integer"]} -run/0: ingredient 0 is y -mem/0: location 0 is 0 -mem/0: storing 0 in location 1 diff --git a/cpp/.traces/copy b/cpp/.traces/copy deleted file mode 100644 index ce833903..00000000 --- a/cpp/.traces/copy +++ /dev/null @@ -1,20 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 23 -mem/0: storing 23 in location 2 diff --git a/cpp/.traces/copy_array b/cpp/.traces/copy_array deleted file mode 100644 index 00c78037..00000000 --- a/cpp/.traces/copy_array +++ /dev/null @@ -1,50 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 5-1, properties: ["1": "array":"integer"]} -parse/0: product: {name: "5", value: 0, type: 5-1, properties: ["5": "array":"integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 5-1, properties: ["5": "array":"integer"]} <- copy/1 {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 3 -mem/0: location 2 is 14 -mem/0: location 3 is 15 -mem/0: location 4 is 16 -mem/0: storing 3 in location 5 -mem/0: storing 14 in location 6 -mem/0: storing 15 in location 7 -mem/0: storing 16 in location 8 diff --git a/cpp/.traces/copy_array_indirect b/cpp/.traces/copy_array_indirect deleted file mode 100644 index a32cbfc9..00000000 --- a/cpp/.traces/copy_array_indirect +++ /dev/null @@ -1,59 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "5", value: 0, type: 2-5-1, properties: ["5": "address":"array":"integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 2-5-1, properties: ["5": "address":"array":"integer", "deref": ]} -parse/0: product: {name: "6", value: 0, type: 5-1, properties: ["6": "array":"integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 2-5-1, properties: ["5": "address":"array":"integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 5 -run/0: instruction main/5 -run/0: {name: "6", value: 6, type: 5-1, properties: ["6": "array":"integer"]} <- copy/1 {name: "5", value: 5, type: 2-5-1, properties: ["5": "address":"array":"integer", "deref": ]} -run/0: ingredient 0 is 5 -mem/0: location 5 is 1 -mem/0: location 1 is 3 -mem/0: location 2 is 14 -mem/0: location 3 is 15 -mem/0: location 4 is 16 -mem/0: storing 3 in location 6 -mem/0: storing 14 in location 7 -mem/0: storing 15 in location 8 -mem/0: storing 16 in location 9 diff --git a/cpp/.traces/copy_exclusive_container b/cpp/.traces/copy_exclusive_container deleted file mode 100644 index 3cc5ea54..00000000 --- a/cpp/.traces/copy_exclusive_container +++ /dev/null @@ -1,40 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 8, properties: ["1": "integer-or-point"]} -parse/0: product: {name: "4", value: 0, type: 8, properties: ["4": "integer-or-point"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 8, properties: ["4": "integer-or-point"]} <- copy/1 {name: "1", value: 1, type: 8, properties: ["1": "integer-or-point"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1 -mem/0: location 2 is 34 -mem/0: location 3 is 35 -mem/0: storing 1 in location 4 -mem/0: storing 34 in location 5 -mem/0: storing 35 in location 6 diff --git a/cpp/.traces/copy_handles_nested_container_elements b/cpp/.traces/copy_handles_nested_container_elements deleted file mode 100644 index b8a57d73..00000000 --- a/cpp/.traces/copy_handles_nested_container_elements +++ /dev/null @@ -1,40 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "36", value: 0, type: 0, properties: ["36": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "12", value: 0, type: 7, properties: ["12": "point-integer"]} -parse/0: product: {name: "15", value: 0, type: 7, properties: ["15": "point-integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "36", value: 36, type: 0, properties: ["36": "literal"]} -run/0: ingredient 0 is 36 -mem/0: storing 36 in location 14 -run/0: instruction main/3 -run/0: {name: "15", value: 15, type: 7, properties: ["15": "point-integer"]} <- copy/1 {name: "12", value: 12, type: 7, properties: ["12": "point-integer"]} -run/0: ingredient 0 is 12 -mem/0: location 12 is 34 -mem/0: location 13 is 35 -mem/0: location 14 is 36 -mem/0: storing 34 in location 15 -mem/0: storing 35 in location 16 -mem/0: storing 36 in location 17 diff --git a/cpp/.traces/copy_indirect b/cpp/.traces/copy_indirect deleted file mode 100644 index 2c5ae938..00000000 --- a/cpp/.traces/copy_indirect +++ /dev/null @@ -1,29 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "deref": ]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "deref": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -mem/0: location 2 is 34 -mem/0: storing 34 in location 3 diff --git a/cpp/.traces/copy_literal b/cpp/.traces/copy_literal deleted file mode 100644 index 3a25bf98..00000000 --- a/cpp/.traces/copy_literal +++ /dev/null @@ -1,11 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1 diff --git a/cpp/.traces/copy_multiple_locations b/cpp/.traces/copy_multiple_locations deleted file mode 100644 index 8014b483..00000000 --- a/cpp/.traces/copy_multiple_locations +++ /dev/null @@ -1,30 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 6, properties: ["1": "point"]} -parse/0: product: {name: "3", value: 0, type: 6, properties: ["3": "point"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 6, properties: ["3": "point"]} <- copy/1 {name: "1", value: 1, type: 6, properties: ["1": "point"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -mem/0: location 2 is 35 -mem/0: storing 34 in location 3 -mem/0: storing 35 in location 4 diff --git a/cpp/.traces/deref_sidesteps_default_space b/cpp/.traces/deref_sidesteps_default_space deleted file mode 100644 index 0592d082..00000000 --- a/cpp/.traces/deref_sidesteps_default_space +++ /dev/null @@ -1,44 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "deref": ]} -parse/0: product: {name: "8", value: 0, type: 1, properties: ["8": "integer", "raw": ]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 3 -run/0: instruction main/1 -run/0: {name: "1000", value: 1000, type: 1, properties: ["1000": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 1000 -run/0: instruction main/2 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "1000", value: 1000, type: 0, properties: ["1000": "literal"]} -run/0: ingredient 0 is 1000 -run/0: instruction main/3 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1002 -run/0: instruction main/4 -run/0: {name: "8", value: 8, type: 1, properties: ["8": "integer", "raw": ]} <- copy/1 {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "deref": ]} -run/0: ingredient 0 is 1 -mem/0: location 1002 is 3 -mem/0: location 3 is 34 -mem/0: storing 34 in location 8 diff --git a/cpp/.traces/deref_sidesteps_default_space_in_get b/cpp/.traces/deref_sidesteps_default_space_in_get deleted file mode 100644 index c4349bca..00000000 --- a/cpp/.traces/deref_sidesteps_default_space_in_get +++ /dev/null @@ -1,57 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "12", value: 0, type: 0, properties: ["12": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point", "deref": ]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: product: {name: "9", value: 0, type: 1, properties: ["9": "integer", "raw": ]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "1000", value: 1000, type: 1, properties: ["1000": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 1000 -run/0: instruction main/3 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "1000", value: 1000, type: 0, properties: ["1000": "literal"]} -run/0: ingredient 0 is 1000 -run/0: instruction main/4 -run/0: {name: "1", value: 1, type: 2-6, properties: ["1": "address":"point"]} <- copy/1 {name: "12", value: 12, type: 0, properties: ["12": "literal"]} -run/0: ingredient 0 is 12 -mem/0: storing 12 in location 1002 -run/0: instruction main/5 -run/0: {name: "9", value: 9, type: 1, properties: ["9": "integer", "raw": ]} <- get/24 {name: "1", value: 1, type: 2-6, properties: ["1": "address":"point", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1002 is 12 -run/0: ingredient 1 is 1 -run/0: address to copy is 13 -run/0: its type is 1 -mem/0: location 13 is 35 -run/0: product 0 is 35 -mem/0: storing 35 in location 9 diff --git a/cpp/.traces/deref_sidesteps_default_space_in_index b/cpp/.traces/deref_sidesteps_default_space_in_index deleted file mode 100644 index b18fd64d..00000000 --- a/cpp/.traces/deref_sidesteps_default_space_in_index +++ /dev/null @@ -1,65 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "12", value: 0, type: 0, properties: ["12": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"integer"]} -parse/0: instruction: index -parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"integer", "deref": ]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "9", value: 0, type: 1, properties: ["9": "integer", "raw": ]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: index ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 14 -run/0: instruction main/3 -run/0: {name: "1000", value: 1000, type: 1, properties: ["1000": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 1000 -run/0: instruction main/4 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "1000", value: 1000, type: 0, properties: ["1000": "literal"]} -run/0: ingredient 0 is 1000 -run/0: instruction main/5 -run/0: {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"integer"]} <- copy/1 {name: "12", value: 12, type: 0, properties: ["12": "literal"]} -run/0: ingredient 0 is 12 -mem/0: storing 12 in location 1002 -run/0: instruction main/6 -run/0: {name: "9", value: 9, type: 1, properties: ["9": "integer", "raw": ]} <- index/26 {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"integer", "deref": ]} -mem/0: location 1002 is 12 -run/0: ingredient 1 is {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: address to copy is 14 -run/0: its type is 1 -mem/0: location 14 is 35 -run/0: product 0 is 35 -mem/0: storing 35 in location 9 diff --git a/cpp/.traces/divide b/cpp/.traces/divide deleted file mode 100644 index 902b84e3..00000000 --- a/cpp/.traces/divide +++ /dev/null @@ -1,33 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "27", value: 0, type: 0, properties: ["27": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: divide -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: divide ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "27", value: 27, type: 0, properties: ["27": "literal"]} -run/0: ingredient 0 is 27 -mem/0: storing 27 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- divide/5 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 27 -run/0: ingredient 1 is 2 -mem/0: location 2 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 9 -mem/0: storing 9 in location 3 diff --git a/cpp/.traces/divide_literal b/cpp/.traces/divide_literal deleted file mode 100644 index 81ed7530..00000000 --- a/cpp/.traces/divide_literal +++ /dev/null @@ -1,15 +0,0 @@ -parse/0: instruction: divide -parse/0: ingredient: {name: "8", value: 0, type: 0, properties: ["8": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: divide ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- divide/5 {name: "8", value: 8, type: 0, properties: ["8": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 8 -run/0: ingredient 1 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 diff --git a/cpp/.traces/divide_with_remainder b/cpp/.traces/divide_with_remainder deleted file mode 100644 index e99c8cf2..00000000 --- a/cpp/.traces/divide_with_remainder +++ /dev/null @@ -1,35 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "27", value: 0, type: 0, properties: ["27": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "11", value: 0, type: 0, properties: ["11": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: divide-with-remainder -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: divide-with-remainder ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "27", value: 27, type: 0, properties: ["27": "literal"]} -run/0: ingredient 0 is 27 -mem/0: storing 27 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "11", value: 11, type: 0, properties: ["11": "literal"]} -run/0: ingredient 0 is 11 -mem/0: storing 11 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]}, {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- divide-with-remainder/6 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 27 -run/0: ingredient 1 is 2 -mem/0: location 2 is 11 -run/0: product 0 is 2 -mem/0: storing 2 in location 3 -run/0: product 1 is 5 -mem/0: storing 5 in location 4 diff --git a/cpp/.traces/divide_with_remainder_literal b/cpp/.traces/divide_with_remainder_literal deleted file mode 100644 index a401ee2e..00000000 --- a/cpp/.traces/divide_with_remainder_literal +++ /dev/null @@ -1,17 +0,0 @@ -parse/0: instruction: divide-with-remainder -parse/0: ingredient: {name: "9", value: 0, type: 0, properties: ["9": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe main -after-brace/0: divide-with-remainder ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- divide-with-remainder/6 {name: "9", value: 9, type: 0, properties: ["9": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 9 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: product 1 is 1 -mem/0: storing 1 in location 2 diff --git a/cpp/.traces/equal b/cpp/.traces/equal deleted file mode 100644 index 52cd0896..00000000 --- a/cpp/.traces/equal +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/equal2 b/cpp/.traces/equal2 deleted file mode 100644 index 6d43f9f1..00000000 --- a/cpp/.traces/equal2 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- equal/13 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 34 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/exclusive_container b/cpp/.traces/exclusive_container deleted file mode 100644 index ec1376fa..00000000 --- a/cpp/.traces/exclusive_container +++ /dev/null @@ -1,5 +0,0 @@ -parse/0: reading exclusive-container foo -parse/0: element name: x -parse/0: type: 1 -parse/0: element name: y -parse/0: type: 1 diff --git a/cpp/.traces/first_recipe b/cpp/.traces/first_recipe deleted file mode 100644 index 5cfc15c8..00000000 --- a/cpp/.traces/first_recipe +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/first_scenario_in_mu b/cpp/.traces/first_scenario_in_mu deleted file mode 100644 index 88e3dbe0..00000000 --- a/cpp/.traces/first_scenario_in_mu +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -after-brace/0: recipe first_scenario_in_mu -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: first_scenario_in_mu -run/0: instruction first_scenario_in_mu/0 -run/0: run/45 {name: " - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: add ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction first_scenario_in_mu/1 -run/0: memory-should-contain/46 {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -run/0: checking location 1 diff --git a/cpp/.traces/get b/cpp/.traces/get deleted file mode 100644 index 50aab6f2..00000000 --- a/cpp/.traces/get +++ /dev/null @@ -1,33 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "12", value: 0, type: 6, properties: ["12": "point"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: product: {name: "15", value: 0, type: 1, properties: ["15": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "15", value: 15, type: 1, properties: ["15": "integer"]} <- get/24 {name: "12", value: 12, type: 6, properties: ["12": "point"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is 1 -run/0: address to copy is 13 -run/0: its type is 1 -mem/0: location 13 is 35 -run/0: product 0 is 35 -mem/0: storing 35 in location 15 diff --git a/cpp/.traces/get_address b/cpp/.traces/get_address deleted file mode 100644 index 7182ed20..00000000 --- a/cpp/.traces/get_address +++ /dev/null @@ -1,31 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: get-address -parse/0: ingredient: {name: "12", value: 0, type: 6, properties: ["12": "point"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: product: {name: "15", value: 0, type: 2-1, properties: ["15": "address":"integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get-address ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "15", value: 15, type: 2-1, properties: ["15": "address":"integer"]} <- get-address/25 {name: "12", value: 12, type: 6, properties: ["12": "point"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is 1 -run/0: address to copy is 13 -run/0: product 0 is 13 -mem/0: storing 13 in location 15 diff --git a/cpp/.traces/get_address_indirect b/cpp/.traces/get_address_indirect deleted file mode 100644 index e8c3c850..00000000 --- a/cpp/.traces/get_address_indirect +++ /dev/null @@ -1,40 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: get-address -parse/0: ingredient: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point", "deref": ]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get-address ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- get-address/25 {name: "1", value: 1, type: 2-6, properties: ["1": "address":"point", "deref": ]}, {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 0 -run/0: address to copy is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 4 diff --git a/cpp/.traces/get_default_space b/cpp/.traces/get_default_space deleted file mode 100644 index bb513849..00000000 --- a/cpp/.traces/get_default_space +++ /dev/null @@ -1,18 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer", "raw": ]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is 10 -run/0: instruction main/1 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer", "raw": ]} <- copy/1 {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -run/0: ingredient 0 is default-space -mem/0: storing 10 in location 1 diff --git a/cpp/.traces/get_handles_nested_container_elements b/cpp/.traces/get_handles_nested_container_elements deleted file mode 100644 index 6ff45ce2..00000000 --- a/cpp/.traces/get_handles_nested_container_elements +++ /dev/null @@ -1,41 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "36", value: 0, type: 0, properties: ["36": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "12", value: 0, type: 7, properties: ["12": "point-integer"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: product: {name: "15", value: 0, type: 1, properties: ["15": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "36", value: 36, type: 0, properties: ["36": "literal"]} -run/0: ingredient 0 is 36 -mem/0: storing 36 in location 14 -run/0: instruction main/3 -run/0: {name: "15", value: 15, type: 1, properties: ["15": "integer"]} <- get/24 {name: "12", value: 12, type: 7, properties: ["12": "point-integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is 1 -run/0: address to copy is 14 -run/0: its type is 1 -mem/0: location 14 is 36 -run/0: product 0 is 36 -mem/0: storing 36 in location 15 diff --git a/cpp/.traces/get_indirect b/cpp/.traces/get_indirect deleted file mode 100644 index 3d176c0c..00000000 --- a/cpp/.traces/get_indirect +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point", "deref": ]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- get/24 {name: "1", value: 1, type: 2-6, properties: ["1": "address":"point", "deref": ]}, {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 0 -run/0: address to copy is 2 -run/0: its type is 1 -mem/0: location 2 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 4 diff --git a/cpp/.traces/greater_or_equal b/cpp/.traces/greater_or_equal deleted file mode 100644 index b03df27c..00000000 --- a/cpp/.traces/greater_or_equal +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: greater-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: greater-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- greater-or-equal/16 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/greater_or_equal2 b/cpp/.traces/greater_or_equal2 deleted file mode 100644 index 6cc4e076..00000000 --- a/cpp/.traces/greater_or_equal2 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: greater-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: greater-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- greater-or-equal/16 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 34 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/greater_or_equal3 b/cpp/.traces/greater_or_equal3 deleted file mode 100644 index aa0e7f60..00000000 --- a/cpp/.traces/greater_or_equal3 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: greater-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: greater-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- greater-or-equal/16 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 35 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/greater_than b/cpp/.traces/greater_than deleted file mode 100644 index 1a56cb8b..00000000 --- a/cpp/.traces/greater_than +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: greater-than -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: greater-than ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- greater-than/14 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/greater_than2 b/cpp/.traces/greater_than2 deleted file mode 100644 index f352176b..00000000 --- a/cpp/.traces/greater_than2 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: greater-than -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: greater-than ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- greater-than/14 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 34 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/include_nonderef_properties b/cpp/.traces/include_nonderef_properties deleted file mode 100644 index d7eacc1a..00000000 --- a/cpp/.traces/include_nonderef_properties +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point", "deref": , "foo": ]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: get ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- get/24 {name: "1", value: 1, type: 2-6, properties: ["1": "address":"point", "deref": , "foo": ]}, {name: "0", value: 0, type: 0, properties: ["0": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 2 -run/0: ingredient 1 is 0 -run/0: address to copy is 2 -run/0: its type is 1 -mem/0: location 2 is 34 -run/0: product 0 is 34 -mem/0: storing 34 in location 4 diff --git a/cpp/.traces/index b/cpp/.traces/index deleted file mode 100644 index 9653e872..00000000 --- a/cpp/.traces/index +++ /dev/null @@ -1,49 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: index -parse/0: ingredient: {name: "1", value: 0, type: 5-1, properties: ["1": "array":"integer"]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: index ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- index/26 {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]} -run/0: ingredient 1 is {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: address to copy is 2 -run/0: its type is 1 -mem/0: location 2 is 14 -run/0: product 0 is 14 -mem/0: storing 14 in location 5 diff --git a/cpp/.traces/index_address b/cpp/.traces/index_address deleted file mode 100644 index c203603f..00000000 --- a/cpp/.traces/index_address +++ /dev/null @@ -1,47 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: index-address -parse/0: ingredient: {name: "1", value: 0, type: 5-1, properties: ["1": "array":"integer"]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: index-address ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- index-address/27 {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 1 -run/0: ingredient 1 is {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: address to copy is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 5 diff --git a/cpp/.traces/index_direct_offset b/cpp/.traces/index_direct_offset deleted file mode 100644 index a20a3d67..00000000 --- a/cpp/.traces/index_direct_offset +++ /dev/null @@ -1,58 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -parse/0: instruction: index -parse/0: ingredient: {name: "1", value: 0, type: 5-1, properties: ["1": "array":"integer"]} -parse/0: ingredient: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -parse/0: product: {name: "6", value: 0, type: 1, properties: ["6": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: index ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 5 -run/0: instruction main/5 -run/0: {name: "6", value: 6, type: 1, properties: ["6": "integer"]} <- index/26 {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]}, {name: "5", value: 5, type: 1, properties: ["5": "integer"]} -run/0: ingredient 0 is {name: "1", value: 1, type: 5-1, properties: ["1": "array":"integer"]} -run/0: ingredient 1 is {name: "5", value: 5, type: 1, properties: ["5": "integer"]} -mem/0: location 5 is 0 -run/0: address to copy is 2 -run/0: its type is 1 -mem/0: location 2 is 14 -run/0: product 0 is 14 -mem/0: storing 14 in location 6 diff --git a/cpp/.traces/index_indirect b/cpp/.traces/index_indirect deleted file mode 100644 index 16489d15..00000000 --- a/cpp/.traces/index_indirect +++ /dev/null @@ -1,58 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "14", value: 0, type: 0, properties: ["14": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "15", value: 0, type: 0, properties: ["15": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "16", value: 0, type: 0, properties: ["16": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "5", value: 0, type: 2-5-1, properties: ["5": "address":"array":"integer"]} -parse/0: instruction: index -parse/0: ingredient: {name: "5", value: 0, type: 2-5-1, properties: ["5": "address":"array":"integer", "deref": ]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "6", value: 0, type: 1, properties: ["6": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: index ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "14", value: 14, type: 0, properties: ["14": "literal"]} -run/0: ingredient 0 is 14 -mem/0: storing 14 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "15", value: 15, type: 0, properties: ["15": "literal"]} -run/0: ingredient 0 is 15 -mem/0: storing 15 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "16", value: 16, type: 0, properties: ["16": "literal"]} -run/0: ingredient 0 is 16 -mem/0: storing 16 in location 4 -run/0: instruction main/4 -run/0: {name: "5", value: 5, type: 2-5-1, properties: ["5": "address":"array":"integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 5 -run/0: instruction main/5 -run/0: {name: "6", value: 6, type: 1, properties: ["6": "integer"]} <- index/26 {name: "5", value: 5, type: 2-5-1, properties: ["5": "address":"array":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is {name: "5", value: 5, type: 2-5-1, properties: ["5": "address":"array":"integer", "deref": ]} -mem/0: location 5 is 1 -run/0: ingredient 1 is {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: address to copy is 3 -run/0: its type is 1 -mem/0: location 3 is 15 -run/0: product 0 is 15 -mem/0: storing 15 in location 6 diff --git a/cpp/.traces/ingredient b/cpp/.traces/ingredient deleted file mode 100644 index e2bc1da4..00000000 --- a/cpp/.traces/ingredient +++ /dev/null @@ -1,25 +0,0 @@ -parse/0: instruction: f -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: instruction: ingredient -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: product: {name: "1", value: 0, type: 3, properties: ["1": "boolean"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: ingredient ... -after-brace/0: next-ingredient ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 {name: "1", value: 1, type: 0, properties: ["1": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction f/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- ingredient/32 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: product 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction f/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]}, {name: "1", value: 1, type: 3, properties: ["1": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1 diff --git a/cpp/.traces/integer-to-decimal-digit-negative b/cpp/.traces/integer-to-decimal-digit-negative deleted file mode 100644 index 9b4328ad..00000000 --- a/cpp/.traces/integer-to-decimal-digit-negative +++ /dev/null @@ -1,611 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- integer-to-decimal-string -1:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string -1:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2 <- 2 - 3 <- 45 # '-' - 4 <- 49 # '1' - ", value: 0, type: 0, properties: [" - 2 <- 2 - 3 <- 45 # '-' - 4 <- 49 # '1' - ": "literal-string"]} -after-brace/0: recipe integer-to-decimal-digit-negative -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: integer-to-decimal-digit-negative -run/0: instruction integer-to-decimal-digit-negative/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- integer-to-decimal-string -1:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string -1:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: integer-to-decimal-string -parse/0: ingredient: {name: "-1", value: 0, type: 0, properties: ["-1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -parse/0: product: {name: "2", value: 0, type: 5-4, properties: ["2": "array":"character", "raw": ]} -after-brace/0: recipe run1001 -after-brace/0: integer-to-decimal-string ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- integer-to-decimal-string/105 {name: "-1", value: -1, type: 0, properties: ["-1": "literal"]} -run/0: instruction integer-to-decimal-string/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction integer-to-decimal-string/1 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]} <- next-ingredient/30 -run/0: product 0 is -1 -mem/0: storing -1 in location 1002 -run/0: instruction integer-to-decimal-string/3 -run/0: break-if/11 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1002 is -1 -run/0: ingredient 0 is -1 -run/0: ingredient 1 is -run/0: jumping to instruction 6 -run/0: instruction integer-to-decimal-string/7 -run/0: {name: "negate-result", value: 3, type: 3, properties: ["negate-result": "boolean"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1004 -run/0: instruction integer-to-decimal-string/9 -run/0: {name: "negative?", value: 4, type: 3, properties: ["negative?": "boolean"]} <- lesser-than/15 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is -1 -run/0: ingredient 1 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1005 -run/0: instruction integer-to-decimal-string/10 -run/0: break-unless/12 {name: "negative?", value: 4, type: 3, properties: ["negative?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1005 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction integer-to-decimal-string/11 -run/0: {name: "negate-result", value: 3, type: 3, properties: ["negate-result": "boolean"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 1004 -run/0: instruction integer-to-decimal-string/12 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]} <- multiply/4 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "-1", value: -1, type: 0, properties: ["-1": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is -1 -run/0: ingredient 1 is -1 -run/0: ingredient 1 is -1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1002 -run/0: instruction integer-to-decimal-string/14 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- init-buffer/101 {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -run/0: instruction init-buffer/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1031 -run/0: instruction init-buffer/1 -run/0: {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} <- new/44 {name: "buffer", value: 9, type: 0, properties: ["buffer": "type"]} -mem/0: new alloc: 1062 -mem/0: storing 1062 in location 1033 -run/0: instruction init-buffer/2 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1034 -run/0: instruction init-buffer/3 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1034 is 1062 -mem/0: storing 0 in location 1062 -run/0: instruction init-buffer/4 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: product 0 is 1063 -mem/0: storing 1063 in location 1035 -run/0: instruction init-buffer/5 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 30 -mem/0: storing 30 in location 1036 -run/0: instruction init-buffer/6 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1036 is 30 -mem/0: array size is 30 -mem/0: new alloc: 1064 -mem/0: location 1035 is 1063 -mem/0: storing 1064 in location 1063 -run/0: instruction init-buffer/7 -run/0: reply/33 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} -mem/0: location 1033 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/15 -run/0: {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]} <- copy/1 {name: "48", value: 48, type: 0, properties: ["48": "literal"]} -run/0: ingredient 0 is 48 -mem/0: storing 48 in location 1007 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 1 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/19 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} <- divide-with-remainder/6 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 1 -run/0: ingredient 1 is 10 -run/0: product 0 is 0 -mem/0: storing 0 in location 1002 -run/0: product 1 is 1 -mem/0: storing 1 in location 1009 -run/0: instruction integer-to-decimal-string/20 -run/0: {name: "c", value: 9, type: 4, properties: ["c": "character"]} <- add/2 {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} -run/0: ingredient 0 is digit-base -mem/0: location 1007 is 48 -run/0: ingredient 1 is digit -mem/0: location 1009 is 1 -run/0: product 0 is 49 -mem/0: storing 49 in location 1010 -run/0: instruction integer-to-decimal-string/21 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- buffer-append/104 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]}, {name: "c", value: 9, type: 4, properties: ["c": "character"]} -mem/0: location 1006 is 1062 -mem/0: location 1010 is 49 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1095 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1097 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 49 -mem/0: storing 49 in location 1098 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1097 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1126 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1128 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1128 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1129 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1128 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1130 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1130 is 1064 -mem/0: storing 30 in location 1131 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1129 is 0 -run/0: ingredient 1 is capacity -mem/0: location 1131 is 30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1132 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1132 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1099 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1099 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1097 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1100 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1097 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1101 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1101 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1100 is 1062 -mem/0: location 1062 is 0 -run/0: address to copy is 1065 -run/0: product 0 is 1065 -mem/0: storing 1065 in location 1102 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1098 is 49 -mem/0: location 1102 is 1065 -mem/0: storing 49 in location 1065 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1100 is 1062 -mem/0: location 1062 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1100 is 1062 -mem/0: storing 1 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1097 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/22 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 17 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 0 -run/0: ingredient 1 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 23 -run/0: instruction integer-to-decimal-string/25 -run/0: break-unless/12 {name: "negate-result", value: 3, type: 3, properties: ["negate-result": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1004 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction integer-to-decimal-string/26 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- buffer-append/104 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]}, {name: "45", value: 45, type: 0, properties: ["45": "literal"]} -mem/0: location 1006 is 1062 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1157 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1159 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 45 -mem/0: storing 45 in location 1160 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1159 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1188 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1190 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1190 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1191 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1190 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1192 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1192 is 1064 -mem/0: storing 30 in location 1193 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1191 is 1 -run/0: ingredient 1 is capacity -mem/0: location 1193 is 30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1194 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1194 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1161 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1161 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1159 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1162 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1159 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1163 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1163 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1162 is 1062 -mem/0: location 1062 is 1 -run/0: address to copy is 1066 -run/0: product 0 is 1066 -mem/0: storing 1066 in location 1164 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1160 is 45 -mem/0: location 1164 is 1066 -mem/0: storing 45 in location 1066 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1162 is 1062 -mem/0: location 1062 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1162 is 1062 -mem/0: storing 2 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1159 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/28 -run/0: {name: "len", value: 10, type: 1, properties: ["len": "integer"]} <- get/24 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is tmp -mem/0: location 1006 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 1011 -run/0: instruction integer-to-decimal-string/29 -run/0: {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is tmp -mem/0: location 1006 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1012 -run/0: instruction integer-to-decimal-string/30 -run/0: {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "len", value: 10, type: 1, properties: ["len": "integer"]} -mem/0: location 1011 is 2 -mem/0: array size is 2 -mem/0: new alloc: 1219 -mem/0: storing 1219 in location 1003 -run/0: instruction integer-to-decimal-string/31 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "len", value: 10, type: 1, properties: ["len": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1011 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1013 -run/0: instruction integer-to-decimal-string/32 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1014 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 1 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/36 -run/0: {name: "src", value: 14, type: 4, properties: ["src": "character"]} <- index/26 {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1064 -run/0: ingredient 1 is {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -mem/0: location 1013 is 1 -run/0: address to copy is 1066 -run/0: its type is 4 -mem/0: location 1066 is 45 -run/0: product 0 is 45 -mem/0: storing 45 in location 1015 -run/0: instruction integer-to-decimal-string/37 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1003 is 1219 -run/0: ingredient 1 is {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -mem/0: location 1014 is 0 -run/0: address to copy is 1220 -run/0: product 0 is 1220 -mem/0: storing 1220 in location 1016 -run/0: instruction integer-to-decimal-string/38 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 14, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1015 is 45 -mem/0: location 1016 is 1220 -mem/0: storing 45 in location 1220 -run/0: instruction integer-to-decimal-string/39 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1013 -run/0: instruction integer-to-decimal-string/40 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 13, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1014 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1014 -run/0: instruction integer-to-decimal-string/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 0 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/36 -run/0: {name: "src", value: 14, type: 4, properties: ["src": "character"]} <- index/26 {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1064 -run/0: ingredient 1 is {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -mem/0: location 1013 is 0 -run/0: address to copy is 1065 -run/0: its type is 4 -mem/0: location 1065 is 49 -run/0: product 0 is 49 -mem/0: storing 49 in location 1015 -run/0: instruction integer-to-decimal-string/37 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1003 is 1219 -run/0: ingredient 1 is {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -mem/0: location 1014 is 1 -run/0: address to copy is 1221 -run/0: product 0 is 1221 -mem/0: storing 1221 in location 1016 -run/0: instruction integer-to-decimal-string/38 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 14, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1015 is 49 -mem/0: location 1016 is 1221 -mem/0: storing 49 in location 1221 -run/0: instruction integer-to-decimal-string/39 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is -1 -mem/0: storing -1 in location 1013 -run/0: instruction integer-to-decimal-string/40 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 13, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1014 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1014 -run/0: instruction integer-to-decimal-string/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is -1 -run/0: ingredient 1 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 42 -run/0: instruction integer-to-decimal-string/43 -run/0: reply/33 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1003 is 1219 -run/0: result 0 is 1219 -mem/0: storing 1219 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 5-4, properties: ["2": "array":"character", "raw": ]} <- copy/1 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1219 -mem/0: location 1219 is 2 -mem/0: location 1220 is 45 -mem/0: location 1221 is 49 -mem/0: storing 2 in location 2 -mem/0: storing 45 in location 3 -mem/0: storing 49 in location 4 -run/0: instruction integer-to-decimal-digit-negative/1 -run/0: memory-should-contain/46 {name: " - 2 <- 2 - 3 <- 45 # '-' - 4 <- 49 # '1' - ", value: 0, type: 0, properties: [" - 2 <- 2 - 3 <- 45 # '-' - 4 <- 49 # '1' - ": "literal-string"]} -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 diff --git a/cpp/.traces/integer-to-decimal-digit-positive b/cpp/.traces/integer-to-decimal-digit-positive deleted file mode 100644 index c722fcab..00000000 --- a/cpp/.traces/integer-to-decimal-digit-positive +++ /dev/null @@ -1,837 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- integer-to-decimal-string 234:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string 234:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2:string <- [234] - ", value: 0, type: 0, properties: [" - 2:string <- [234] - ": "literal-string"]} -after-brace/0: recipe integer-to-decimal-digit-positive -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: integer-to-decimal-digit-positive -run/0: instruction integer-to-decimal-digit-positive/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- integer-to-decimal-string 234:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string 234:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: integer-to-decimal-string -parse/0: ingredient: {name: "234", value: 0, type: 0, properties: ["234": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -parse/0: product: {name: "2", value: 0, type: 5-4, properties: ["2": "array":"character", "raw": ]} -after-brace/0: recipe run1001 -after-brace/0: integer-to-decimal-string ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- integer-to-decimal-string/105 {name: "234", value: 234, type: 0, properties: ["234": "literal"]} -run/0: instruction integer-to-decimal-string/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction integer-to-decimal-string/1 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]} <- next-ingredient/30 -run/0: product 0 is 234 -mem/0: storing 234 in location 1002 -run/0: instruction integer-to-decimal-string/3 -run/0: break-if/11 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1002 is 234 -run/0: ingredient 0 is 234 -run/0: ingredient 1 is -run/0: jumping to instruction 6 -run/0: instruction integer-to-decimal-string/7 -run/0: {name: "negate-result", value: 3, type: 3, properties: ["negate-result": "boolean"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1004 -run/0: instruction integer-to-decimal-string/9 -run/0: {name: "negative?", value: 4, type: 3, properties: ["negative?": "boolean"]} <- lesser-than/15 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 234 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1005 -run/0: instruction integer-to-decimal-string/10 -run/0: break-unless/12 {name: "negative?", value: 4, type: 3, properties: ["negative?": "boolean"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1005 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 13 -run/0: instruction integer-to-decimal-string/14 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- init-buffer/101 {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -run/0: instruction init-buffer/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1031 -run/0: instruction init-buffer/1 -run/0: {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} <- new/44 {name: "buffer", value: 9, type: 0, properties: ["buffer": "type"]} -mem/0: new alloc: 1062 -mem/0: storing 1062 in location 1033 -run/0: instruction init-buffer/2 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1034 -run/0: instruction init-buffer/3 -run/0: {name: "len", value: 2, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1034 is 1062 -mem/0: storing 0 in location 1062 -run/0: instruction init-buffer/4 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1033 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: product 0 is 1063 -mem/0: storing 1063 in location 1035 -run/0: instruction init-buffer/5 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- next-ingredient/30 -run/0: product 0 is 30 -mem/0: storing 30 in location 1036 -run/0: instruction init-buffer/6 -run/0: {name: "s", value: 3, type: 2-2-5-4, properties: ["s": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -mem/0: location 1036 is 30 -mem/0: array size is 30 -mem/0: new alloc: 1064 -mem/0: location 1035 is 1063 -mem/0: storing 1064 in location 1063 -run/0: instruction init-buffer/7 -run/0: reply/33 {name: "result", value: 1, type: 2-9, properties: ["result": "address":"buffer"]} -mem/0: location 1033 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/15 -run/0: {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]} <- copy/1 {name: "48", value: 48, type: 0, properties: ["48": "literal"]} -run/0: ingredient 0 is 48 -mem/0: storing 48 in location 1007 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 234 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/19 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} <- divide-with-remainder/6 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 234 -run/0: ingredient 1 is 10 -run/0: product 0 is 23 -mem/0: storing 23 in location 1002 -run/0: product 1 is 4 -mem/0: storing 4 in location 1009 -run/0: instruction integer-to-decimal-string/20 -run/0: {name: "c", value: 9, type: 4, properties: ["c": "character"]} <- add/2 {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} -run/0: ingredient 0 is digit-base -mem/0: location 1007 is 48 -run/0: ingredient 1 is digit -mem/0: location 1009 is 4 -run/0: product 0 is 52 -mem/0: storing 52 in location 1010 -run/0: instruction integer-to-decimal-string/21 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- buffer-append/104 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]}, {name: "c", value: 9, type: 4, properties: ["c": "character"]} -mem/0: location 1006 is 1062 -mem/0: location 1010 is 52 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1095 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1097 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 52 -mem/0: storing 52 in location 1098 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1097 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1126 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1128 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1128 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1129 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1128 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1130 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1130 is 1064 -mem/0: storing 30 in location 1131 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1129 is 0 -run/0: ingredient 1 is capacity -mem/0: location 1131 is 30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1132 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1132 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1099 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1099 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1097 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1100 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1097 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1101 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1101 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1100 is 1062 -mem/0: location 1062 is 0 -run/0: address to copy is 1065 -run/0: product 0 is 1065 -mem/0: storing 1065 in location 1102 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1098 is 52 -mem/0: location 1102 is 1065 -mem/0: storing 52 in location 1065 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1100 is 1062 -mem/0: location 1062 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1100 is 1062 -mem/0: storing 1 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1097 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/22 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 17 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 23 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/19 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} <- divide-with-remainder/6 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 23 -run/0: ingredient 1 is 10 -run/0: product 0 is 2 -mem/0: storing 2 in location 1002 -run/0: product 1 is 3 -mem/0: storing 3 in location 1009 -run/0: instruction integer-to-decimal-string/20 -run/0: {name: "c", value: 9, type: 4, properties: ["c": "character"]} <- add/2 {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} -run/0: ingredient 0 is digit-base -mem/0: location 1007 is 48 -run/0: ingredient 1 is digit -mem/0: location 1009 is 3 -run/0: product 0 is 51 -mem/0: storing 51 in location 1010 -run/0: instruction integer-to-decimal-string/21 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- buffer-append/104 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]}, {name: "c", value: 9, type: 4, properties: ["c": "character"]} -mem/0: location 1006 is 1062 -mem/0: location 1010 is 51 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1157 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1159 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 51 -mem/0: storing 51 in location 1160 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1159 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1188 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1190 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1190 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1191 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1190 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1192 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1192 is 1064 -mem/0: storing 30 in location 1193 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1191 is 1 -run/0: ingredient 1 is capacity -mem/0: location 1193 is 30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1194 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1194 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1161 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1161 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1159 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1162 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1159 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1163 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1163 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1162 is 1062 -mem/0: location 1062 is 1 -run/0: address to copy is 1066 -run/0: product 0 is 1066 -mem/0: storing 1066 in location 1164 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1160 is 51 -mem/0: location 1164 is 1066 -mem/0: storing 51 in location 1066 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1162 is 1062 -mem/0: location 1062 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1162 is 1062 -mem/0: storing 2 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1159 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/22 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 17 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 2 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/19 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} <- divide-with-remainder/6 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 2 -run/0: ingredient 1 is 10 -run/0: product 0 is 0 -mem/0: storing 0 in location 1002 -run/0: product 1 is 2 -mem/0: storing 2 in location 1009 -run/0: instruction integer-to-decimal-string/20 -run/0: {name: "c", value: 9, type: 4, properties: ["c": "character"]} <- add/2 {name: "digit-base", value: 6, type: 1, properties: ["digit-base": "integer"]}, {name: "digit", value: 8, type: 1, properties: ["digit": "integer"]} -run/0: ingredient 0 is digit-base -mem/0: location 1007 is 48 -run/0: ingredient 1 is digit -mem/0: location 1009 is 2 -run/0: product 0 is 50 -mem/0: storing 50 in location 1010 -run/0: instruction integer-to-decimal-string/21 -run/0: {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]} <- buffer-append/104 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer"]}, {name: "c", value: 9, type: 4, properties: ["c": "character"]} -mem/0: location 1006 is 1062 -mem/0: location 1010 is 50 -run/0: instruction buffer-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1219 -run/0: instruction buffer-append/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1221 -run/0: instruction buffer-append/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 50 -mem/0: storing 50 in location 1222 -run/0: instruction buffer-append/4 -run/0: {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]} <- buffer-full?/103 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} -mem/0: location 1221 is 1062 -run/0: instruction buffer-full?/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1250 -run/0: instruction buffer-full?/1 -run/0: {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer"]} <- next-ingredient/30 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1252 -run/0: instruction buffer-full?/2 -run/0: {name: "len", value: 2, type: 1, properties: ["len": "integer"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1252 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 2 -run/0: product 0 is 2 -mem/0: storing 2 in location 1253 -run/0: instruction buffer-full?/3 -run/0: {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1252 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1254 -run/0: instruction buffer-full?/4 -run/0: {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} <- length/28 {name: "s", value: 3, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]} -mem/0: location 1254 is 1064 -mem/0: storing 30 in location 1255 -run/0: instruction buffer-full?/5 -run/0: {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} <- greater-or-equal/16 {name: "len", value: 2, type: 1, properties: ["len": "integer"]}, {name: "capacity", value: 4, type: 1, properties: ["capacity": "integer"]} -run/0: ingredient 0 is len -mem/0: location 1253 is 2 -run/0: ingredient 1 is capacity -mem/0: location 1255 is 30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1256 -run/0: instruction buffer-full?/6 -run/0: reply/33 {name: "result", value: 5, type: 3, properties: ["result": "boolean"]} -mem/0: location 1256 is 0 -run/0: result 0 is 0 -mem/0: storing 0 in location 1223 -run/0: instruction buffer-append/5 -run/0: break-unless/12 {name: "full?", value: 3, type: 3, properties: ["full?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1223 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 7 -run/0: instruction buffer-append/8 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer"]} <- get-address/25 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1221 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: product 0 is 1062 -mem/0: storing 1062 in location 1224 -run/0: instruction buffer-append/9 -run/0: {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character"]} <- get/24 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is in -mem/0: location 1221 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1225 -run/0: instruction buffer-append/10 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "s", value: 5, type: 2-5-4, properties: ["s": "address":"array":"character", "deref": ]}, {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -run/0: ingredient 0 is s -mem/0: location 1225 is 1064 -run/0: ingredient 1 is {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} -mem/0: location 1224 is 1062 -mem/0: location 1062 is 2 -run/0: address to copy is 1067 -run/0: product 0 is 1067 -mem/0: storing 1067 in location 1226 -run/0: instruction buffer-append/11 -run/0: {name: "dest", value: 6, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1222 is 50 -mem/0: location 1226 is 1067 -mem/0: storing 50 in location 1067 -run/0: instruction buffer-append/12 -run/0: {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]} <- add/2 {name: "len", value: 4, type: 2-1, properties: ["len": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1224 is 1062 -mem/0: location 1062 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1224 is 1062 -mem/0: storing 3 in location 1062 -run/0: instruction buffer-append/13 -run/0: reply/33 {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buffer", "same-as-ingredient": "0"]} -mem/0: location 1221 is 1062 -run/0: result 0 is 1062 -mem/0: storing 1062 in location 1006 -run/0: instruction integer-to-decimal-string/22 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 17 -run/0: instruction integer-to-decimal-string/17 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- equal/13 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is n -mem/0: location 1002 is 0 -run/0: ingredient 1 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1008 -run/0: instruction integer-to-decimal-string/18 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1008 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 23 -run/0: instruction integer-to-decimal-string/25 -run/0: break-unless/12 {name: "negate-result", value: 3, type: 3, properties: ["negate-result": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1004 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 27 -run/0: instruction integer-to-decimal-string/28 -run/0: {name: "len", value: 10, type: 1, properties: ["len": "integer"]} <- get/24 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]} -run/0: ingredient 0 is tmp -mem/0: location 1006 is 1062 -run/0: ingredient 1 is length -run/0: address to copy is 1062 -run/0: its type is 1 -mem/0: location 1062 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1011 -run/0: instruction integer-to-decimal-string/29 -run/0: {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "tmp", value: 5, type: 2-9, properties: ["tmp": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is tmp -mem/0: location 1006 is 1062 -run/0: ingredient 1 is data -run/0: address to copy is 1063 -run/0: its type is 2 -mem/0: location 1063 is 1064 -run/0: product 0 is 1064 -mem/0: storing 1064 in location 1012 -run/0: instruction integer-to-decimal-string/30 -run/0: {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "len", value: 10, type: 1, properties: ["len": "integer"]} -mem/0: location 1011 is 3 -mem/0: array size is 3 -mem/0: new alloc: 1281 -mem/0: storing 1281 in location 1003 -run/0: instruction integer-to-decimal-string/31 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "len", value: 10, type: 1, properties: ["len": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is len -mem/0: location 1011 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1013 -run/0: instruction integer-to-decimal-string/32 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1014 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 2 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/36 -run/0: {name: "src", value: 14, type: 4, properties: ["src": "character"]} <- index/26 {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1064 -run/0: ingredient 1 is {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -mem/0: location 1013 is 2 -run/0: address to copy is 1067 -run/0: its type is 4 -mem/0: location 1067 is 50 -run/0: product 0 is 50 -mem/0: storing 50 in location 1015 -run/0: instruction integer-to-decimal-string/37 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1003 is 1281 -run/0: ingredient 1 is {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -mem/0: location 1014 is 0 -run/0: address to copy is 1282 -run/0: product 0 is 1282 -mem/0: storing 1282 in location 1016 -run/0: instruction integer-to-decimal-string/38 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 14, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1015 is 50 -mem/0: location 1016 is 1282 -mem/0: storing 50 in location 1282 -run/0: instruction integer-to-decimal-string/39 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1013 -run/0: instruction integer-to-decimal-string/40 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 13, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1014 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1014 -run/0: instruction integer-to-decimal-string/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 1 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/36 -run/0: {name: "src", value: 14, type: 4, properties: ["src": "character"]} <- index/26 {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1064 -run/0: ingredient 1 is {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -mem/0: location 1013 is 1 -run/0: address to copy is 1066 -run/0: its type is 4 -mem/0: location 1066 is 51 -run/0: product 0 is 51 -mem/0: storing 51 in location 1015 -run/0: instruction integer-to-decimal-string/37 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1003 is 1281 -run/0: ingredient 1 is {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -mem/0: location 1014 is 1 -run/0: address to copy is 1283 -run/0: product 0 is 1283 -mem/0: storing 1283 in location 1016 -run/0: instruction integer-to-decimal-string/38 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 14, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1015 is 51 -mem/0: location 1016 is 1283 -mem/0: storing 51 in location 1283 -run/0: instruction integer-to-decimal-string/39 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 1013 -run/0: instruction integer-to-decimal-string/40 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 13, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1014 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1014 -run/0: instruction integer-to-decimal-string/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 0 -run/0: ingredient 1 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/36 -run/0: {name: "src", value: 14, type: 4, properties: ["src": "character"]} <- index/26 {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "buf", value: 11, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1064 -run/0: ingredient 1 is {name: "i", value: 12, type: 1, properties: ["i": "integer"]} -mem/0: location 1013 is 0 -run/0: address to copy is 1065 -run/0: its type is 4 -mem/0: location 1065 is 52 -run/0: product 0 is 52 -mem/0: storing 52 in location 1015 -run/0: instruction integer-to-decimal-string/37 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character"]} <- index-address/27 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1003 is 1281 -run/0: ingredient 1 is {name: "j", value: 13, type: 1, properties: ["j": "integer"]} -mem/0: location 1014 is 2 -run/0: address to copy is 1284 -run/0: product 0 is 1284 -mem/0: storing 1284 in location 1016 -run/0: instruction integer-to-decimal-string/38 -run/0: {name: "dest", value: 15, type: 2-4, properties: ["dest": "address":"character", "deref": ]} <- copy/1 {name: "src", value: 14, type: 4, properties: ["src": "character"]} -run/0: ingredient 0 is src -mem/0: location 1015 is 52 -mem/0: location 1016 is 1284 -mem/0: storing 52 in location 1284 -run/0: instruction integer-to-decimal-string/39 -run/0: {name: "i", value: 12, type: 1, properties: ["i": "integer"]} <- subtract/3 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is -1 -mem/0: storing -1 in location 1013 -run/0: instruction integer-to-decimal-string/40 -run/0: {name: "j", value: 13, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 13, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1014 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1014 -run/0: instruction integer-to-decimal-string/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction integer-to-decimal-string/34 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- lesser-than/15 {name: "i", value: 12, type: 1, properties: ["i": "integer"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1013 is -1 -run/0: ingredient 1 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 1008 -run/0: instruction integer-to-decimal-string/35 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1008 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 42 -run/0: instruction integer-to-decimal-string/43 -run/0: reply/33 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1003 is 1281 -run/0: result 0 is 1281 -mem/0: storing 1281 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 5-4, properties: ["2": "array":"character", "raw": ]} <- copy/1 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1281 -mem/0: location 1281 is 3 -mem/0: location 1282 is 50 -mem/0: location 1283 is 51 -mem/0: location 1284 is 52 -mem/0: storing 3 in location 2 -mem/0: storing 50 in location 3 -mem/0: storing 51 in location 4 -mem/0: storing 52 in location 5 -run/0: instruction integer-to-decimal-digit-positive/1 -run/0: memory-should-contain/46 {name: " - 2:string <- [234] - ", value: 0, type: 0, properties: [" - 2:string <- [234] - ": "literal-string"]} -run/0: checking string length at 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 diff --git a/cpp/.traces/integer-to-decimal-digit-zero b/cpp/.traces/integer-to-decimal-digit-zero deleted file mode 100644 index 85cb42d4..00000000 --- a/cpp/.traces/integer-to-decimal-digit-zero +++ /dev/null @@ -1,75 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- integer-to-decimal-string 0:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string 0:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 2:string <- [0] - ", value: 0, type: 0, properties: [" - 2:string <- [0] - ": "literal-string"]} -after-brace/0: recipe integer-to-decimal-digit-zero -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: integer-to-decimal-digit-zero -run/0: instruction integer-to-decimal-digit-zero/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- integer-to-decimal-string 0:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- integer-to-decimal-string 0:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ": "literal-string"]} -parse/0: instruction: integer-to-decimal-string -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -parse/0: product: {name: "2", value: 0, type: 5-4, properties: ["2": "array":"character", "raw": ]} -after-brace/0: recipe run1001 -after-brace/0: integer-to-decimal-string ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- integer-to-decimal-string/105 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: instruction integer-to-decimal-string/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction integer-to-decimal-string/1 -run/0: {name: "n", value: 1, type: 1, properties: ["n": "integer"]} <- next-ingredient/30 -run/0: product 0 is 0 -mem/0: storing 0 in location 1002 -run/0: instruction integer-to-decimal-string/3 -run/0: break-if/11 {name: "n", value: 1, type: 1, properties: ["n": "integer"]}, {name: "", value: 2, type: , properties: ["": ]} -mem/0: location 1002 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction integer-to-decimal-string/4 -run/0: {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "0", value: 0, type: 0, properties: ["0": "literal-string"]} -mem/0: storing 1031 in location 1003 -run/0: instruction integer-to-decimal-string/5 -run/0: reply/33 {name: "result", value: 2, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1003 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 5-4, properties: ["2": "array":"character", "raw": ]} <- copy/1 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": , "raw": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -mem/0: location 1031 is 1 -mem/0: location 1032 is 48 -mem/0: storing 1 in location 2 -mem/0: storing 48 in location 3 -run/0: instruction integer-to-decimal-digit-zero/1 -run/0: memory-should-contain/46 {name: " - 2:string <- [0] - ", value: 0, type: 0, properties: [" - 2:string <- [0] - ": "literal-string"]} -run/0: checking string length at 2 -run/0: checking location 3 diff --git a/cpp/.traces/interpolate-at-end b/cpp/.traces/interpolate-at-end deleted file mode 100644 index 6d411983..00000000 --- a/cpp/.traces/interpolate-at-end +++ /dev/null @@ -1,944 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- new [hello, _] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [hello, _] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 4:string <- [hello, abc] - ", value: 0, type: 0, properties: [" - 4:string <- [hello, abc] - ": "literal-string"]} -after-brace/0: recipe interpolate-at-end -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: interpolate-at-end -run/0: instruction interpolate-at-end/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- new [hello, _] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [hello, _] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "hello, _", value: 0, type: 0, properties: ["hello, _": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: instruction: interpolate -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -parse/0: product: {name: "4", value: 0, type: 5-4, properties: ["4": "array":"character", "raw": ]} -new/0: hello, _ -> 0 -new/0: abc -> 0 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: interpolate ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- new/44 {name: "hello, _", value: 0, type: 0, properties: ["hello, _": "literal-string"]} -mem/0: storing 1000 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1009 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} <- interpolate/107 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]}, {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -mem/0: location 1 is 1000 -mem/0: location 2 is 1009 -run/0: instruction interpolate/0 -run/0: {name: "default-space", value: 0, type: 5-2-1, properties: ["default-space": "array":"address":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "60", value: 60, type: 0, properties: ["60": "literal"]} -mem/0: array size is 60 -mem/0: new alloc: 1013 -run/0: instruction interpolate/1 -run/0: {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1015 -run/0: instruction interpolate/2 -run/0: {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} <- length/28 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -mem/0: storing 8 in location 1016 -run/0: instruction interpolate/3 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- copy/1 {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is tem-len -mem/0: location 1016 is 8 -mem/0: storing 8 in location 1017 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1009 -mem/0: storing 1009 in location 1018 -mem/0: storing 1 in location 1019 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1019 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/7 -run/0: {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1018 is 1009 -mem/0: storing 3 in location 1020 -run/0: instruction interpolate/8 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- add/2 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is result-len -mem/0: location 1017 is 8 -run/0: ingredient 1 is a-len -mem/0: location 1020 is 3 -run/0: product 0 is 11 -mem/0: storing 11 in location 1017 -run/0: instruction interpolate/9 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- subtract/3 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-len -mem/0: location 1017 is 11 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1017 -run/0: instruction interpolate/10 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 5 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1019 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1019 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction interpolate/12 -run/0: rewind-ingredients/31 -run/0: instruction interpolate/13 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} <- next-ingredient/30 -run/0: product 0 is 1000 -run/0: instruction interpolate/14 -run/0: {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} -mem/0: location 1017 is 10 -mem/0: array size is 10 -mem/0: new alloc: 1074 -mem/0: storing 1074 in location 1021 -run/0: instruction interpolate/15 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1022 -run/0: instruction interpolate/16 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1009 -mem/0: storing 1009 in location 1018 -mem/0: storing 1 in location 1019 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1019 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 0 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 104 -run/0: product 0 is 104 -mem/0: storing 104 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 104 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 0 -run/0: address to copy is 1075 -run/0: product 0 is 1075 -mem/0: storing 1075 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 104 -mem/0: location 1027 is 1075 -mem/0: storing 104 in location 1075 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 1 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 101 -run/0: product 0 is 101 -mem/0: storing 101 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 101 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 1 -run/0: address to copy is 1076 -run/0: product 0 is 1076 -mem/0: storing 1076 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 101 -mem/0: location 1027 is 1076 -mem/0: storing 101 in location 1076 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 2 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 108 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 2 -run/0: address to copy is 1077 -run/0: product 0 is 1077 -mem/0: storing 1077 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 108 -mem/0: location 1027 is 1077 -mem/0: storing 108 in location 1077 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 3 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 3 -run/0: address to copy is 1004 -run/0: its type is 4 -mem/0: location 1004 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 108 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 3 -run/0: address to copy is 1078 -run/0: product 0 is 1078 -mem/0: storing 1078 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 108 -mem/0: location 1027 is 1078 -mem/0: storing 108 in location 1078 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 4 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 4 -run/0: address to copy is 1005 -run/0: its type is 4 -mem/0: location 1005 is 111 -run/0: product 0 is 111 -mem/0: storing 111 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 111 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 4 -run/0: address to copy is 1079 -run/0: product 0 is 1079 -mem/0: storing 1079 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 111 -mem/0: location 1027 is 1079 -mem/0: storing 111 in location 1079 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 5 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 5 -run/0: address to copy is 1006 -run/0: its type is 4 -mem/0: location 1006 is 44 -run/0: product 0 is 44 -mem/0: storing 44 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 44 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 5 -run/0: address to copy is 1080 -run/0: product 0 is 1080 -mem/0: storing 1080 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 44 -mem/0: location 1027 is 1080 -mem/0: storing 44 in location 1080 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 6 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 6 -run/0: address to copy is 1007 -run/0: its type is 4 -mem/0: location 1007 is 32 -run/0: product 0 is 32 -mem/0: storing 32 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 32 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 6 -run/0: address to copy is 1081 -run/0: product 0 is 1081 -mem/0: storing 1081 in location 1027 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 32 -mem/0: location 1027 is 1081 -mem/0: storing 32 in location 1081 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1023 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1022 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 7 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1024 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1023 is 7 -run/0: address to copy is 1008 -run/0: its type is 4 -mem/0: location 1008 is 95 -run/0: product 0 is 95 -mem/0: storing 95 in location 1025 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 95 -run/0: ingredient 1 is 95 -run/0: product 0 is 1 -mem/0: storing 1 in location 1026 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1026 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 31 -run/0: instruction interpolate/32 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1020 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1029 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1029 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1018 is 1009 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1028 is 0 -run/0: address to copy is 1010 -run/0: its type is 4 -mem/0: location 1010 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1025 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 7 -run/0: address to copy is 1082 -run/0: product 0 is 1082 -mem/0: storing 1082 in location 1027 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 97 -mem/0: location 1027 is 1082 -mem/0: storing 97 in location 1082 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1028 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1022 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1020 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1029 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1029 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1018 is 1009 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1028 is 1 -run/0: address to copy is 1011 -run/0: its type is 4 -mem/0: location 1011 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1025 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 8 -run/0: address to copy is 1083 -run/0: product 0 is 1083 -mem/0: storing 1083 in location 1027 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 98 -mem/0: location 1027 is 1083 -mem/0: storing 98 in location 1083 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1028 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1022 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1020 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1029 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1029 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1018 is 1009 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1028 is 2 -run/0: address to copy is 1012 -run/0: its type is 4 -mem/0: location 1012 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1025 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1021 is 1074 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1022 is 9 -run/0: address to copy is 1084 -run/0: product 0 is 1084 -mem/0: storing 1084 in location 1027 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1025 is 99 -mem/0: location 1027 is 1084 -mem/0: storing 99 in location 1084 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1028 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1022 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1022 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1028 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1020 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1029 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1029 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 42 -run/0: instruction interpolate/43 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1023 -run/0: instruction interpolate/44 -run/0: loop/10 {name: "", value: -27, type: , properties: ["": ]} -run/0: ingredient 0 is -27 -run/0: jumping to instruction 18 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1019 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1019 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 45 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1023 is 8 -run/0: ingredient 1 is tem-len -mem/0: location 1016 is 8 -run/0: product 0 is 1 -mem/0: storing 1 in location 1024 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1024 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 55 -run/0: instruction interpolate/56 -run/0: reply/33 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1021 is 1074 -run/0: result 0 is 1074 -mem/0: storing 1074 in location 3 -run/0: instruction run1001/3 -run/0: {name: "4", value: 4, type: 5-4, properties: ["4": "array":"character", "raw": ]} <- copy/1 {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -run/0: ingredient 0 is 3 -mem/0: location 3 is 1074 -mem/0: location 1074 is 10 -mem/0: location 1075 is 104 -mem/0: location 1076 is 101 -mem/0: location 1077 is 108 -mem/0: location 1078 is 108 -mem/0: location 1079 is 111 -mem/0: location 1080 is 44 -mem/0: location 1081 is 32 -mem/0: location 1082 is 97 -mem/0: location 1083 is 98 -mem/0: location 1084 is 99 -mem/0: storing 10 in location 4 -mem/0: storing 104 in location 5 -mem/0: storing 101 in location 6 -mem/0: storing 108 in location 7 -mem/0: storing 108 in location 8 -mem/0: storing 111 in location 9 -mem/0: storing 44 in location 10 -mem/0: storing 32 in location 11 -mem/0: storing 97 in location 12 -mem/0: storing 98 in location 13 -mem/0: storing 99 in location 14 -run/0: instruction interpolate-at-end/1 -run/0: memory-should-contain/46 {name: " - 4:string <- [hello, abc] - ", value: 0, type: 0, properties: [" - 4:string <- [hello, abc] - ": "literal-string"]} -run/0: checking string length at 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 -run/0: checking location 9 -run/0: checking location 10 -run/0: checking location 11 -run/0: checking location 12 -run/0: checking location 13 -run/0: checking location 14 diff --git a/cpp/.traces/interpolate-at-start b/cpp/.traces/interpolate-at-start deleted file mode 100644 index 5a6164e7..00000000 --- a/cpp/.traces/interpolate-at-start +++ /dev/null @@ -1,925 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- new [_, hello!] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [_, hello!] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 4:string <- [abc, hello!] - 16 <- 0 # out of bounds - ", value: 0, type: 0, properties: [" - 4:string <- [abc, hello!] - 16 <- 0 # out of bounds - ": "literal-string"]} -after-brace/0: recipe interpolate-at-start -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: interpolate-at-start -run/0: instruction interpolate-at-start/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- new [_, hello!] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [_, hello!] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "_, hello!", value: 0, type: 0, properties: ["_, hello!": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: instruction: interpolate -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -parse/0: product: {name: "4", value: 0, type: 5-4, properties: ["4": "array":"character", "raw": ]} -new/0: _, hello! -> 0 -new/0: abc -> 0 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: interpolate ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- new/44 {name: "_, hello!", value: 0, type: 0, properties: ["_, hello!": "literal-string"]} -mem/0: storing 1000 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1010 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} <- interpolate/107 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]}, {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -mem/0: location 1 is 1000 -mem/0: location 2 is 1010 -run/0: instruction interpolate/0 -run/0: {name: "default-space", value: 0, type: 5-2-1, properties: ["default-space": "array":"address":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "60", value: 60, type: 0, properties: ["60": "literal"]} -mem/0: array size is 60 -mem/0: new alloc: 1014 -run/0: instruction interpolate/1 -run/0: {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1016 -run/0: instruction interpolate/2 -run/0: {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} <- length/28 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -mem/0: storing 9 in location 1017 -run/0: instruction interpolate/3 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- copy/1 {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is tem-len -mem/0: location 1017 is 9 -mem/0: storing 9 in location 1018 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1010 -mem/0: storing 1010 in location 1019 -mem/0: storing 1 in location 1020 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1020 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/7 -run/0: {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1010 -mem/0: storing 3 in location 1021 -run/0: instruction interpolate/8 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- add/2 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is result-len -mem/0: location 1018 is 9 -run/0: ingredient 1 is a-len -mem/0: location 1021 is 3 -run/0: product 0 is 12 -mem/0: storing 12 in location 1018 -run/0: instruction interpolate/9 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- subtract/3 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-len -mem/0: location 1018 is 12 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1018 -run/0: instruction interpolate/10 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 5 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1020 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1020 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction interpolate/12 -run/0: rewind-ingredients/31 -run/0: instruction interpolate/13 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} <- next-ingredient/30 -run/0: product 0 is 1000 -run/0: instruction interpolate/14 -run/0: {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} -mem/0: location 1018 is 11 -mem/0: array size is 11 -mem/0: new alloc: 1075 -mem/0: storing 1075 in location 1022 -run/0: instruction interpolate/15 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/16 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1010 -mem/0: storing 1010 in location 1019 -mem/0: storing 1 in location 1020 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1020 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 95 -run/0: product 0 is 95 -mem/0: storing 95 in location 1026 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 95 -run/0: ingredient 1 is 95 -run/0: product 0 is 1 -mem/0: storing 1 in location 1027 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1027 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 31 -run/0: instruction interpolate/32 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1029 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1021 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1030 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1030 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1010 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1029 is 0 -run/0: address to copy is 1011 -run/0: its type is 4 -mem/0: location 1011 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1026 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 0 -run/0: address to copy is 1076 -run/0: product 0 is 1076 -mem/0: storing 1076 in location 1028 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 97 -mem/0: location 1028 is 1076 -mem/0: storing 97 in location 1076 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1029 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1023 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1021 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1030 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1030 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1010 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1029 is 1 -run/0: address to copy is 1012 -run/0: its type is 4 -mem/0: location 1012 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1026 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 1 -run/0: address to copy is 1077 -run/0: product 0 is 1077 -mem/0: storing 1077 in location 1028 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 98 -mem/0: location 1028 is 1077 -mem/0: storing 98 in location 1077 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1029 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1023 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1021 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1030 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1030 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1010 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1029 is 2 -run/0: address to copy is 1013 -run/0: its type is 4 -mem/0: location 1013 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1026 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 2 -run/0: address to copy is 1078 -run/0: product 0 is 1078 -mem/0: storing 1078 in location 1028 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 99 -mem/0: location 1028 is 1078 -mem/0: storing 99 in location 1078 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1029 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1023 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1029 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1021 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1030 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1030 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 42 -run/0: instruction interpolate/43 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1024 -run/0: instruction interpolate/44 -run/0: loop/10 {name: "", value: -27, type: , properties: ["": ]} -run/0: ingredient 0 is -27 -run/0: jumping to instruction 18 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1020 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1020 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 45 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 44 -run/0: product 0 is 44 -mem/0: storing 44 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 3 -run/0: address to copy is 1079 -run/0: product 0 is 1079 -mem/0: storing 1079 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 44 -mem/0: location 1028 is 1079 -mem/0: storing 44 in location 1079 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 32 -run/0: product 0 is 32 -mem/0: storing 32 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 4 -run/0: address to copy is 1080 -run/0: product 0 is 1080 -mem/0: storing 1080 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 32 -mem/0: location 1028 is 1080 -mem/0: storing 32 in location 1080 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 3 -run/0: address to copy is 1004 -run/0: its type is 4 -mem/0: location 1004 is 104 -run/0: product 0 is 104 -mem/0: storing 104 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 5 -run/0: address to copy is 1081 -run/0: product 0 is 1081 -mem/0: storing 1081 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 104 -mem/0: location 1028 is 1081 -mem/0: storing 104 in location 1081 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 4 -run/0: address to copy is 1005 -run/0: its type is 4 -mem/0: location 1005 is 101 -run/0: product 0 is 101 -mem/0: storing 101 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 6 -run/0: address to copy is 1082 -run/0: product 0 is 1082 -mem/0: storing 1082 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 101 -mem/0: location 1028 is 1082 -mem/0: storing 101 in location 1082 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 5 -run/0: address to copy is 1006 -run/0: its type is 4 -mem/0: location 1006 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 7 -run/0: address to copy is 1083 -run/0: product 0 is 1083 -mem/0: storing 1083 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 108 -mem/0: location 1028 is 1083 -mem/0: storing 108 in location 1083 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 6 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 6 -run/0: address to copy is 1007 -run/0: its type is 4 -mem/0: location 1007 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 8 -run/0: address to copy is 1084 -run/0: product 0 is 1084 -mem/0: storing 1084 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 108 -mem/0: location 1028 is 1084 -mem/0: storing 108 in location 1084 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 7 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 7 -run/0: address to copy is 1008 -run/0: its type is 4 -mem/0: location 1008 is 111 -run/0: product 0 is 111 -mem/0: storing 111 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 9 -run/0: address to copy is 1085 -run/0: product 0 is 1085 -mem/0: storing 1085 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 111 -mem/0: location 1028 is 1085 -mem/0: storing 111 in location 1085 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 8 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/49 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1016 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 8 -run/0: address to copy is 1009 -run/0: its type is 4 -mem/0: location 1009 is 33 -run/0: product 0 is 33 -mem/0: storing 33 in location 1026 -run/0: instruction interpolate/50 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1075 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 10 -run/0: address to copy is 1086 -run/0: product 0 is 1086 -mem/0: storing 1086 in location 1028 -run/0: instruction interpolate/51 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1026 is 33 -mem/0: location 1028 is 1086 -mem/0: storing 33 in location 1086 -run/0: instruction interpolate/52 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1024 -run/0: instruction interpolate/53 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 10 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1023 -run/0: instruction interpolate/54 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 47 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 9 -run/0: ingredient 1 is tem-len -mem/0: location 1017 is 9 -run/0: product 0 is 1 -mem/0: storing 1 in location 1025 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 55 -run/0: instruction interpolate/56 -run/0: reply/33 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1022 is 1075 -run/0: result 0 is 1075 -mem/0: storing 1075 in location 3 -run/0: instruction run1001/3 -run/0: {name: "4", value: 4, type: 5-4, properties: ["4": "array":"character", "raw": ]} <- copy/1 {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -run/0: ingredient 0 is 3 -mem/0: location 3 is 1075 -mem/0: location 1075 is 11 -mem/0: location 1076 is 97 -mem/0: location 1077 is 98 -mem/0: location 1078 is 99 -mem/0: location 1079 is 44 -mem/0: location 1080 is 32 -mem/0: location 1081 is 104 -mem/0: location 1082 is 101 -mem/0: location 1083 is 108 -mem/0: location 1084 is 108 -mem/0: location 1085 is 111 -mem/0: location 1086 is 33 -mem/0: storing 11 in location 4 -mem/0: storing 97 in location 5 -mem/0: storing 98 in location 6 -mem/0: storing 99 in location 7 -mem/0: storing 44 in location 8 -mem/0: storing 32 in location 9 -mem/0: storing 104 in location 10 -mem/0: storing 101 in location 11 -mem/0: storing 108 in location 12 -mem/0: storing 108 in location 13 -mem/0: storing 111 in location 14 -mem/0: storing 33 in location 15 -run/0: instruction interpolate-at-start/1 -run/0: memory-should-contain/46 {name: " - 4:string <- [abc, hello!] - 16 <- 0 # out of bounds - ", value: 0, type: 0, properties: [" - 4:string <- [abc, hello!] - 16 <- 0 # out of bounds - ": "literal-string"]} -run/0: checking string length at 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 -run/0: checking location 9 -run/0: checking location 10 -run/0: checking location 11 -run/0: checking location 12 -run/0: checking location 13 -run/0: checking location 14 -run/0: checking location 15 -run/0: checking location 16 diff --git a/cpp/.traces/interpolate-works b/cpp/.traces/interpolate-works deleted file mode 100644 index b9d98164..00000000 --- a/cpp/.traces/interpolate-works +++ /dev/null @@ -1,728 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- new [abc _] - 2:address:array:character/raw <- new [def] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [abc _] - 2:address:array:character/raw <- new [def] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 4:string <- [abc def] - ", value: 0, type: 0, properties: [" - 4:string <- [abc def] - ": "literal-string"]} -after-brace/0: recipe interpolate-works -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: interpolate-works -run/0: instruction interpolate-works/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- new [abc _] - 2:address:array:character/raw <- new [def] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [abc _] - 2:address:array:character/raw <- new [def] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc _", value: 0, type: 0, properties: ["abc _": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "def", value: 0, type: 0, properties: ["def": "literal-string"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: instruction: interpolate -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -parse/0: product: {name: "4", value: 0, type: 5-4, properties: ["4": "array":"character", "raw": ]} -new/0: abc _ -> 0 -new/0: def -> 0 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: interpolate ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- new/44 {name: "abc _", value: 0, type: 0, properties: ["abc _": "literal-string"]} -mem/0: storing 1000 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} <- new/44 {name: "def", value: 0, type: 0, properties: ["def": "literal-string"]} -mem/0: storing 1006 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} <- interpolate/107 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]}, {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -mem/0: location 1 is 1000 -mem/0: location 2 is 1006 -run/0: instruction interpolate/0 -run/0: {name: "default-space", value: 0, type: 5-2-1, properties: ["default-space": "array":"address":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "60", value: 60, type: 0, properties: ["60": "literal"]} -mem/0: array size is 60 -mem/0: new alloc: 1010 -run/0: instruction interpolate/1 -run/0: {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1012 -run/0: instruction interpolate/2 -run/0: {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} <- length/28 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -mem/0: storing 5 in location 1013 -run/0: instruction interpolate/3 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- copy/1 {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is tem-len -mem/0: location 1013 is 5 -mem/0: storing 5 in location 1014 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1006 -mem/0: storing 1006 in location 1015 -mem/0: storing 1 in location 1016 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1016 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/7 -run/0: {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1006 -mem/0: storing 3 in location 1017 -run/0: instruction interpolate/8 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- add/2 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is result-len -mem/0: location 1014 is 5 -run/0: ingredient 1 is a-len -mem/0: location 1017 is 3 -run/0: product 0 is 8 -mem/0: storing 8 in location 1014 -run/0: instruction interpolate/9 -run/0: {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} <- subtract/3 {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-len -mem/0: location 1014 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1014 -run/0: instruction interpolate/10 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 5 -run/0: instruction interpolate/5 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1016 -run/0: instruction interpolate/6 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1016 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction interpolate/12 -run/0: rewind-ingredients/31 -run/0: instruction interpolate/13 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} <- next-ingredient/30 -run/0: product 0 is 1000 -run/0: instruction interpolate/14 -run/0: {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "result-len", value: 3, type: 1, properties: ["result-len": "integer"]} -mem/0: location 1014 is 7 -mem/0: array size is 7 -mem/0: new alloc: 1071 -mem/0: storing 1071 in location 1018 -run/0: instruction interpolate/15 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1019 -run/0: instruction interpolate/16 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1020 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 1006 -mem/0: storing 1006 in location 1015 -mem/0: storing 1 in location 1016 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1016 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 0 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1021 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1021 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1020 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1022 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 97 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1023 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 0 -run/0: address to copy is 1072 -run/0: product 0 is 1072 -mem/0: storing 1072 in location 1024 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 97 -mem/0: location 1024 is 1072 -mem/0: storing 97 in location 1072 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1020 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1019 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 1 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1021 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1021 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1020 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1022 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 98 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1023 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 1 -run/0: address to copy is 1073 -run/0: product 0 is 1073 -mem/0: storing 1073 in location 1024 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 98 -mem/0: location 1024 is 1073 -mem/0: storing 98 in location 1073 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1020 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1019 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 2 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1021 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1021 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1020 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1022 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 99 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1023 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 2 -run/0: address to copy is 1074 -run/0: product 0 is 1074 -mem/0: storing 1074 in location 1024 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 99 -mem/0: location 1024 is 1074 -mem/0: storing 99 in location 1074 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1020 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1019 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 3 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1021 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1021 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1020 is 3 -run/0: address to copy is 1004 -run/0: its type is 4 -mem/0: location 1004 is 32 -run/0: product 0 is 32 -mem/0: storing 32 in location 1022 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 32 -run/0: ingredient 1 is 95 -run/0: product 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1023 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/26 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 3 -run/0: address to copy is 1075 -run/0: product 0 is 1075 -mem/0: storing 1075 in location 1024 -run/0: instruction interpolate/27 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 32 -mem/0: location 1024 is 1075 -mem/0: storing 32 in location 1075 -run/0: instruction interpolate/28 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1020 -run/0: instruction interpolate/29 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1019 -run/0: instruction interpolate/30 -run/0: loop/10 {name: "", value: -10, type: , properties: ["": ]} -run/0: ingredient 0 is -10 -run/0: jumping to instruction 21 -run/0: instruction interpolate/21 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 4 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1021 -run/0: instruction interpolate/22 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "2", value: 2, type: 0, properties: ["2": "blocks"]} -mem/0: location 1021 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/23 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]}, {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "template", value: 1, type: 2-5-4, properties: ["template": "address":"array":"character", "deref": ]} -mem/0: location 1012 is 1000 -run/0: ingredient 1 is {name: "i", value: 9, type: 1, properties: ["i": "integer"]} -mem/0: location 1020 is 4 -run/0: address to copy is 1005 -run/0: its type is 4 -mem/0: location 1005 is 95 -run/0: product 0 is 95 -mem/0: storing 95 in location 1022 -run/0: instruction interpolate/24 -run/0: {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]} <- equal/13 {name: "in", value: 11, type: 4, properties: ["in": "character"]}, {name: "95", value: 95, type: 0, properties: ["95": "literal"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 95 -run/0: ingredient 1 is 95 -run/0: product 0 is 1 -mem/0: storing 1 in location 1023 -run/0: instruction interpolate/25 -run/0: break-if/11 {name: "underscore?", value: 12, type: 3, properties: ["underscore?": "boolean"]}, {name: "", value: 5, type: , properties: ["": ]} -mem/0: location 1023 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 31 -run/0: instruction interpolate/32 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1017 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1006 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1025 is 0 -run/0: address to copy is 1007 -run/0: its type is 4 -mem/0: location 1007 is 100 -run/0: product 0 is 100 -mem/0: storing 100 in location 1022 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 4 -run/0: address to copy is 1076 -run/0: product 0 is 1076 -mem/0: storing 1076 in location 1024 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 100 -mem/0: location 1024 is 1076 -mem/0: storing 100 in location 1076 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1025 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1019 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1017 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1006 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1025 is 1 -run/0: address to copy is 1008 -run/0: its type is 4 -mem/0: location 1008 is 101 -run/0: product 0 is 101 -mem/0: storing 101 in location 1022 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 5 -run/0: address to copy is 1077 -run/0: product 0 is 1077 -mem/0: storing 1077 in location 1024 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 101 -mem/0: location 1024 is 1077 -mem/0: storing 101 in location 1077 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1025 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1019 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1017 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1026 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1026 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction interpolate/36 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -run/0: ingredient 0 is {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1015 is 1006 -run/0: ingredient 1 is {name: "j", value: 14, type: 1, properties: ["j": "integer"]} -mem/0: location 1025 is 2 -run/0: address to copy is 1009 -run/0: its type is 4 -mem/0: location 1009 is 102 -run/0: product 0 is 102 -mem/0: storing 102 in location 1022 -run/0: instruction interpolate/37 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1018 is 1071 -run/0: ingredient 1 is {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1019 is 6 -run/0: address to copy is 1078 -run/0: product 0 is 1078 -mem/0: storing 1078 in location 1024 -run/0: instruction interpolate/38 -run/0: {name: "out", value: 13, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1022 is 102 -mem/0: location 1024 is 1078 -mem/0: storing 102 in location 1078 -run/0: instruction interpolate/39 -run/0: {name: "j", value: 14, type: 1, properties: ["j": "integer"]} <- add/2 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1025 -run/0: instruction interpolate/40 -run/0: {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 8, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1019 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1019 -run/0: instruction interpolate/41 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 34 -run/0: instruction interpolate/34 -run/0: {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]} <- greater-or-equal/16 {name: "j", value: 14, type: 1, properties: ["j": "integer"]}, {name: "a-len", value: 6, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is j -mem/0: location 1025 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1017 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1026 -run/0: instruction interpolate/35 -run/0: break-if/11 {name: "arg-done?", value: 15, type: 3, properties: ["arg-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1026 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 42 -run/0: instruction interpolate/43 -run/0: {name: "i", value: 9, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1020 -run/0: instruction interpolate/44 -run/0: loop/10 {name: "", value: -27, type: , properties: ["": ]} -run/0: ingredient 0 is -27 -run/0: jumping to instruction 18 -run/0: instruction interpolate/18 -run/0: {name: "a", value: 4, type: 2-5-4, properties: ["a": "address":"array":"character"]}, {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1016 -run/0: instruction interpolate/19 -run/0: break-unless/12 {name: "arg-received?", value: 5, type: 3, properties: ["arg-received?": "boolean"]}, {name: "", value: 25, type: , properties: ["": ]} -mem/0: location 1016 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 45 -run/0: instruction interpolate/47 -run/0: {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 9, type: 1, properties: ["i": "integer"]}, {name: "tem-len", value: 2, type: 1, properties: ["tem-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1020 is 5 -run/0: ingredient 1 is tem-len -mem/0: location 1013 is 5 -run/0: product 0 is 1 -mem/0: storing 1 in location 1021 -run/0: instruction interpolate/48 -run/0: break-if/11 {name: "tem-done?", value: 10, type: 3, properties: ["tem-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1021 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 55 -run/0: instruction interpolate/56 -run/0: reply/33 {name: "result", value: 7, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1018 is 1071 -run/0: result 0 is 1071 -mem/0: storing 1071 in location 3 -run/0: instruction run1001/3 -run/0: {name: "4", value: 4, type: 5-4, properties: ["4": "array":"character", "raw": ]} <- copy/1 {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -run/0: ingredient 0 is 3 -mem/0: location 3 is 1071 -mem/0: location 1071 is 7 -mem/0: location 1072 is 97 -mem/0: location 1073 is 98 -mem/0: location 1074 is 99 -mem/0: location 1075 is 32 -mem/0: location 1076 is 100 -mem/0: location 1077 is 101 -mem/0: location 1078 is 102 -mem/0: storing 7 in location 4 -mem/0: storing 97 in location 5 -mem/0: storing 98 in location 6 -mem/0: storing 99 in location 7 -mem/0: storing 32 in location 8 -mem/0: storing 100 in location 9 -mem/0: storing 101 in location 10 -mem/0: storing 102 in location 11 -run/0: instruction interpolate-works/1 -run/0: memory-should-contain/46 {name: " - 4:string <- [abc def] - ", value: 0, type: 0, properties: [" - 4:string <- [abc def] - ": "literal-string"]} -run/0: checking string length at 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 -run/0: checking location 9 -run/0: checking location 10 -run/0: checking location 11 diff --git a/cpp/.traces/jump_backward b/cpp/.traces/jump_backward deleted file mode 100644 index 4c652f4e..00000000 --- a/cpp/.traces/jump_backward +++ /dev/null @@ -1,24 +0,0 @@ -parse/0: instruction: jump -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: jump -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: jump -parse/0: ingredient: {name: "-2", value: 0, type: 0, properties: ["-2": "offset"]} -after-brace/0: recipe main -after-brace/0: jump ... -after-brace/0: jump ... -after-brace/0: jump ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump/10 {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 1 -run/0: jumping to instruction 2 -run/0: instruction main/2 -run/0: jump/10 {name: "-2", value: -2, type: 0, properties: ["-2": "offset"]} -run/0: ingredient 0 is -2 -run/0: jumping to instruction 1 -run/0: instruction main/1 -run/0: jump/10 {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 1 -run/0: jumping to instruction 3 diff --git a/cpp/.traces/jump_can_skip_instructions b/cpp/.traces/jump_can_skip_instructions deleted file mode 100644 index ce915fa0..00000000 --- a/cpp/.traces/jump_can_skip_instructions +++ /dev/null @@ -1,14 +0,0 @@ -parse/0: instruction: jump -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: jump ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump/10 {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 1 -run/0: jumping to instruction 2 diff --git a/cpp/.traces/jump_if b/cpp/.traces/jump_if deleted file mode 100644 index cea3c4f8..00000000 --- a/cpp/.traces/jump_if +++ /dev/null @@ -1,16 +0,0 @@ -parse/0: instruction: jump-if -parse/0: ingredient: {name: "999", value: 0, type: 0, properties: ["999": "literal"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: jump-if ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump-if/11 {name: "999", value: 999, type: 0, properties: ["999": "literal"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 999 -run/0: ingredient 1 is 1 -run/0: jumping to instruction 2 diff --git a/cpp/.traces/jump_if_fallthrough b/cpp/.traces/jump_if_fallthrough deleted file mode 100644 index c5404292..00000000 --- a/cpp/.traces/jump_if_fallthrough +++ /dev/null @@ -1,19 +0,0 @@ -parse/0: instruction: jump-if -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "123", value: 0, type: 1, properties: ["123": "integer"]} -after-brace/0: recipe main -after-brace/0: jump-if ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump-if/11 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction main/1 -run/0: {name: "123", value: 123, type: 1, properties: ["123": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 123 diff --git a/cpp/.traces/jump_unless b/cpp/.traces/jump_unless deleted file mode 100644 index fb015b69..00000000 --- a/cpp/.traces/jump_unless +++ /dev/null @@ -1,16 +0,0 @@ -parse/0: instruction: jump-unless -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: jump-unless ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump-unless/12 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 0 -run/0: ingredient 1 is 1 -run/0: jumping to instruction 2 diff --git a/cpp/.traces/jump_unless_fallthrough b/cpp/.traces/jump_unless_fallthrough deleted file mode 100644 index f9c4b840..00000000 --- a/cpp/.traces/jump_unless_fallthrough +++ /dev/null @@ -1,19 +0,0 @@ -parse/0: instruction: jump-unless -parse/0: ingredient: {name: "999", value: 0, type: 0, properties: ["999": "literal"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "offset"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "123", value: 0, type: 1, properties: ["123": "integer"]} -after-brace/0: recipe main -after-brace/0: jump-unless ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: jump-unless/12 {name: "999", value: 999, type: 0, properties: ["999": "literal"]}, {name: "1", value: 1, type: 0, properties: ["1": "offset"]} -run/0: ingredient 0 is 999 -run/0: jump-unless fell through -run/0: instruction main/1 -run/0: {name: "123", value: 123, type: 1, properties: ["123": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 123 diff --git a/cpp/.traces/keyboard_in_scenario b/cpp/.traces/keyboard_in_scenario deleted file mode 100644 index f71bfacc..00000000 --- a/cpp/.traces/keyboard_in_scenario +++ /dev/null @@ -1,465 +0,0 @@ -parse/0: instruction: assume-keyboard -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ", value: 0, type: 0, properties: [" - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ", value: 0, type: 0, properties: [" - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ": "literal-string"]} -new/0: abc -> 0 -after-brace/0: recipe keyboard-in-scenario -after-brace/0: assume-keyboard ... -after-brace/0: assume-keyboard ... -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: keyboard-in-scenario -run/0: instruction keyboard-in-scenario/0 -run/0: {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- assume-keyboard/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1000 in location 901 -run/0: instruction keyboard-in-scenario/1 -run/0: {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- assume-keyboard/125 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1000 -run/0: instruction init-fake-keyboard/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1004 -run/0: instruction init-fake-keyboard/1 -run/0: {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard"]} <- new/44 {name: "keyboard", value: 12, type: 0, properties: ["keyboard": "type"]} -mem/0: new alloc: 1035 -mem/0: storing 1035 in location 1006 -run/0: instruction init-fake-keyboard/2 -run/0: {name: "buf", value: 2, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1006 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1007 -run/0: instruction init-fake-keyboard/3 -run/0: {name: "buf", value: 2, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: location 1007 is 1036 -mem/0: storing 1000 in location 1036 -run/0: instruction init-fake-keyboard/4 -run/0: {name: "idx", value: 3, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1006 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-keyboard/5 -run/0: {name: "idx", value: 3, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1008 is 1035 -mem/0: storing 0 in location 1035 -run/0: instruction init-fake-keyboard/6 -run/0: reply/33 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard"]} -mem/0: location 1006 is 1035 -run/0: result 0 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction keyboard-in-scenario/2 -run/0: run/45 {name: " - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ", value: 0, type: 0, properties: [" - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ": "literal-string"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "1", value: 0, type: 4, properties: ["1": "character"]} -parse/0: product: {name: "2", value: 0, type: 3, properties: ["2": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "3", value: 0, type: 4, properties: ["3": "character"]} -parse/0: product: {name: "4", value: 0, type: 3, properties: ["4": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "5", value: 0, type: 4, properties: ["5": "character"]} -parse/0: product: {name: "6", value: 0, type: 3, properties: ["6": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "7", value: 0, type: 4, properties: ["7": "character"]} -parse/0: product: {name: "8", value: 0, type: 3, properties: ["8": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -after-brace/0: recipe run1002 -after-brace/0: read-key ... -after-brace/0: read-key ... -after-brace/0: read-key ... -after-brace/0: read-key ... -run/0: instruction run1002/0 -run/0: {name: "1", value: 1, type: 4, properties: ["1": "character"]}, {name: "2", value: 2, type: 3, properties: ["2": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1039 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1039 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1039 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1040 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1039 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1041 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1000 -mem/0: storing 3 in location 1042 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: ingredient 1 is max -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1044 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1040 is 1035 -mem/0: storing 1 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1044 is 97 -mem/0: location 1039 is 1035 -run/0: result 0 is 97 -mem/0: storing 97 in location 1 -run/0: result 1 is 1 -mem/0: storing 1 in location 2 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1002/1 -run/0: {name: "3", value: 3, type: 4, properties: ["3": "character"]}, {name: "4", value: 4, type: 3, properties: ["4": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1070 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1070 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1070 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1071 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1070 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1072 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1072 is 1000 -mem/0: storing 3 in location 1073 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: ingredient 1 is max -mem/0: location 1073 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1074 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1074 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1072 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1075 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1071 is 1035 -mem/0: storing 2 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1075 is 98 -mem/0: location 1070 is 1035 -run/0: result 0 is 98 -mem/0: storing 98 in location 3 -run/0: result 1 is 1 -mem/0: storing 1 in location 4 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1002/2 -run/0: {name: "5", value: 5, type: 4, properties: ["5": "character"]}, {name: "6", value: 6, type: 3, properties: ["6": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1101 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1101 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1101 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1102 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1101 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1103 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1103 is 1000 -mem/0: storing 3 in location 1104 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: ingredient 1 is max -mem/0: location 1104 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1105 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1105 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1103 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1106 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1102 is 1035 -mem/0: storing 3 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1106 is 99 -mem/0: location 1101 is 1035 -run/0: result 0 is 99 -mem/0: storing 99 in location 5 -run/0: result 1 is 1 -mem/0: storing 1 in location 6 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1002/3 -run/0: {name: "7", value: 7, type: 4, properties: ["7": "character"]}, {name: "8", value: 8, type: 3, properties: ["8": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1132 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1132 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1132 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1133 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1132 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1134 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1134 is 1000 -mem/0: storing 3 in location 1135 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1133 is 1035 -mem/0: location 1035 is 3 -run/0: ingredient 1 is max -mem/0: location 1135 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1136 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1136 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction read-key/10 -run/0: reply/33 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "done": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1132 is 1035 -run/0: result 0 is 0 -mem/0: storing 0 in location 7 -run/0: result 1 is 0 -mem/0: storing 0 in location 8 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction keyboard-in-scenario/3 -run/0: memory-should-contain/46 {name: " - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ", value: 0, type: 0, properties: [" - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ": "literal-string"]} -run/0: checking location 1 -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 diff --git a/cpp/.traces/lesser_or_equal b/cpp/.traces/lesser_or_equal deleted file mode 100644 index ef139323..00000000 --- a/cpp/.traces/lesser_or_equal +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "32", value: 0, type: 0, properties: ["32": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: lesser-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: lesser-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "32", value: 32, type: 0, properties: ["32": "literal"]} -run/0: ingredient 0 is 32 -mem/0: storing 32 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- lesser-or-equal/17 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 32 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/lesser_or_equal2 b/cpp/.traces/lesser_or_equal2 deleted file mode 100644 index 3f75857d..00000000 --- a/cpp/.traces/lesser_or_equal2 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: lesser-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: lesser-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- lesser-or-equal/17 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 33 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/lesser_or_equal3 b/cpp/.traces/lesser_or_equal3 deleted file mode 100644 index cc7d8d18..00000000 --- a/cpp/.traces/lesser_or_equal3 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: lesser-or-equal -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: lesser-or-equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- lesser-or-equal/17 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/lesser_than b/cpp/.traces/lesser_than deleted file mode 100644 index 8c5a05dc..00000000 --- a/cpp/.traces/lesser_than +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "32", value: 0, type: 0, properties: ["32": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: lesser-than -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: lesser-than ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "32", value: 32, type: 0, properties: ["32": "literal"]} -run/0: ingredient 0 is 32 -mem/0: storing 32 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- lesser-than/15 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 32 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/lesser_than2 b/cpp/.traces/lesser_than2 deleted file mode 100644 index 27c17708..00000000 --- a/cpp/.traces/lesser_than2 +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: lesser-than -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: lesser-than ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- lesser-than/15 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -run/0: ingredient 1 is 2 -mem/0: location 2 is 33 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/loop b/cpp/.traces/loop deleted file mode 100644 index b3a25323..00000000 --- a/cpp/.traces/loop +++ /dev/null @@ -1,21 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: loop -parse/0: label: } -brace/0: 1000: push (open, 2) -brace/0: push (close, 5) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump -2:offset -after-brace/0: 4: {name: "", value: -2, type: , properties: ["": ]} -after-brace/0: 4: {name: "", value: -2, type: , properties: ["": ]} diff --git a/cpp/.traces/loop_label b/cpp/.traces/loop_label deleted file mode 100644 index 3d3f36f3..00000000 --- a/cpp/.traces/loop_label +++ /dev/null @@ -1,10 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: +foo -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... diff --git a/cpp/.traces/loop_nested b/cpp/.traces/loop_nested deleted file mode 100644 index ef21f26b..00000000 --- a/cpp/.traces/loop_nested +++ /dev/null @@ -1,28 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -parse/0: instruction: loop-if -parse/0: ingredient: {name: "4", value: 0, type: 3, properties: ["4": "boolean"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 1) -brace/0: 1000: push (open, 3) -brace/0: push (close, 5) -brace/0: push (close, 8) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump-if 4, -5:offset -after-brace/0: copy ... diff --git a/cpp/.traces/loop_unless b/cpp/.traces/loop_unless deleted file mode 100644 index d29f272f..00000000 --- a/cpp/.traces/loop_unless +++ /dev/null @@ -1,20 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: label: { -parse/0: instruction: loop-unless -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: label: } -brace/0: 1000: push (open, 2) -brace/0: push (close, 5) -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: jump-unless 2, -1:offset -after-brace/0: copy ... diff --git a/cpp/.traces/maybe_convert b/cpp/.traces/maybe_convert deleted file mode 100644 index 5a90d04c..00000000 --- a/cpp/.traces/maybe_convert +++ /dev/null @@ -1,37 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "36", value: 0, type: 0, properties: ["36": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: maybe-convert -parse/0: ingredient: {name: "12", value: 0, type: 8, properties: ["12": "integer-or-point"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "variant"]} -parse/0: product: {name: "20", value: 0, type: 2-6, properties: ["20": "address":"point"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: maybe-convert ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "36", value: 36, type: 0, properties: ["36": "literal"]} -run/0: ingredient 0 is 36 -mem/0: storing 36 in location 14 -run/0: instruction main/3 -run/0: {name: "20", value: 20, type: 2-6, properties: ["20": "address":"point"]} <- maybe-convert/29 {name: "12", value: 12, type: 8, properties: ["12": "integer-or-point"]}, {name: "1", value: 1, type: 0, properties: ["1": "variant"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is 1 -mem/0: storing 13 in location 20 diff --git a/cpp/.traces/maybe_convert_fail b/cpp/.traces/maybe_convert_fail deleted file mode 100644 index e925f76c..00000000 --- a/cpp/.traces/maybe_convert_fail +++ /dev/null @@ -1,37 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "36", value: 0, type: 0, properties: ["36": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: maybe-convert -parse/0: ingredient: {name: "12", value: 0, type: 8, properties: ["12": "integer-or-point"]} -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "variant"]} -parse/0: product: {name: "20", value: 0, type: 2-6, properties: ["20": "address":"point"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: maybe-convert ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "36", value: 36, type: 0, properties: ["36": "literal"]} -run/0: ingredient 0 is 36 -mem/0: storing 36 in location 14 -run/0: instruction main/3 -run/0: {name: "20", value: 20, type: 2-6, properties: ["20": "address":"point"]} <- maybe-convert/29 {name: "12", value: 12, type: 8, properties: ["12": "integer-or-point"]}, {name: "0", value: 0, type: 0, properties: ["0": "variant"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is 0 -mem/0: storing 0 in location 20 diff --git a/cpp/.traces/maybe_convert_named b/cpp/.traces/maybe_convert_named deleted file mode 100644 index aea23061..00000000 --- a/cpp/.traces/maybe_convert_named +++ /dev/null @@ -1,38 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "36", value: 0, type: 0, properties: ["36": "literal"]} -parse/0: product: {name: "14", value: 0, type: 1, properties: ["14": "integer"]} -parse/0: instruction: maybe-convert -parse/0: ingredient: {name: "12", value: 0, type: 8, properties: ["12": "integer-or-point"]} -parse/0: ingredient: {name: "p", value: 0, type: 0, properties: ["p": "variant"]} -parse/0: product: {name: "20", value: 0, type: 2-6, properties: ["20": "address":"point"]} -name/0: variant p of type integer-or-point has tag 1 -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: maybe-convert ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 12 -run/0: instruction main/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction main/2 -run/0: {name: "14", value: 14, type: 1, properties: ["14": "integer"]} <- copy/1 {name: "36", value: 36, type: 0, properties: ["36": "literal"]} -run/0: ingredient 0 is 36 -mem/0: storing 36 in location 14 -run/0: instruction main/3 -run/0: {name: "20", value: 20, type: 2-6, properties: ["20": "address":"point"]} <- maybe-convert/29 {name: "12", value: 12, type: 8, properties: ["12": "integer-or-point"]}, {name: "p", value: 1, type: 0, properties: ["p": "variant"]} -run/0: ingredient 0 is 12 -run/0: ingredient 1 is p -mem/0: storing 13 in location 20 diff --git a/cpp/.traces/memory_check b/cpp/.traces/memory_check deleted file mode 100644 index c87bcc2f..00000000 --- a/cpp/.traces/memory_check +++ /dev/null @@ -1,18 +0,0 @@ -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: memory-should-contain/46 {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -run/0: checking location 1 -warn/0: expected location 1 to contain 13 but saw 0 diff --git a/cpp/.traces/memory_check_multiple b/cpp/.traces/memory_check_multiple deleted file mode 100644 index 50aa0237..00000000 --- a/cpp/.traces/memory_check_multiple +++ /dev/null @@ -1,23 +0,0 @@ -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 0 - 1 <- 0 - ", value: 0, type: 0, properties: [" - 1 <- 0 - 1 <- 0 - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: memory-should-contain/46 {name: " - 1 <- 0 - 1 <- 0 - ", value: 0, type: 0, properties: [" - 1 <- 0 - 1 <- 0 - ": "literal-string"]} -run/0: checking location 1 -warn/0: duplicate expectation for location 1 -run/0: checking location 1 diff --git a/cpp/.traces/memory_check_string b/cpp/.traces/memory_check_string deleted file mode 100644 index 2f47f64f..00000000 --- a/cpp/.traces/memory_check_string +++ /dev/null @@ -1,52 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "98", value: 0, type: 0, properties: ["98": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "99", value: 0, type: 0, properties: ["99": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1:string <- [abc] - ", value: 0, type: 0, properties: [" - 1:string <- [abc] - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -run/0: ingredient 0 is 97 -mem/0: storing 97 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "98", value: 98, type: 0, properties: ["98": "literal"]} -run/0: ingredient 0 is 98 -mem/0: storing 98 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "99", value: 99, type: 0, properties: ["99": "literal"]} -run/0: ingredient 0 is 99 -mem/0: storing 99 in location 4 -run/0: instruction main/4 -run/0: memory-should-contain/46 {name: " - 1:string <- [abc] - ", value: 0, type: 0, properties: [" - 1:string <- [abc] - ": "literal-string"]} -run/0: checking string length at 1 -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 diff --git a/cpp/.traces/memory_check_string_length b/cpp/.traces/memory_check_string_length deleted file mode 100644 index 84fb62e1..00000000 --- a/cpp/.traces/memory_check_string_length +++ /dev/null @@ -1,52 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "98", value: 0, type: 0, properties: ["98": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "99", value: 0, type: 0, properties: ["99": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1:string <- [ab] - ", value: 0, type: 0, properties: [" - 1:string <- [ab] - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -run/0: ingredient 0 is 97 -mem/0: storing 97 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "98", value: 98, type: 0, properties: ["98": "literal"]} -run/0: ingredient 0 is 98 -mem/0: storing 98 in location 3 -run/0: instruction main/3 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "99", value: 99, type: 0, properties: ["99": "literal"]} -run/0: ingredient 0 is 99 -mem/0: storing 99 in location 4 -run/0: instruction main/4 -run/0: memory-should-contain/46 {name: " - 1:string <- [ab] - ", value: 0, type: 0, properties: [" - 1:string <- [ab] - ": "literal-string"]} -run/0: checking string length at 1 -warn/0: expected location 1 to contain length 2 of string [ab] but saw 3 -run/0: checking location 2 -run/0: checking location 3 diff --git a/cpp/.traces/multiply b/cpp/.traces/multiply deleted file mode 100644 index ceb7be06..00000000 --- a/cpp/.traces/multiply +++ /dev/null @@ -1,33 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "4", value: 0, type: 0, properties: ["4": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "6", value: 0, type: 0, properties: ["6": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: multiply -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: multiply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "4", value: 4, type: 0, properties: ["4": "literal"]} -run/0: ingredient 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "6", value: 6, type: 0, properties: ["6": "literal"]} -run/0: ingredient 0 is 6 -mem/0: storing 6 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- multiply/4 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 4 -run/0: ingredient 1 is 2 -mem/0: location 2 is 6 -run/0: ingredient 1 is 6 -run/0: product 0 is 24 -mem/0: storing 24 in location 3 diff --git a/cpp/.traces/multiply_literal b/cpp/.traces/multiply_literal deleted file mode 100644 index 115fb958..00000000 --- a/cpp/.traces/multiply_literal +++ /dev/null @@ -1,15 +0,0 @@ -parse/0: instruction: multiply -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: multiply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- multiply/4 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 6 -mem/0: storing 6 in location 1 diff --git a/cpp/.traces/new b/cpp/.traces/new deleted file mode 100644 index 82e25ee1..00000000 --- a/cpp/.traces/new +++ /dev/null @@ -1,34 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: instruction: equal -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: integer -> 1 -new/0: integer -> 1 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1000 -mem/0: storing 1000 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1001 -mem/0: storing 1001 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- equal/13 {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "raw": ]}, {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1000 -run/0: ingredient 1 is 2 -mem/0: location 2 is 1001 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/new_array b/cpp/.traces/new_array deleted file mode 100644 index 830d8c00..00000000 --- a/cpp/.traces/new_array +++ /dev/null @@ -1,36 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"integer", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: instruction: subtract -parse/0: ingredient: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"integer", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer", "raw": ]} -new/0: integer -> 1 -new/0: integer -> 1 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: subtract ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]}, {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -mem/0: array size is 5 -mem/0: new alloc: 1000 -mem/0: storing 1000 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1006 -mem/0: storing 1006 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer", "raw": ]} <- subtract/3 {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]}, {name: "1", value: 1, type: 2-5-1, properties: ["1": "address":"array":"integer", "raw": ]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 1006 -run/0: ingredient 1 is 1 -mem/0: location 1 is 1000 -run/0: product 0 is 6 -mem/0: storing 6 in location 3 diff --git a/cpp/.traces/new_concurrent b/cpp/.traces/new_concurrent deleted file mode 100644 index f3d2f2c7..00000000 --- a/cpp/.traces/new_concurrent +++ /dev/null @@ -1,43 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: instruction: equal -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: integer -> 1 -new/0: integer -> 1 -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: new ... -after-brace/0: recipe f2 -after-brace/0: new ... -after-brace/0: equal ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -run/0: instruction f1/1 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1000 -mem/0: storing 1000 in location 1 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 101000 -mem/0: storing 101000 in location 2 -run/0: instruction f2/1 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- equal/13 {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "raw": ]}, {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer", "raw": ]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1000 -run/0: ingredient 1 is 2 -mem/0: location 2 is 101000 -run/0: product 0 is 0 -mem/0: storing 0 in location 3 diff --git a/cpp/.traces/new_overflow b/cpp/.traces/new_overflow deleted file mode 100644 index a0a54308..00000000 --- a/cpp/.traces/new_overflow +++ /dev/null @@ -1,22 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: "point", value: 0, type: 0, properties: ["point": "type"]} -parse/0: product: {name: "2", value: 0, type: 2-6, properties: ["2": "address":"point", "raw": ]} -new/0: integer -> 1 -new/0: point -> 6 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: new ... -new/0: routine allocated memory from 1000 to 1002 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "raw": ]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1000 -mem/0: storing 1000 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 2-6, properties: ["2": "address":"point", "raw": ]} <- new/44 {name: "point", value: 6, type: 0, properties: ["point": "type"]} -new/0: routine allocated memory from 1002 to 1004 -mem/0: new alloc: 1002 -mem/0: storing 1002 in location 2 diff --git a/cpp/.traces/new_string b/cpp/.traces/new_string deleted file mode 100644 index ed0e8481..00000000 --- a/cpp/.traces/new_string +++ /dev/null @@ -1,26 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "abc def", value: 0, type: 0, properties: ["abc def": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} -parse/0: instruction: index -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": ]} -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "2", value: 0, type: 4, properties: ["2": "character"]} -new/0: abc def -> 0 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: index ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character"]} <- new/44 {name: "abc def", value: 0, type: 0, properties: ["abc def": "literal-string"]} -mem/0: storing 1000 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 4, properties: ["2": "character"]} <- index/26 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": ]}, {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "deref": ]} -mem/0: location 1 is 1000 -run/0: ingredient 1 is {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: address to copy is 1006 -run/0: its type is 4 -mem/0: location 1006 is 101 -run/0: product 0 is 101 -mem/0: storing 101 in location 2 diff --git a/cpp/.traces/next_ingredient b/cpp/.traces/next_ingredient deleted file mode 100644 index 34175e45..00000000 --- a/cpp/.traces/next_ingredient +++ /dev/null @@ -1,28 +0,0 @@ -parse/0: instruction: f -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: add -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: ingredient: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: next-ingredient ... -after-brace/0: add ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction f/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction f/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- add/2 {name: "1", value: 1, type: 0, properties: ["1": "literal"]}, {name: "12", value: 12, type: 1, properties: ["12": "integer"]} -run/0: ingredient 0 is 1 -run/0: ingredient 1 is 12 -mem/0: location 12 is 2 -run/0: product 0 is 3 -mem/0: storing 3 in location 13 diff --git a/cpp/.traces/next_ingredient_missing b/cpp/.traces/next_ingredient_missing deleted file mode 100644 index 8d120e20..00000000 --- a/cpp/.traces/next_ingredient_missing +++ /dev/null @@ -1,15 +0,0 @@ -parse/0: instruction: f -parse/0: instruction: next-ingredient -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: next-ingredient ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 -run/0: instruction f/0 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- next-ingredient/30 -mem/0: storing 0 in location 12 diff --git a/cpp/.traces/not b/cpp/.traces/not deleted file mode 100644 index 5450b050..00000000 --- a/cpp/.traces/not +++ /dev/null @@ -1,21 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: not -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: not ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- not/9 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1 -run/0: product 0 is 0 -mem/0: storing 0 in location 2 diff --git a/cpp/.traces/or b/cpp/.traces/or deleted file mode 100644 index 72231ceb..00000000 --- a/cpp/.traces/or +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: or -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: or ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: storing 1 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- or/8 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1 -run/0: ingredient 1 is 2 -mem/0: location 2 is 0 -run/0: product 0 is 1 -mem/0: storing 1 in location 3 diff --git a/cpp/.traces/parse_comment_after_instruction b/cpp/.traces/parse_comment_after_instruction deleted file mode 100644 index 5cfc15c8..00000000 --- a/cpp/.traces/parse_comment_after_instruction +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/parse_comment_amongst_instruction b/cpp/.traces/parse_comment_amongst_instruction deleted file mode 100644 index 5cfc15c8..00000000 --- a/cpp/.traces/parse_comment_amongst_instruction +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/parse_comment_amongst_instruction2 b/cpp/.traces/parse_comment_amongst_instruction2 deleted file mode 100644 index 5cfc15c8..00000000 --- a/cpp/.traces/parse_comment_amongst_instruction2 +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/parse_comment_amongst_instruction3 b/cpp/.traces/parse_comment_amongst_instruction3 deleted file mode 100644 index a00c722c..00000000 --- a/cpp/.traces/parse_comment_amongst_instruction3 +++ /dev/null @@ -1,6 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} diff --git a/cpp/.traces/parse_comment_outside_recipe b/cpp/.traces/parse_comment_outside_recipe deleted file mode 100644 index 5cfc15c8..00000000 --- a/cpp/.traces/parse_comment_outside_recipe +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/parse_dollar_as_recipe_name b/cpp/.traces/parse_dollar_as_recipe_name deleted file mode 100644 index a73100d5..00000000 --- a/cpp/.traces/parse_dollar_as_recipe_name +++ /dev/null @@ -1 +0,0 @@ -parse/0: instruction: $foo diff --git a/cpp/.traces/parse_label b/cpp/.traces/parse_label deleted file mode 100644 index e32481af..00000000 --- a/cpp/.traces/parse_label +++ /dev/null @@ -1 +0,0 @@ -parse/0: label: +foo diff --git a/cpp/.traces/parse_multiple_ingredients b/cpp/.traces/parse_multiple_ingredients deleted file mode 100644 index 5a71e510..00000000 --- a/cpp/.traces/parse_multiple_ingredients +++ /dev/null @@ -1,5 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: ingredient: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} diff --git a/cpp/.traces/parse_multiple_products b/cpp/.traces/parse_multiple_products deleted file mode 100644 index 24bbdb66..00000000 --- a/cpp/.traces/parse_multiple_products +++ /dev/null @@ -1,4 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} diff --git a/cpp/.traces/parse_multiple_properties b/cpp/.traces/parse_multiple_properties deleted file mode 100644 index e3b452e0..00000000 --- a/cpp/.traces/parse_multiple_properties +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal", "foo": "bar":"baz"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/parse_multiple_types b/cpp/.traces/parse_multiple_types deleted file mode 100644 index 39df838e..00000000 --- a/cpp/.traces/parse_multiple_types +++ /dev/null @@ -1,5 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: ingredient: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer"]} diff --git a/cpp/.traces/parse_properties b/cpp/.traces/parse_properties deleted file mode 100644 index 65d7890e..00000000 --- a/cpp/.traces/parse_properties +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1-2, properties: ["1": "integer":"address", "deref": ]} diff --git a/cpp/.traces/print-character-at-top-left b/cpp/.traces/print-character-at-top-left deleted file mode 100644 index ac59b8f4..00000000 --- a/cpp/.traces/print-character-at-top-left +++ /dev/null @@ -1,595 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ", value: 0, type: 0, properties: [" -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 6 # width*height - 4 <- 97 # 'a' - 5 <- 0 - ", value: 0, type: 0, properties: [" - 3 <- 6 # width*height - 4 <- 97 # 'a' - 5 <- 0 - ": "literal-string"]} -after-brace/0: recipe print-character-at-top-left -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: print-character-at-top-left -run/0: instruction print-character-at-top-left/0 -run/0: run/45 {name: " -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ", value: 0, type: 0, properties: [" -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ": "literal-string"]} -parse/0: instruction: init-fake-screen -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "width": ]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal", "height": ]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen"]} -parse/0: instruction: get -parse/0: ingredient: {name: "1", value: 0, type: 2-11, properties: ["1": "address":"screen", "deref": ]} -parse/0: ingredient: {name: "data", value: 0, type: 0, properties: ["data": "offset"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]} -parse/0: product: {name: "3", value: 0, type: 5-4, properties: ["3": "array":"character"]} -name/0: element data of type screen is at offset 4 -after-brace/0: recipe run1001 -after-brace/0: init-fake-screen ... -after-brace/0: print-character ... -after-brace/0: get ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- init-fake-screen/115 {name: "3", value: 3, type: 0, properties: ["3": "literal", "width": ]}, {name: "2", value: 2, type: 0, properties: ["2": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1003 is 1032 -mem/0: storing 3 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: location 1004 is 1031 -mem/0: storing 2 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 3 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 6 -mem/0: storing 6 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 6 -mem/0: array size is 6 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1043 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1045 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1045 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1045 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1046 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1046 is 1036 -mem/0: storing 6 in location 1047 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 6 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 1 -mem/0: storing 1 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1045 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/1 -run/0: {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]} <- print-character/117 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 1 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1074 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1076 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1077 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1076 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1078 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1079 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1080 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1078 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1081 is 0 -run/0: ingredient 1 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1082 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1082 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1081 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1083 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1077 is 97 -mem/0: location 1083 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1084 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1084 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1079 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1076 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 1 -run/0: instruction run1001/2 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character"]} <- get/24 {name: "1", value: 1, type: 2-11, properties: ["1": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 2 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 5-4, properties: ["3": "array":"character"]} <- copy/1 {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "deref": ]} -run/0: ingredient 0 is 2 -mem/0: location 2 is 1036 -mem/0: location 1036 is 6 -mem/0: location 1037 is 97 -mem/0: location 1038 is 0 -mem/0: location 1039 is 0 -mem/0: location 1040 is 0 -mem/0: location 1041 is 0 -mem/0: location 1042 is 0 -mem/0: storing 6 in location 3 -mem/0: storing 97 in location 4 -mem/0: storing 0 in location 5 -mem/0: storing 0 in location 6 -mem/0: storing 0 in location 7 -mem/0: storing 0 in location 8 -mem/0: storing 0 in location 9 -run/0: instruction print-character-at-top-left/1 -run/0: memory-should-contain/46 {name: " - 3 <- 6 # width*height - 4 <- 97 # 'a' - 5 <- 0 - ", value: 0, type: 0, properties: [" - 3 <- 6 # width*height - 4 <- 97 # 'a' - 5 <- 0 - ": "literal-string"]} -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 diff --git a/cpp/.traces/print-character-at-top-left2 b/cpp/.traces/print-character-at-top-left2 deleted file mode 100644 index 898384e3..00000000 --- a/cpp/.traces/print-character-at-top-left2 +++ /dev/null @@ -1,540 +0,0 @@ -parse/0: instruction: assume-screen -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "width": ]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal", "height": ]} -parse/0: instruction: run -parse/0: ingredient: {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: screen-should-contain -parse/0: ingredient: {name: " - .a . - . . - ", value: 0, type: 0, properties: [" - .a . - . . - ": "literal-string"]} -after-brace/0: recipe print-character-at-top-left2 -after-brace/0: assume-screen ... -after-brace/0: run ... -after-brace/0: screen-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: print-character-at-top-left2 -run/0: instruction print-character-at-top-left2/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- assume-screen/115 {name: "3", value: 3, type: 0, properties: ["3": "literal", "width": ]}, {name: "2", value: 2, type: 0, properties: ["2": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1003 is 1032 -mem/0: storing 3 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: location 1004 is 1031 -mem/0: storing 2 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 3 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 6 -mem/0: storing 6 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 6 -mem/0: array size is 6 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1043 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1045 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1045 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1045 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1046 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1046 is 1036 -mem/0: storing 6 in location 1047 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1046 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1048 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1050 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1050 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1048 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1048 is 6 -run/0: ingredient 1 is max -mem/0: location 1047 is 6 -run/0: product 0 is 1 -mem/0: storing 1 in location 1049 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1049 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1045 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction print-character-at-top-left2/1 -run/0: run/45 {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -after-brace/0: recipe run1001 -after-brace/0: print-character ... -run/0: instruction run1001/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- print-character/117 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 900 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1074 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1076 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1077 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1076 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1078 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1079 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 3 -run/0: product 0 is 3 -mem/0: storing 3 in location 1080 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1078 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1081 is 0 -run/0: ingredient 1 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1081 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1076 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1082 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1082 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1081 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1083 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1077 is 97 -mem/0: location 1083 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1080 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1084 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1084 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1079 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1079 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1076 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction print-character-at-top-left2/2 -run/0: screen-should-contain/62 {name: " - .a . - . . - ", value: 0, type: 0, properties: [" - .a . - . . - ": "literal-string"]} -run/0: checking screen size at 1036 -run/0: checking location 1037 -run/0: checking location 1038 -run/0: checking location 1039 -run/0: checking location 1040 -run/0: checking location 1041 -run/0: checking location 1042 diff --git a/cpp/.traces/read-key-in-mu b/cpp/.traces/read-key-in-mu deleted file mode 100644 index c1b0b274..00000000 --- a/cpp/.traces/read-key-in-mu +++ /dev/null @@ -1,465 +0,0 @@ -parse/0: instruction: assume-keyboard -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ", value: 0, type: 0, properties: [" - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ", value: 0, type: 0, properties: [" - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ": "literal-string"]} -new/0: abc -> 0 -after-brace/0: recipe read-key-in-mu -after-brace/0: assume-keyboard ... -after-brace/0: assume-keyboard ... -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: read-key-in-mu -run/0: instruction read-key-in-mu/0 -run/0: {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- assume-keyboard/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1000 in location 901 -run/0: instruction read-key-in-mu/1 -run/0: {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- assume-keyboard/125 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1000 -run/0: instruction init-fake-keyboard/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1004 -run/0: instruction init-fake-keyboard/1 -run/0: {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard"]} <- new/44 {name: "keyboard", value: 12, type: 0, properties: ["keyboard": "type"]} -mem/0: new alloc: 1035 -mem/0: storing 1035 in location 1006 -run/0: instruction init-fake-keyboard/2 -run/0: {name: "buf", value: 2, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1006 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1007 -run/0: instruction init-fake-keyboard/3 -run/0: {name: "buf", value: 2, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: location 1007 is 1036 -mem/0: storing 1000 in location 1036 -run/0: instruction init-fake-keyboard/4 -run/0: {name: "idx", value: 3, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1006 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-keyboard/5 -run/0: {name: "idx", value: 3, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1008 is 1035 -mem/0: storing 0 in location 1035 -run/0: instruction init-fake-keyboard/6 -run/0: reply/33 {name: "result", value: 1, type: 2-12, properties: ["result": "address":"keyboard"]} -mem/0: location 1006 is 1035 -run/0: result 0 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction read-key-in-mu/2 -run/0: run/45 {name: " - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ", value: 0, type: 0, properties: [" - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ": "literal-string"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "1", value: 0, type: 4, properties: ["1": "character"]} -parse/0: product: {name: "2", value: 0, type: 3, properties: ["2": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "3", value: 0, type: 4, properties: ["3": "character"]} -parse/0: product: {name: "4", value: 0, type: 3, properties: ["4": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "5", value: 0, type: 4, properties: ["5": "character"]} -parse/0: product: {name: "6", value: 0, type: 3, properties: ["6": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: instruction: read-key -parse/0: ingredient: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -parse/0: product: {name: "7", value: 0, type: 4, properties: ["7": "character"]} -parse/0: product: {name: "8", value: 0, type: 3, properties: ["8": "boolean"]} -parse/0: product: {name: "keyboard", value: 0, type: 2, properties: ["keyboard": "address"]} -after-brace/0: recipe run1001 -after-brace/0: read-key ... -after-brace/0: read-key ... -after-brace/0: read-key ... -after-brace/0: read-key ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 4, properties: ["1": "character"]}, {name: "2", value: 2, type: 3, properties: ["2": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1039 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1039 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1039 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1040 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1039 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1041 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1000 -mem/0: storing 3 in location 1042 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: ingredient 1 is max -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1044 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1040 is 1035 -mem/0: location 1035 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1040 is 1035 -mem/0: storing 1 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1044 is 97 -mem/0: location 1039 is 1035 -run/0: result 0 is 97 -mem/0: storing 97 in location 1 -run/0: result 1 is 1 -mem/0: storing 1 in location 2 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1001/1 -run/0: {name: "3", value: 3, type: 4, properties: ["3": "character"]}, {name: "4", value: 4, type: 3, properties: ["4": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1068 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1070 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1070 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1070 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1071 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1070 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1072 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1072 is 1000 -mem/0: storing 3 in location 1073 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: ingredient 1 is max -mem/0: location 1073 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1074 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1074 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1072 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1075 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1071 is 1035 -mem/0: location 1035 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: location 1071 is 1035 -mem/0: storing 2 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1075 is 98 -mem/0: location 1070 is 1035 -run/0: result 0 is 98 -mem/0: storing 98 in location 3 -run/0: result 1 is 1 -mem/0: storing 1 in location 4 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1001/2 -run/0: {name: "5", value: 5, type: 4, properties: ["5": "character"]}, {name: "6", value: 6, type: 3, properties: ["6": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1099 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1101 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1101 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1101 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1102 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1101 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1103 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1103 is 1000 -mem/0: storing 3 in location 1104 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: ingredient 1 is max -mem/0: location 1104 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1105 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1105 is 0 -run/0: ingredient 0 is 0 -run/0: ingredient 1 is -run/0: jumping to instruction 11 -run/0: instruction read-key/12 -run/0: {name: "c", value: 6, type: 4, properties: ["c": "character"]} <- index/26 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -run/0: ingredient 0 is {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1103 is 1000 -run/0: ingredient 1 is {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1106 -run/0: instruction read-key/13 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]} <- add/2 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is idx -mem/0: location 1102 is 1035 -mem/0: location 1035 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: location 1102 is 1035 -mem/0: storing 3 in location 1035 -run/0: instruction read-key/14 -run/0: reply/33 {name: "c", value: 6, type: 4, properties: ["c": "character"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal", "found": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1106 is 99 -mem/0: location 1101 is 1035 -run/0: result 0 is 99 -mem/0: storing 99 in location 5 -run/0: result 1 is 1 -mem/0: storing 1 in location 6 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction run1001/3 -run/0: {name: "7", value: 7, type: 4, properties: ["7": "character"]}, {name: "8", value: 8, type: 3, properties: ["8": "boolean"]}, {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} <- read-key/126 {name: "keyboard", value: 901, type: 2, properties: ["keyboard": "address"]} -mem/0: location 901 is 1035 -run/0: instruction read-key/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1130 -run/0: instruction read-key/1 -run/0: {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1132 -run/0: instruction read-key/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard"]}, {name: "", value: 11, type: , properties: ["": ]} -mem/0: location 1132 is 1035 -run/0: ingredient 0 is 1035 -run/0: jump-unless fell through -run/0: instruction read-key/4 -run/0: {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "index", value: 0, type: 0, properties: ["index": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1132 is 1035 -run/0: ingredient 1 is index -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1133 -run/0: instruction read-key/5 -run/0: {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1132 is 1035 -run/0: ingredient 1 is data -run/0: address to copy is 1036 -run/0: its type is 2 -mem/0: location 1036 is 1000 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1134 -run/0: instruction read-key/6 -run/0: {name: "max", value: 4, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 3, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1134 is 1000 -mem/0: storing 3 in location 1135 -run/0: instruction read-key/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "idx", value: 2, type: 2-1, properties: ["idx": "address":"integer", "deref": ]}, {name: "max", value: 4, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is idx -mem/0: location 1133 is 1035 -mem/0: location 1035 is 3 -run/0: ingredient 1 is max -mem/0: location 1135 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1136 -run/0: instruction read-key/9 -run/0: break-unless/12 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1136 is 1 -run/0: ingredient 0 is 1 -run/0: jump-unless fell through -run/0: instruction read-key/10 -run/0: reply/33 {name: "0", value: 0, type: 0, properties: ["0": "literal"]}, {name: "0", value: 0, type: 0, properties: ["0": "literal", "done": ]}, {name: "x", value: 1, type: 2-12, properties: ["x": "address":"keyboard", "same-as-ingredient": "0"]} -mem/0: location 1132 is 1035 -run/0: result 0 is 0 -mem/0: storing 0 in location 7 -run/0: result 1 is 0 -mem/0: storing 0 in location 8 -run/0: result 2 is 1035 -mem/0: storing 1035 in location 901 -run/0: instruction read-key-in-mu/3 -run/0: memory-should-contain/46 {name: " - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ", value: 0, type: 0, properties: [" - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ": "literal-string"]} -run/0: checking location 1 -run/0: checking location 2 -run/0: checking location 3 -run/0: checking location 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 diff --git a/cpp/.traces/reply b/cpp/.traces/reply deleted file mode 100644 index 6ac4c162..00000000 --- a/cpp/.traces/reply +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: f -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: add -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: ingredient: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: reply -parse/0: ingredient: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: ingredient: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: next-ingredient ... -after-brace/0: add ... -after-brace/0: reply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]}, {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- f/1001 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction f/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction f/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- add/2 {name: "1", value: 1, type: 0, properties: ["1": "literal"]}, {name: "12", value: 12, type: 1, properties: ["12": "integer"]} -run/0: ingredient 0 is 1 -run/0: ingredient 1 is 12 -mem/0: location 12 is 2 -run/0: product 0 is 3 -mem/0: storing 3 in location 13 -run/0: instruction f/2 -run/0: reply/33 {name: "12", value: 12, type: 1, properties: ["12": "integer"]}, {name: "13", value: 13, type: 1, properties: ["13": "integer"]} -mem/0: location 12 is 2 -mem/0: location 13 is 3 -run/0: result 0 is 2 -mem/0: storing 2 in location 3 -run/0: result 1 is 3 -mem/0: storing 3 in location 4 diff --git a/cpp/.traces/reply_container b/cpp/.traces/reply_container deleted file mode 100644 index 693f984d..00000000 --- a/cpp/.traces/reply_container +++ /dev/null @@ -1,35 +0,0 @@ -parse/0: instruction: f -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "3", value: 0, type: 6, properties: ["3": "point"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "literal"]} -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: instruction: reply -parse/0: ingredient: {name: "12", value: 0, type: 6, properties: ["12": "point"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: next-ingredient ... -after-brace/0: copy ... -after-brace/0: reply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "3", value: 3, type: 6, properties: ["3": "point"]} <- f/1001 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction f/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction f/1 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]} <- copy/1 {name: "35", value: 35, type: 0, properties: ["35": "literal"]} -run/0: ingredient 0 is 35 -mem/0: storing 35 in location 13 -run/0: instruction f/2 -run/0: reply/33 {name: "12", value: 12, type: 6, properties: ["12": "point"]} -mem/0: location 12 is 2 -mem/0: location 13 is 35 -run/0: result 0 is [2, 35] -mem/0: storing 2 in location 3 -mem/0: storing 35 in location 4 diff --git a/cpp/.traces/reply_same_as_ingredient b/cpp/.traces/reply_same_as_ingredient deleted file mode 100644 index 0ac3ce16..00000000 --- a/cpp/.traces/reply_same_as_ingredient +++ /dev/null @@ -1,36 +0,0 @@ -parse/0: instruction: new -parse/0: ingredient: {name: "integer", value: 0, type: 0, properties: ["integer": "type"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: instruction: test1 -parse/0: ingredient: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "10", value: 0, type: 2-1, properties: ["10": "address":"integer"]} -parse/0: instruction: reply -parse/0: ingredient: {name: "10", value: 0, type: 2-1, properties: ["10": "address":"integer", "same-as-ingredient": "0"]} -new/0: integer -> 1 -after-brace/0: recipe main -after-brace/0: new ... -after-brace/0: test1 ... -after-brace/0: recipe test1 -after-brace/0: next-ingredient ... -after-brace/0: reply ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer"]} <- new/44 {name: "integer", value: 1, type: 0, properties: ["integer": "type"]} -mem/0: new alloc: 1000 -mem/0: storing 1000 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 2-1, properties: ["2": "address":"integer"]} <- test1/1001 {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer"]} -mem/0: location 1 is 1000 -run/0: instruction test1/0 -run/0: {name: "10", value: 10, type: 2-1, properties: ["10": "address":"integer"]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 10 -run/0: instruction test1/1 -run/0: reply/33 {name: "10", value: 10, type: 2-1, properties: ["10": "address":"integer", "same-as-ingredient": "0"]} -mem/0: location 10 is 1000 -run/0: result 0 is 1000 -warn/0: 'same-as-ingredient' result 2 must be location 1 -mem/0: storing 1000 in location 2 diff --git a/cpp/.traces/return_on_fallthrough b/cpp/.traces/return_on_fallthrough deleted file mode 100644 index 01d38444..00000000 --- a/cpp/.traces/return_on_fallthrough +++ /dev/null @@ -1,48 +0,0 @@ -parse/0: instruction: f -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "5", value: 0, type: 1, properties: ["5": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: recipe f -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 -run/0: instruction f/0 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 4 -run/0: instruction f/1 -run/0: {name: "5", value: 5, type: 1, properties: ["5": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 5 -run/0: instruction main/1 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 3 diff --git a/cpp/.traces/rewind_ingredients b/cpp/.traces/rewind_ingredients deleted file mode 100644 index 4c7b4159..00000000 --- a/cpp/.traces/rewind_ingredients +++ /dev/null @@ -1,36 +0,0 @@ -parse/0: instruction: f -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -parse/0: product: {name: "1", value: 0, type: 3, properties: ["1": "boolean"]} -parse/0: instruction: rewind-ingredients -parse/0: instruction: next-ingredient -parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -parse/0: product: {name: "2", value: 0, type: 3, properties: ["2": "boolean"]} -after-brace/0: recipe main -after-brace/0: f ... -after-brace/0: recipe f -after-brace/0: next-ingredient ... -after-brace/0: next-ingredient ... -after-brace/0: rewind-ingredients ... -after-brace/0: next-ingredient ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: f/1001 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: instruction f/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 12 -run/0: instruction f/1 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]}, {name: "1", value: 1, type: 3, properties: ["1": "boolean"]} <- next-ingredient/30 -mem/0: storing 0 in location 1 -run/0: instruction f/2 -run/0: rewind-ingredients/31 -run/0: instruction f/3 -run/0: {name: "13", value: 13, type: 1, properties: ["13": "integer"]}, {name: "2", value: 2, type: 3, properties: ["2": "boolean"]} <- next-ingredient/30 -run/0: product 0 is 2 -mem/0: storing 2 in location 13 -mem/0: storing 1 in location 2 diff --git a/cpp/.traces/routine_state_test b/cpp/.traces/routine_state_test deleted file mode 100644 index 9616c23c..00000000 --- a/cpp/.traces/routine_state_test +++ /dev/null @@ -1,39 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer", "child-id": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -parse/0: instruction: routine-state -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer", "child-id": ]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer", "state": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: copy ... -after-brace/0: routine-state ... -after-brace/0: recipe f2 -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer", "child-id": ]} <- start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -mem/0: storing 2 in location 1 -run/0: instruction f1/1 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 12 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 12 -schedule/0: f1 -run/0: instruction f1/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer", "state": ]} <- routine-state/35 {name: "1", value: 1, type: 1, properties: ["1": "integer", "child-id": ]} -mem/0: location 1 is 2 -mem/0: storing 1 in location 2 diff --git a/cpp/.traces/run b/cpp/.traces/run deleted file mode 100644 index 1cda2c08..00000000 --- a/cpp/.traces/run +++ /dev/null @@ -1,25 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 1 diff --git a/cpp/.traces/run_dummy b/cpp/.traces/run_dummy deleted file mode 100644 index 0cd9cdf3..00000000 --- a/cpp/.traces/run_dummy +++ /dev/null @@ -1,10 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} -after-brace/0: recipe main -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "_", value: 0, type: 0, properties: ["_": "dummy"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 diff --git a/cpp/.traces/run_label b/cpp/.traces/run_label deleted file mode 100644 index f9f2fce7..00000000 --- a/cpp/.traces/run_label +++ /dev/null @@ -1,21 +0,0 @@ -parse/0: label: +foo -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/1 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1 -run/0: instruction main/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 23 -mem/0: storing 23 in location 2 diff --git a/cpp/.traces/run_multiple b/cpp/.traces/run_multiple deleted file mode 100644 index fcb204d5..00000000 --- a/cpp/.traces/run_multiple +++ /dev/null @@ -1,47 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: run -parse/0: ingredient: {name: " - 2:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 2:integer <- copy 13:literal - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -after-brace/0: run ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 1 -run/0: instruction main/1 -run/0: run/45 {name: " - 2:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 2:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe run1002 -after-brace/0: copy ... -run/0: instruction run1002/0 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 2 diff --git a/cpp/.traces/scenario_block b/cpp/.traces/scenario_block deleted file mode 100644 index cf2290ad..00000000 --- a/cpp/.traces/scenario_block +++ /dev/null @@ -1,39 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -after-brace/0: recipe foo -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: foo -run/0: instruction foo/0 -run/0: run/45 {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 1 -run/0: instruction foo/1 -run/0: memory-should-contain/46 {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -run/0: checking location 1 diff --git a/cpp/.traces/scenario_check_memory_and_trace b/cpp/.traces/scenario_check_memory_and_trace deleted file mode 100644 index 1b1f6185..00000000 --- a/cpp/.traces/scenario_check_memory_and_trace +++ /dev/null @@ -1,76 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 13:literal - trace [a], [a b c] - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - trace [a], [a b c] - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - a: a b c - ", value: 0, type: 0, properties: [" - a: a b c - ": "literal-string"]} -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - a: x y z - ", value: 0, type: 0, properties: [" - a: x y z - ": "literal-string"]} -after-brace/0: recipe foo -after-brace/0: run ... -after-brace/0: memory-should-contain ... -after-brace/0: trace-should-contain ... -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: foo -run/0: instruction foo/0 -run/0: run/45 {name: " - 1:integer <- copy 13:literal - trace [a], [a b c] - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - trace [a], [a b c] - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]} -parse/0: ingredient: {name: "a b c", value: 0, type: 0, properties: ["a b c": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 1 -run/0: instruction run1001/1 -run/0: trace/18 {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]}, {name: "a b c", value: 0, type: 0, properties: ["a b c": "literal-string"]} -a/0: a b c -run/0: instruction foo/1 -run/0: memory-should-contain/46 {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -run/0: checking location 1 -run/0: instruction foo/2 -run/0: trace-should-contain/47 {name: " - a: a b c - ", value: 0, type: 0, properties: [" - a: a b c - ": "literal-string"]} -run/0: instruction foo/3 -run/0: trace-should-not-contain/48 {name: " - a: x y z - ", value: 0, type: 0, properties: [" - a: x y z - ": "literal-string"]} diff --git a/cpp/.traces/scenario_multiple_blocks b/cpp/.traces/scenario_multiple_blocks deleted file mode 100644 index 2a2b57cc..00000000 --- a/cpp/.traces/scenario_multiple_blocks +++ /dev/null @@ -1,80 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -parse/0: instruction: run -parse/0: ingredient: {name: " - 2:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 2:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 13 - 2 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - 2 <- 13 - ": "literal-string"]} -after-brace/0: recipe foo -after-brace/0: run ... -after-brace/0: memory-should-contain ... -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: foo -run/0: instruction foo/0 -run/0: run/45 {name: " - 1:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 1:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 1 -run/0: instruction foo/1 -run/0: memory-should-contain/46 {name: " - 1 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - ": "literal-string"]} -run/0: checking location 1 -run/0: instruction foo/2 -run/0: run/45 {name: " - 2:integer <- copy 13:literal - ", value: 0, type: 0, properties: [" - 2:integer <- copy 13:literal - ": "literal-string"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "13", value: 0, type: 0, properties: ["13": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe run1002 -after-brace/0: copy ... -run/0: instruction run1002/0 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "13", value: 13, type: 0, properties: ["13": "literal"]} -run/0: ingredient 0 is 13 -mem/0: storing 13 in location 2 -run/0: instruction foo/3 -run/0: memory-should-contain/46 {name: " - 1 <- 13 - 2 <- 13 - ", value: 0, type: 0, properties: [" - 1 <- 13 - 2 <- 13 - ": "literal-string"]} -run/0: checking location 1 -run/0: checking location 2 diff --git a/cpp/.traces/scenario_with_comment_in_mu b/cpp/.traces/scenario_with_comment_in_mu deleted file mode 100644 index ef0c74cc..00000000 --- a/cpp/.traces/scenario_with_comment_in_mu +++ /dev/null @@ -1,46 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - # comment - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - # comment - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -after-brace/0: recipe scenario_with_comment_in_mu -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: scenario_with_comment_in_mu -run/0: instruction scenario_with_comment_in_mu/0 -run/0: run/45 {name: " - # comment - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - # comment - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: add ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction scenario_with_comment_in_mu/1 -run/0: memory-should-contain/46 {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -run/0: checking location 1 diff --git a/cpp/.traces/scenario_with_multiple_comments_in_mu b/cpp/.traces/scenario_with_multiple_comments_in_mu deleted file mode 100644 index 80ad06dc..00000000 --- a/cpp/.traces/scenario_with_multiple_comments_in_mu +++ /dev/null @@ -1,50 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - # comment1 - # comment2 - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - # comment1 - # comment2 - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -after-brace/0: recipe scenario_with_multiple_comments_in_mu -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: scenario_with_multiple_comments_in_mu -run/0: instruction scenario_with_multiple_comments_in_mu/0 -run/0: run/45 {name: " - # comment1 - # comment2 - 1:integer <- add 2:literal, 2:literal - ", value: 0, type: 0, properties: [" - # comment1 - # comment2 - 1:integer <- add 2:literal, 2:literal - ": "literal-string"]} -parse/0: instruction: add -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe run1001 -after-brace/0: add ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -run/0: ingredient 1 is 2 -run/0: product 0 is 4 -mem/0: storing 4 in location 1 -run/0: instruction scenario_with_multiple_comments_in_mu/1 -run/0: memory-should-contain/46 {name: " - 1 <- 4 - ", value: 0, type: 0, properties: [" - 1 <- 4 - ": "literal-string"]} -run/0: checking location 1 diff --git a/cpp/.traces/scheduler b/cpp/.traces/scheduler deleted file mode 100644 index 4f1f0a31..00000000 --- a/cpp/.traces/scheduler +++ /dev/null @@ -1,28 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "4", value: 0, type: 0, properties: ["4": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: copy ... -after-brace/0: recipe f2 -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -run/0: instruction f1/1 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is 3 -mem/0: storing 3 in location 1 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "4", value: 4, type: 0, properties: ["4": "literal"]} -run/0: ingredient 0 is 4 -mem/0: storing 4 in location 2 diff --git a/cpp/.traces/scheduler_interleaves_routines b/cpp/.traces/scheduler_interleaves_routines deleted file mode 100644 index a9d4a4fb..00000000 --- a/cpp/.traces/scheduler_interleaves_routines +++ /dev/null @@ -1,49 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "4", value: 0, type: 0, properties: ["4": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "4", value: 0, type: 0, properties: ["4": "literal"]} -parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: recipe f2 -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "4", value: 4, type: 0, properties: ["4": "literal"]} -run/0: ingredient 0 is 4 -mem/0: storing 4 in location 3 -schedule/0: f1 -run/0: instruction f1/1 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 -schedule/0: f2 -run/0: instruction f2/1 -run/0: {name: "4", value: 4, type: 1, properties: ["4": "integer"]} <- copy/1 {name: "4", value: 4, type: 0, properties: ["4": "literal"]} -run/0: ingredient 0 is 4 -mem/0: storing 4 in location 4 -schedule/0: f1 -run/0: instruction f1/2 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 2 -schedule/0: f2 -schedule/0: f1 diff --git a/cpp/.traces/scheduler_runs_single_routine b/cpp/.traces/scheduler_runs_single_routine deleted file mode 100644 index 2847f47c..00000000 --- a/cpp/.traces/scheduler_runs_single_routine +++ /dev/null @@ -1,21 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe f1 -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 -schedule/0: f1 -run/0: instruction f1/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 2 -schedule/0: f1 diff --git a/cpp/.traces/scheduler_skips_completed_routines b/cpp/.traces/scheduler_skips_completed_routines deleted file mode 100644 index b8ed33a9..00000000 --- a/cpp/.traces/scheduler_skips_completed_routines +++ /dev/null @@ -1,28 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -new/0: routine allocated memory from 1000 to 101000 -new/0: routine allocated memory from 101000 to 201000 -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe f1 -after-brace/0: copy ... -after-brace/0: recipe f2 -after-brace/0: copy ... -after-brace/0: recipe f3 -after-brace/0: copy ... -new/0: routine allocated memory from 201000 to 301000 -schedule/0: f3 -run/0: instruction f3/0 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 3 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 diff --git a/cpp/.traces/scheduler_starts_at_middle_of_routines b/cpp/.traces/scheduler_starts_at_middle_of_routines deleted file mode 100644 index c51216fb..00000000 --- a/cpp/.traces/scheduler_starts_at_middle_of_routines +++ /dev/null @@ -1,20 +0,0 @@ -new/0: routine allocated memory from 1000 to 101000 -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe f1 -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 101000 to 201000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 -run/0: instruction f1/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 2 diff --git a/cpp/.traces/screen_in_scenario b/cpp/.traces/screen_in_scenario deleted file mode 100644 index 528d495b..00000000 --- a/cpp/.traces/screen_in_scenario +++ /dev/null @@ -1,899 +0,0 @@ -parse/0: instruction: assume-screen -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal", "width": ]} -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "height": ]} -parse/0: instruction: run -parse/0: ingredient: {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: screen-should-contain -parse/0: ingredient: {name: " - # 01234 - .a . - . . - . . - ", value: 0, type: 0, properties: [" - # 01234 - .a . - . . - . . - ": "literal-string"]} -after-brace/0: recipe screen-in-scenario -after-brace/0: assume-screen ... -after-brace/0: run ... -after-brace/0: screen-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: screen-in-scenario -run/0: instruction screen-in-scenario/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- assume-screen/115 {name: "5", value: 5, type: 0, properties: ["5": "literal", "width": ]}, {name: "3", value: 3, type: 0, properties: ["3": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 5 -mem/0: location 1003 is 1032 -mem/0: storing 5 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1004 is 1031 -mem/0: storing 3 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 5 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 15 -mem/0: storing 15 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 15 -mem/0: array size is 15 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1052 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1054 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1054 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1054 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1055 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1055 is 1036 -mem/0: storing 15 in location 1056 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1057 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 6 -run/0: address to copy is 1043 -run/0: product 0 is 1043 -mem/0: storing 1043 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1043 -mem/0: storing 0 in location 1043 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 7 -run/0: address to copy is 1044 -run/0: product 0 is 1044 -mem/0: storing 1044 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1044 -mem/0: storing 0 in location 1044 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 8 -run/0: address to copy is 1045 -run/0: product 0 is 1045 -mem/0: storing 1045 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1045 -mem/0: storing 0 in location 1045 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 9 -run/0: address to copy is 1046 -run/0: product 0 is 1046 -mem/0: storing 1046 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1046 -mem/0: storing 0 in location 1046 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 10 -run/0: address to copy is 1047 -run/0: product 0 is 1047 -mem/0: storing 1047 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1047 -mem/0: storing 0 in location 1047 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 11 -run/0: address to copy is 1048 -run/0: product 0 is 1048 -mem/0: storing 1048 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1048 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is 1 -run/0: product 0 is 12 -mem/0: storing 12 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 12 -run/0: address to copy is 1049 -run/0: product 0 is 1049 -mem/0: storing 1049 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1049 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is 1 -run/0: product 0 is 13 -mem/0: storing 13 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 13 -run/0: address to copy is 1050 -run/0: product 0 is 1050 -mem/0: storing 1050 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1050 -mem/0: storing 0 in location 1050 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is 1 -run/0: product 0 is 14 -mem/0: storing 14 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 14 -run/0: address to copy is 1051 -run/0: product 0 is 1051 -mem/0: storing 1051 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1051 -mem/0: storing 0 in location 1051 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is 1 -run/0: product 0 is 15 -mem/0: storing 15 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 15 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 1 -mem/0: storing 1 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1054 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction screen-in-scenario/1 -run/0: run/45 {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -after-brace/0: recipe run1002 -after-brace/0: print-character ... -run/0: instruction run1002/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- print-character/117 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 900 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1083 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1085 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1086 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1085 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1087 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1088 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1089 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1087 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1090 is 0 -run/0: ingredient 1 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1091 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1091 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1090 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1092 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1086 is 97 -mem/0: location 1092 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1093 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1093 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1088 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1085 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction screen-in-scenario/2 -run/0: screen-should-contain/62 {name: " - # 01234 - .a . - . . - . . - ", value: 0, type: 0, properties: [" - # 01234 - .a . - . . - . . - ": "literal-string"]} -run/0: checking screen size at 1036 -run/0: checking location 1037 -run/0: checking location 1038 -run/0: checking location 1039 -run/0: checking location 1040 -run/0: checking location 1041 -run/0: checking location 1042 -run/0: checking location 1043 -run/0: checking location 1044 -run/0: checking location 1045 -run/0: checking location 1046 -run/0: checking location 1047 -run/0: checking location 1048 -run/0: checking location 1049 -run/0: checking location 1050 -run/0: checking location 1051 diff --git a/cpp/.traces/screen_in_scenario_error b/cpp/.traces/screen_in_scenario_error deleted file mode 100644 index 218d5f40..00000000 --- a/cpp/.traces/screen_in_scenario_error +++ /dev/null @@ -1,886 +0,0 @@ -parse/0: instruction: assume-screen -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal", "width": ]} -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal", "height": ]} -parse/0: instruction: run -parse/0: ingredient: {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: screen-should-contain -parse/0: ingredient: {name: " - # 01234 - .b . - . . - . . - ", value: 0, type: 0, properties: [" - # 01234 - .b . - . . - . . - ": "literal-string"]} -after-brace/0: recipe screen-in-scenario-error -after-brace/0: assume-screen ... -after-brace/0: run ... -after-brace/0: screen-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: screen-in-scenario-error -run/0: instruction screen-in-scenario-error/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- assume-screen/115 {name: "5", value: 5, type: 0, properties: ["5": "literal", "width": ]}, {name: "3", value: 3, type: 0, properties: ["3": "literal", "height": ]} -run/0: instruction init-fake-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal", "capacity": ]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction init-fake-screen/1 -run/0: {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} <- new/44 {name: "screen", value: 11, type: 0, properties: ["screen": "type"]} -mem/0: new alloc: 1031 -mem/0: storing 1031 in location 1002 -run/0: instruction init-fake-screen/2 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1003 -run/0: instruction init-fake-screen/3 -run/0: {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 5 -mem/0: location 1003 is 1032 -mem/0: storing 5 in location 1032 -run/0: instruction init-fake-screen/4 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "num-rows", value: 0, type: 0, properties: ["num-rows": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is num-rows -run/0: address to copy is 1031 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1004 -run/0: instruction init-fake-screen/5 -run/0: {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: location 1004 is 1031 -mem/0: storing 3 in location 1031 -run/0: instruction init-fake-screen/6 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1005 -run/0: instruction init-fake-screen/7 -run/0: {name: "row", value: 4, type: 2-1, properties: ["row": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1005 is 1033 -mem/0: storing 0 in location 1033 -run/0: instruction init-fake-screen/8 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1006 -run/0: instruction init-fake-screen/9 -run/0: {name: "column", value: 5, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: location 1006 is 1034 -mem/0: storing 0 in location 1034 -run/0: instruction init-fake-screen/10 -run/0: {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} <- multiply/4 {name: "width", value: 2, type: 2-1, properties: ["width": "address":"integer", "deref": ]}, {name: "height", value: 3, type: 2-1, properties: ["height": "address":"integer", "deref": ]} -run/0: ingredient 0 is width -mem/0: location 1003 is 1032 -mem/0: location 1032 is 5 -run/0: ingredient 1 is height -mem/0: location 1004 is 1031 -mem/0: location 1031 is 3 -run/0: ingredient 1 is 3 -run/0: product 0 is 15 -mem/0: storing 15 in location 1007 -run/0: instruction init-fake-screen/11 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character"]} <- get-address/25 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is result -mem/0: location 1002 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1008 -run/0: instruction init-fake-screen/12 -run/0: {name: "buf", value: 7, type: 2-2-5-4, properties: ["buf": "address":"address":"array":"character", "deref": ]} <- new/44 {name: "character", value: 0, type: 0, properties: ["character": "literal"]}, {name: "bufsize", value: 6, type: 1, properties: ["bufsize": "integer"]} -mem/0: location 1007 is 15 -mem/0: array size is 15 -mem/0: new alloc: 1036 -mem/0: location 1008 is 1035 -mem/0: storing 1036 in location 1035 -run/0: instruction init-fake-screen/13 -run/0: clear-screen/116 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: instruction clear-screen/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1052 -run/0: instruction clear-screen/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1054 -run/0: instruction clear-screen/3 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 12, type: , properties: ["": ]} -mem/0: location 1054 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction clear-screen/4 -run/0: {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1054 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1055 -run/0: instruction clear-screen/5 -run/0: {name: "max", value: 3, type: 1, properties: ["max": "integer"]} <- length/28 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]} -mem/0: location 1055 is 1036 -mem/0: storing 15 in location 1056 -run/0: instruction clear-screen/6 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1057 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1037 -mem/0: storing 0 in location 1037 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 1 -run/0: address to copy is 1038 -run/0: product 0 is 1038 -mem/0: storing 1038 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1038 -mem/0: storing 0 in location 1038 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 2 -run/0: address to copy is 1039 -run/0: product 0 is 1039 -mem/0: storing 1039 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1039 -mem/0: storing 0 in location 1039 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 3 -run/0: address to copy is 1040 -run/0: product 0 is 1040 -mem/0: storing 1040 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1040 -mem/0: storing 0 in location 1040 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 4 -run/0: address to copy is 1041 -run/0: product 0 is 1041 -mem/0: storing 1041 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1041 -mem/0: storing 0 in location 1041 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 5 -run/0: address to copy is 1042 -run/0: product 0 is 1042 -mem/0: storing 1042 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1042 -mem/0: storing 0 in location 1042 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 6 -run/0: address to copy is 1043 -run/0: product 0 is 1043 -mem/0: storing 1043 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1043 -mem/0: storing 0 in location 1043 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 7 -run/0: address to copy is 1044 -run/0: product 0 is 1044 -mem/0: storing 1044 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1044 -mem/0: storing 0 in location 1044 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 8 -run/0: address to copy is 1045 -run/0: product 0 is 1045 -mem/0: storing 1045 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1045 -mem/0: storing 0 in location 1045 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 9 -run/0: address to copy is 1046 -run/0: product 0 is 1046 -mem/0: storing 1046 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1046 -mem/0: storing 0 in location 1046 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 10 -run/0: address to copy is 1047 -run/0: product 0 is 1047 -mem/0: storing 1047 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1047 -mem/0: storing 0 in location 1047 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 10 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 11 -run/0: address to copy is 1048 -run/0: product 0 is 1048 -mem/0: storing 1048 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1048 -mem/0: storing 0 in location 1048 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 11 -run/0: ingredient 1 is 1 -run/0: product 0 is 12 -mem/0: storing 12 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 12 -run/0: address to copy is 1049 -run/0: product 0 is 1049 -mem/0: storing 1049 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1049 -mem/0: storing 0 in location 1049 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 12 -run/0: ingredient 1 is 1 -run/0: product 0 is 13 -mem/0: storing 13 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 13 -run/0: address to copy is 1050 -run/0: product 0 is 1050 -mem/0: storing 1050 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1050 -mem/0: storing 0 in location 1050 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 13 -run/0: ingredient 1 is 1 -run/0: product 0 is 14 -mem/0: storing 14 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 0 -mem/0: storing 0 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction clear-screen/10 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character"]} <- index-address/27 {name: "buf", value: 2, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1055 is 1036 -run/0: ingredient 1 is {name: "i", value: 4, type: 1, properties: ["i": "integer"]} -mem/0: location 1057 is 14 -run/0: address to copy is 1051 -run/0: product 0 is 1051 -mem/0: storing 1051 in location 1059 -run/0: instruction clear-screen/11 -run/0: {name: "c", value: 6, type: 2-4, properties: ["c": "address":"character", "deref": ]} <- copy/1 {name: " ", value: 0, type: 0, properties: [" ": "literal-string"]} -run/0: ingredient 0 is -mem/0: location 1059 is 1051 -mem/0: storing 0 in location 1051 -run/0: instruction clear-screen/12 -run/0: {name: "i", value: 4, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 14 -run/0: ingredient 1 is 1 -run/0: product 0 is 15 -mem/0: storing 15 in location 1057 -run/0: instruction clear-screen/13 -run/0: loop/10 {name: "", value: -6, type: , properties: ["": ]} -run/0: ingredient 0 is -6 -run/0: jumping to instruction 8 -run/0: instruction clear-screen/8 -run/0: {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 4, type: 1, properties: ["i": "integer"]}, {name: "max", value: 3, type: 1, properties: ["max": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1057 is 15 -run/0: ingredient 1 is max -mem/0: location 1056 is 15 -run/0: product 0 is 1 -mem/0: storing 1 in location 1058 -run/0: instruction clear-screen/9 -run/0: break-if/11 {name: "done?", value: 5, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 4, type: , properties: ["": ]} -mem/0: location 1058 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 14 -run/0: instruction clear-screen/15 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1054 is 1031 -run/0: instruction init-fake-screen/14 -run/0: reply/33 {name: "result", value: 1, type: 2-11, properties: ["result": "address":"screen"]} -mem/0: location 1002 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction screen-in-scenario-error/1 -run/0: run/45 {name: " - screen:address <- print-character screen:address, 97:literal # 'a' - ", value: 0, type: 0, properties: [" - screen:address <- print-character screen:address, 97:literal # 'a' - ": "literal-string"]} -parse/0: instruction: print-character -parse/0: ingredient: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -parse/0: ingredient: {name: "97", value: 0, type: 0, properties: ["97": "literal"]} -parse/0: product: {name: "screen", value: 0, type: 2, properties: ["screen": "address"]} -after-brace/0: recipe run1001 -after-brace/0: print-character ... -run/0: instruction run1001/0 -run/0: {name: "screen", value: 900, type: 2, properties: ["screen": "address"]} <- print-character/117 {name: "screen", value: 900, type: 2, properties: ["screen": "address"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]} -mem/0: location 900 is 1031 -run/0: instruction print-character/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1083 -run/0: instruction print-character/1 -run/0: {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1085 -run/0: instruction print-character/2 -run/0: {name: "c", value: 2, type: 4, properties: ["c": "character"]} <- next-ingredient/30 -run/0: product 0 is 97 -mem/0: storing 97 in location 1086 -run/0: instruction print-character/4 -run/0: break-unless/12 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen"]}, {name: "", value: 14, type: , properties: ["": ]} -mem/0: location 1085 is 1031 -run/0: ingredient 0 is 1031 -run/0: jump-unless fell through -run/0: instruction print-character/5 -run/0: {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-row", value: 2, type: 0, properties: ["cursor-row": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-row -run/0: address to copy is 1033 -run/0: product 0 is 1033 -mem/0: storing 1033 in location 1087 -run/0: instruction print-character/6 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer"]} <- get-address/25 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "cursor-column", value: 3, type: 0, properties: ["cursor-column": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is cursor-column -run/0: address to copy is 1034 -run/0: product 0 is 1034 -mem/0: storing 1034 in location 1088 -run/0: instruction print-character/7 -run/0: {name: "width", value: 5, type: 1, properties: ["width": "integer"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "num-columns", value: 1, type: 0, properties: ["num-columns": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is num-columns -run/0: address to copy is 1032 -run/0: its type is 1 -mem/0: location 1032 is 5 -run/0: product 0 is 5 -mem/0: storing 5 in location 1089 -run/0: instruction print-character/8 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- multiply/4 {name: "row", value: 3, type: 2-1, properties: ["row": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is row -mem/0: location 1087 is 1033 -mem/0: location 1033 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: ingredient 1 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/9 -run/0: {name: "index", value: 6, type: 1, properties: ["index": "integer"]} <- add/2 {name: "index", value: 6, type: 1, properties: ["index": "integer"]}, {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} -run/0: ingredient 0 is index -mem/0: location 1090 is 0 -run/0: ingredient 1 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: product 0 is 0 -mem/0: storing 0 in location 1090 -run/0: instruction print-character/10 -run/0: {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character"]} <- get/24 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "deref": ]}, {name: "data", value: 4, type: 0, properties: ["data": "offset"]} -run/0: ingredient 0 is x -mem/0: location 1085 is 1031 -run/0: ingredient 1 is data -run/0: address to copy is 1035 -run/0: its type is 2 -mem/0: location 1035 is 1036 -run/0: product 0 is 1036 -mem/0: storing 1036 in location 1091 -run/0: instruction print-character/11 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character"]} <- index-address/27 {name: "buf", value: 7, type: 2-5-4, properties: ["buf": "address":"array":"character", "deref": ]}, {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -run/0: ingredient 0 is buf -mem/0: location 1091 is 1036 -run/0: ingredient 1 is {name: "index", value: 6, type: 1, properties: ["index": "integer"]} -mem/0: location 1090 is 0 -run/0: address to copy is 1037 -run/0: product 0 is 1037 -mem/0: storing 1037 in location 1092 -run/0: instruction print-character/12 -run/0: {name: "cursor", value: 8, type: 2-4, properties: ["cursor": "address":"character", "deref": ]} <- copy/1 {name: "c", value: 2, type: 4, properties: ["c": "character"]} -run/0: ingredient 0 is c -mem/0: location 1086 is 97 -mem/0: location 1092 is 1037 -mem/0: storing 97 in location 1037 -run/0: instruction print-character/14 -run/0: {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]} <- equal/13 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "width", value: 5, type: 1, properties: ["width": "integer"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is width -mem/0: location 1089 is 5 -run/0: product 0 is 0 -mem/0: storing 0 in location 1093 -run/0: instruction print-character/15 -run/0: break-if/11 {name: "at-right?", value: 9, type: 3, properties: ["at-right?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1093 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction print-character/16 -run/0: {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]} <- add/2 {name: "column", value: 4, type: 2-1, properties: ["column": "address":"integer", "deref": ]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is column -mem/0: location 1088 is 1034 -mem/0: location 1034 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: location 1088 is 1034 -mem/0: storing 1 in location 1034 -run/0: instruction print-character/18 -run/0: reply/33 {name: "x", value: 1, type: 2-11, properties: ["x": "address":"screen", "same-as-ingredient": "0"]} -mem/0: location 1085 is 1031 -run/0: result 0 is 1031 -mem/0: storing 1031 in location 900 -run/0: instruction screen-in-scenario-error/2 -run/0: screen-should-contain/62 {name: " - # 01234 - .b . - . . - . . - ", value: 0, type: 0, properties: [" - # 01234 - .b . - . . - . . - ": "literal-string"]} -run/0: checking screen size at 1036 -run/0: checking location 1037 -warn/0: expected screen location (0, 0) to contain 'b' instead of 'a' diff --git a/cpp/.traces/set_default_space b/cpp/.traces/set_default_space deleted file mode 100644 index b26649b0..00000000 --- a/cpp/.traces/set_default_space +++ /dev/null @@ -1,26 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "10", value: 0, type: 1, properties: ["10": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "10", value: 10, type: 1, properties: ["10": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 10 -run/0: instruction main/1 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is 10 -run/0: instruction main/2 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 12 diff --git a/cpp/.traces/start_running_returns_routine_id b/cpp/.traces/start_running_returns_routine_id deleted file mode 100644 index dde9fca2..00000000 --- a/cpp/.traces/start_running_returns_routine_id +++ /dev/null @@ -1,22 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "44", value: 0, type: 0, properties: ["44": "literal"]} -parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: recipe f2 -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -mem/0: storing 2 in location 1 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "12", value: 12, type: 1, properties: ["12": "integer"]} <- copy/1 {name: "44", value: 44, type: 0, properties: ["44": "literal"]} -run/0: ingredient 0 is 44 -mem/0: storing 44 in location 12 diff --git a/cpp/.traces/start_running_takes_args b/cpp/.traces/start_running_takes_args deleted file mode 100644 index 062c7371..00000000 --- a/cpp/.traces/start_running_takes_args +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} -parse/0: instruction: next-ingredient -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: add -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -after-brace/0: recipe f1 -after-brace/0: start-running ... -after-brace/0: recipe f2 -after-brace/0: next-ingredient ... -after-brace/0: add ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]}, {name: "3", value: 3, type: 0, properties: ["3": "literal"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- next-ingredient/30 -run/0: product 0 is 3 -mem/0: storing 3 in location 1 -run/0: instruction f2/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- add/2 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 2 diff --git a/cpp/.traces/store_indirect b/cpp/.traces/store_indirect deleted file mode 100644 index 7fec6492..00000000 --- a/cpp/.traces/store_indirect +++ /dev/null @@ -1,20 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer", "deref": ]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer"]} <- copy/1 {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 2 -mem/0: storing 2 in location 1 -run/0: instruction main/1 -run/0: {name: "1", value: 1, type: 2-1, properties: ["1": "address":"integer", "deref": ]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: location 1 is 2 -mem/0: storing 34 in location 2 diff --git a/cpp/.traces/string-append-1 b/cpp/.traces/string-append-1 deleted file mode 100644 index 933e2d37..00000000 --- a/cpp/.traces/string-append-1 +++ /dev/null @@ -1,937 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - 1:address:array:character/raw <- new [hello,] - 2:address:array:character/raw <- new [ world!] - 3:address:array:character/raw <- string-append 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [hello,] - 2:address:array:character/raw <- new [ world!] - 3:address:array:character/raw <- string-append 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 4:string <- [hello, world!] - ", value: 0, type: 0, properties: [" - 4:string <- [hello, world!] - ": "literal-string"]} -after-brace/0: recipe string-append-1 -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-append-1 -run/0: instruction string-append-1/0 -run/0: run/45 {name: " - 1:address:array:character/raw <- new [hello,] - 2:address:array:character/raw <- new [ world!] - 3:address:array:character/raw <- string-append 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ", value: 0, type: 0, properties: [" - 1:address:array:character/raw <- new [hello,] - 2:address:array:character/raw <- new [ world!] - 3:address:array:character/raw <- string-append 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "hello,", value: 0, type: 0, properties: ["hello,": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: instruction: new -parse/0: ingredient: {name: " world!", value: 0, type: 0, properties: [" world!": "literal-string"]} -parse/0: product: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: instruction: string-append -parse/0: ingredient: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} -parse/0: ingredient: {name: "2", value: 0, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -parse/0: product: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "3", value: 0, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -parse/0: product: {name: "4", value: 0, type: 5-4, properties: ["4": "array":"character", "raw": ]} -new/0: hello, -> 0 -new/0: world! -> 0 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-append ... -after-brace/0: copy ... -run/0: instruction run1001/0 -run/0: {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]} <- new/44 {name: "hello,", value: 0, type: 0, properties: ["hello,": "literal-string"]} -mem/0: storing 1000 in location 1 -run/0: instruction run1001/1 -run/0: {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} <- new/44 {name: " world!", value: 0, type: 0, properties: [" world!": "literal-string"]} -mem/0: storing 1007 in location 2 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": ]} <- string-append/106 {name: "1", value: 1, type: 2-5-4, properties: ["1": "address":"array":"character", "raw": ]}, {name: "2", value: 2, type: 2-5-4, properties: ["2": "address":"array":"character", "raw": ]} -mem/0: location 1 is 1000 -mem/0: location 2 is 1007 -run/0: instruction string-append/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1015 -run/0: instruction string-append/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1000 -mem/0: storing 1000 in location 1017 -run/0: instruction string-append/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -mem/0: storing 6 in location 1018 -run/0: instruction string-append/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1007 -mem/0: storing 1007 in location 1019 -run/0: instruction string-append/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -mem/0: storing 7 in location 1020 -run/0: instruction string-append/5 -run/0: {name: "result-len", value: 5, type: 1, properties: ["result-len": "integer"]} <- add/2 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1018 is 6 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 13 -mem/0: storing 13 in location 1021 -run/0: instruction string-append/6 -run/0: {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character"]} <- new/44 {name: "character", value: 4, type: 0, properties: ["character": "type"]}, {name: "result-len", value: 5, type: 1, properties: ["result-len": "integer"]} -mem/0: location 1021 is 13 -mem/0: array size is 13 -mem/0: new alloc: 1046 -mem/0: storing 1046 in location 1022 -run/0: instruction string-append/7 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1023 -run/0: instruction string-append/8 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 0 -run/0: address to copy is 1047 -run/0: product 0 is 1047 -mem/0: storing 1047 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 0 -run/0: address to copy is 1001 -run/0: its type is 4 -mem/0: location 1001 is 104 -run/0: product 0 is 104 -mem/0: storing 104 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 104 -mem/0: location 1026 is 1047 -mem/0: storing 104 in location 1047 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 1 -run/0: address to copy is 1048 -run/0: product 0 is 1048 -mem/0: storing 1048 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 1 -run/0: address to copy is 1002 -run/0: its type is 4 -mem/0: location 1002 is 101 -run/0: product 0 is 101 -mem/0: storing 101 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 101 -mem/0: location 1026 is 1048 -mem/0: storing 101 in location 1048 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 2 -run/0: address to copy is 1049 -run/0: product 0 is 1049 -mem/0: storing 1049 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 2 -run/0: address to copy is 1003 -run/0: its type is 4 -mem/0: location 1003 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 108 -mem/0: location 1026 is 1049 -mem/0: storing 108 in location 1049 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 3 -run/0: address to copy is 1050 -run/0: product 0 is 1050 -mem/0: storing 1050 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 3 -run/0: address to copy is 1004 -run/0: its type is 4 -mem/0: location 1004 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 108 -mem/0: location 1026 is 1050 -mem/0: storing 108 in location 1050 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 4 -run/0: address to copy is 1051 -run/0: product 0 is 1051 -mem/0: storing 1051 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 4 -run/0: address to copy is 1005 -run/0: its type is 4 -mem/0: location 1005 is 111 -run/0: product 0 is 111 -mem/0: storing 111 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 111 -mem/0: location 1026 is 1051 -mem/0: storing 111 in location 1051 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 0 -mem/0: storing 0 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/12 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 5 -run/0: address to copy is 1052 -run/0: product 0 is 1052 -mem/0: storing 1052 in location 1026 -run/0: instruction string-append/13 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1017 is 1000 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 5 -run/0: address to copy is 1006 -run/0: its type is 4 -mem/0: location 1006 is 44 -run/0: product 0 is 44 -mem/0: storing 44 in location 1027 -run/0: instruction string-append/14 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 44 -mem/0: location 1026 is 1052 -mem/0: storing 44 in location 1052 -run/0: instruction string-append/15 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1024 -run/0: instruction string-append/16 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1023 -run/0: instruction string-append/17 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 10 -run/0: instruction string-append/10 -run/0: {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 6 -run/0: ingredient 1 is a-len -mem/0: location 1018 is 6 -run/0: product 0 is 1 -mem/0: storing 1 in location 1025 -run/0: instruction string-append/11 -run/0: break-if/11 {name: "a-done?", value: 9, type: 3, properties: ["a-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1025 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 18 -run/0: instruction string-append/19 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1024 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 6 -run/0: address to copy is 1053 -run/0: product 0 is 1053 -mem/0: storing 1053 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 0 -run/0: address to copy is 1008 -run/0: its type is 4 -mem/0: location 1008 is 32 -run/0: product 0 is 32 -mem/0: storing 32 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 32 -mem/0: location 1026 is 1053 -mem/0: storing 32 in location 1053 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 7 -run/0: address to copy is 1054 -run/0: product 0 is 1054 -mem/0: storing 1054 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 1 -run/0: address to copy is 1009 -run/0: its type is 4 -mem/0: location 1009 is 119 -run/0: product 0 is 119 -mem/0: storing 119 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 119 -mem/0: location 1026 is 1054 -mem/0: storing 119 in location 1054 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 7 -run/0: ingredient 1 is 1 -run/0: product 0 is 8 -mem/0: storing 8 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 8 -run/0: address to copy is 1055 -run/0: product 0 is 1055 -mem/0: storing 1055 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 2 -run/0: address to copy is 1010 -run/0: its type is 4 -mem/0: location 1010 is 111 -run/0: product 0 is 111 -mem/0: storing 111 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 111 -mem/0: location 1026 is 1055 -mem/0: storing 111 in location 1055 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 8 -run/0: ingredient 1 is 1 -run/0: product 0 is 9 -mem/0: storing 9 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 9 -run/0: address to copy is 1056 -run/0: product 0 is 1056 -mem/0: storing 1056 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 3 -run/0: address to copy is 1011 -run/0: its type is 4 -mem/0: location 1011 is 114 -run/0: product 0 is 114 -mem/0: storing 114 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 114 -mem/0: location 1026 is 1056 -mem/0: storing 114 in location 1056 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 3 -run/0: ingredient 1 is 1 -run/0: product 0 is 4 -mem/0: storing 4 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 9 -run/0: ingredient 1 is 1 -run/0: product 0 is 10 -mem/0: storing 10 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 10 -run/0: address to copy is 1057 -run/0: product 0 is 1057 -mem/0: storing 1057 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 4 -run/0: address to copy is 1012 -run/0: its type is 4 -mem/0: location 1012 is 108 -run/0: product 0 is 108 -mem/0: storing 108 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 108 -mem/0: location 1026 is 1057 -mem/0: storing 108 in location 1057 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 4 -run/0: ingredient 1 is 1 -run/0: product 0 is 5 -mem/0: storing 5 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 10 -run/0: ingredient 1 is 1 -run/0: product 0 is 11 -mem/0: storing 11 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 11 -run/0: address to copy is 1058 -run/0: product 0 is 1058 -mem/0: storing 1058 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 5 -run/0: address to copy is 1013 -run/0: its type is 4 -mem/0: location 1013 is 100 -run/0: product 0 is 100 -mem/0: storing 100 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 100 -mem/0: location 1026 is 1058 -mem/0: storing 100 in location 1058 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 5 -run/0: ingredient 1 is 1 -run/0: product 0 is 6 -mem/0: storing 6 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 11 -run/0: ingredient 1 is 1 -run/0: product 0 is 12 -mem/0: storing 12 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 6 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 0 -mem/0: storing 0 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-append/23 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character"]} <- index-address/27 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character", "deref": ]}, {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -run/0: ingredient 0 is result -mem/0: location 1022 is 1046 -run/0: ingredient 1 is {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} -mem/0: location 1023 is 12 -run/0: address to copy is 1059 -run/0: product 0 is 1059 -mem/0: storing 1059 in location 1026 -run/0: instruction string-append/24 -run/0: {name: "in", value: 11, type: 4, properties: ["in": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1019 is 1007 -run/0: ingredient 1 is {name: "i", value: 8, type: 1, properties: ["i": "integer"]} -mem/0: location 1024 is 6 -run/0: address to copy is 1014 -run/0: its type is 4 -mem/0: location 1014 is 33 -run/0: product 0 is 33 -mem/0: storing 33 in location 1027 -run/0: instruction string-append/25 -run/0: {name: "out", value: 10, type: 2-4, properties: ["out": "address":"character", "deref": ]} <- copy/1 {name: "in", value: 11, type: 4, properties: ["in": "character"]} -run/0: ingredient 0 is in -mem/0: location 1027 is 33 -mem/0: location 1026 is 1059 -mem/0: storing 33 in location 1059 -run/0: instruction string-append/26 -run/0: {name: "i", value: 8, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 6 -run/0: ingredient 1 is 1 -run/0: product 0 is 7 -mem/0: storing 7 in location 1024 -run/0: instruction string-append/27 -run/0: {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]} <- add/2 {name: "result-idx", value: 7, type: 1, properties: ["result-idx": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is result-idx -mem/0: location 1023 is 12 -run/0: ingredient 1 is 1 -run/0: product 0 is 13 -mem/0: storing 13 in location 1023 -run/0: instruction string-append/28 -run/0: loop/10 {name: "", value: -8, type: , properties: ["": ]} -run/0: ingredient 0 is -8 -run/0: jumping to instruction 21 -run/0: instruction string-append/21 -run/0: {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 8, type: 1, properties: ["i": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1024 is 7 -run/0: ingredient 1 is b-len -mem/0: location 1020 is 7 -run/0: product 0 is 1 -mem/0: storing 1 in location 1028 -run/0: instruction string-append/22 -run/0: break-if/11 {name: "b-done?", value: 12, type: 3, properties: ["b-done?": "boolean"]}, {name: "", value: 6, type: , properties: ["": ]} -mem/0: location 1028 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 29 -run/0: instruction string-append/30 -run/0: reply/33 {name: "result", value: 6, type: 2-5-4, properties: ["result": "address":"array":"character"]} -mem/0: location 1022 is 1046 -run/0: result 0 is 1046 -mem/0: storing 1046 in location 3 -run/0: instruction run1001/3 -run/0: {name: "4", value: 4, type: 5-4, properties: ["4": "array":"character", "raw": ]} <- copy/1 {name: "3", value: 3, type: 2-5-4, properties: ["3": "address":"array":"character", "raw": , "deref": ]} -run/0: ingredient 0 is 3 -mem/0: location 3 is 1046 -mem/0: location 1046 is 13 -mem/0: location 1047 is 104 -mem/0: location 1048 is 101 -mem/0: location 1049 is 108 -mem/0: location 1050 is 108 -mem/0: location 1051 is 111 -mem/0: location 1052 is 44 -mem/0: location 1053 is 32 -mem/0: location 1054 is 119 -mem/0: location 1055 is 111 -mem/0: location 1056 is 114 -mem/0: location 1057 is 108 -mem/0: location 1058 is 100 -mem/0: location 1059 is 33 -mem/0: storing 13 in location 4 -mem/0: storing 104 in location 5 -mem/0: storing 101 in location 6 -mem/0: storing 108 in location 7 -mem/0: storing 108 in location 8 -mem/0: storing 111 in location 9 -mem/0: storing 44 in location 10 -mem/0: storing 32 in location 11 -mem/0: storing 119 in location 12 -mem/0: storing 111 in location 13 -mem/0: storing 114 in location 14 -mem/0: storing 108 in location 15 -mem/0: storing 100 in location 16 -mem/0: storing 33 in location 17 -run/0: instruction string-append-1/1 -run/0: memory-should-contain/46 {name: " - 4:string <- [hello, world!] - ", value: 0, type: 0, properties: [" - 4:string <- [hello, world!] - ": "literal-string"]} -run/0: checking string length at 4 -run/0: checking location 5 -run/0: checking location 6 -run/0: checking location 7 -run/0: checking location 8 -run/0: checking location 9 -run/0: checking location 10 -run/0: checking location 11 -run/0: checking location 12 -run/0: checking location 13 -run/0: checking location 14 -run/0: checking location 15 -run/0: checking location 16 -run/0: checking location 17 diff --git a/cpp/.traces/string-equal-common-lengths-but-distinct b/cpp/.traces/string-equal-common-lengths-but-distinct deleted file mode 100644 index 4af26a30..00000000 --- a/cpp/.traces/string-equal-common-lengths-but-distinct +++ /dev/null @@ -1,296 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 0 # abc != abd - ", value: 0, type: 0, properties: [" - 3 <- 0 # abc != abd - ": "literal-string"]} -after-brace/0: recipe string-equal-common-lengths-but-distinct -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-equal-common-lengths-but-distinct -run/0: instruction string-equal-common-lengths-but-distinct/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abd", value: 0, type: 0, properties: ["abd": "literal-string"]} -parse/0: product: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: instruction: string-equal -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: ingredient: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: location -> 1 -new/0: abc -> 0 -name/0: assign x 1 -new/0: abd -> 0 -name/0: assign y 2 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-equal ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1031 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} <- new/44 {name: "abd", value: 0, type: 0, properties: ["abd": "literal-string"]} -mem/0: storing 1035 in location 1003 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- string-equal/100 {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]}, {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} -mem/0: location 1002 is 1031 -mem/0: location 1003 is 1035 -run/0: instruction string-equal/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction string-equal/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction string-equal/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -mem/0: storing 3 in location 1042 -run/0: instruction string-equal/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1043 -run/0: instruction string-equal/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -mem/0: storing 3 in location 1044 -run/0: instruction string-equal/6 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing lengths", value: 0, type: 0, properties: ["comparing lengths": "literal-string"]} -string-equal/0: comparing lengths -run/0: instruction string-equal/7 -run/0: {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]} <- equal/13 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1042 is 3 -run/0: ingredient 1 is b-len -mem/0: location 1044 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1045 -run/0: instruction string-equal/8 -run/0: break-if/11 {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1045 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 10 -run/0: instruction string-equal/11 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing characters", value: 0, type: 0, properties: ["comparing characters": "literal-string"]} -string-equal/0: comparing characters -run/0: instruction string-equal/12 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1046 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 0 -run/0: address to copy is 1032 -run/0: its type is 4 -mem/0: location 1032 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 0 -run/0: address to copy is 1036 -run/0: its type is 4 -mem/0: location 1036 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 97 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 97 -run/0: product 0 is 1 -mem/0: storing 1 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1046 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 1 -run/0: address to copy is 1033 -run/0: its type is 4 -mem/0: location 1033 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 1 -run/0: address to copy is 1037 -run/0: its type is 4 -mem/0: location 1037 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 98 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 98 -run/0: product 0 is 1 -mem/0: storing 1 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1046 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 2 -run/0: address to copy is 1034 -run/0: its type is 4 -mem/0: location 1034 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 2 -run/0: address to copy is 1038 -run/0: its type is 4 -mem/0: location 1038 is 100 -run/0: product 0 is 100 -mem/0: storing 100 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 99 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 100 -run/0: product 0 is 0 -mem/0: storing 0 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/21 -run/0: reply/33 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction string-equal-common-lengths-but-distinct/1 -run/0: memory-should-contain/46 {name: " - 3 <- 0 # abc != abd - ", value: 0, type: 0, properties: [" - 3 <- 0 # abc != abd - ": "literal-string"]} -run/0: checking location 3 diff --git a/cpp/.traces/string-equal-distinct-lengths b/cpp/.traces/string-equal-distinct-lengths deleted file mode 100644 index 3a92b204..00000000 --- a/cpp/.traces/string-equal-distinct-lengths +++ /dev/null @@ -1,146 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 0 # abc != abcd - ", value: 0, type: 0, properties: [" - 3 <- 0 # abc != abcd - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - string-equal: comparing lengths - ", value: 0, type: 0, properties: [" - string-equal: comparing lengths - ": "literal-string"]} -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - string-equal: comparing characters - ", value: 0, type: 0, properties: [" - string-equal: comparing characters - ": "literal-string"]} -after-brace/0: recipe string-equal-distinct-lengths -after-brace/0: run ... -after-brace/0: memory-should-contain ... -after-brace/0: trace-should-contain ... -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-equal-distinct-lengths -run/0: instruction string-equal-distinct-lengths/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} -parse/0: product: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: instruction: string-equal -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: ingredient: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: location -> 1 -new/0: abc -> 0 -name/0: assign x 1 -new/0: abcd -> 0 -name/0: assign y 2 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-equal ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1031 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} <- new/44 {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} -mem/0: storing 1035 in location 1003 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- string-equal/100 {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]}, {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} -mem/0: location 1002 is 1031 -mem/0: location 1003 is 1035 -run/0: instruction string-equal/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1040 -run/0: instruction string-equal/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1042 -run/0: instruction string-equal/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1042 is 1031 -mem/0: storing 3 in location 1043 -run/0: instruction string-equal/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1044 -run/0: instruction string-equal/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1044 is 1035 -mem/0: storing 4 in location 1045 -run/0: instruction string-equal/6 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing lengths", value: 0, type: 0, properties: ["comparing lengths": "literal-string"]} -string-equal/0: comparing lengths -run/0: instruction string-equal/7 -run/0: {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]} <- equal/13 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1043 is 3 -run/0: ingredient 1 is b-len -mem/0: location 1045 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1046 -run/0: instruction string-equal/8 -run/0: break-if/11 {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1046 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/9 -run/0: reply/33 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction string-equal-distinct-lengths/1 -run/0: memory-should-contain/46 {name: " - 3 <- 0 # abc != abcd - ", value: 0, type: 0, properties: [" - 3 <- 0 # abc != abcd - ": "literal-string"]} -run/0: checking location 3 -run/0: instruction string-equal-distinct-lengths/2 -run/0: trace-should-contain/47 {name: " - string-equal: comparing lengths - ", value: 0, type: 0, properties: [" - string-equal: comparing lengths - ": "literal-string"]} -run/0: instruction string-equal-distinct-lengths/3 -run/0: trace-should-not-contain/48 {name: " - string-equal: comparing characters - ", value: 0, type: 0, properties: [" - string-equal: comparing characters - ": "literal-string"]} diff --git a/cpp/.traces/string-equal-identical b/cpp/.traces/string-equal-identical deleted file mode 100644 index 53d32465..00000000 --- a/cpp/.traces/string-equal-identical +++ /dev/null @@ -1,322 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 1 # abc == abc - ", value: 0, type: 0, properties: [" - 3 <- 1 # abc == abc - ": "literal-string"]} -after-brace/0: recipe string-equal-identical -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-equal-identical -run/0: instruction string-equal-identical/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: instruction: string-equal -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: ingredient: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: location -> 1 -new/0: abc -> 0 -name/0: assign x 1 -new/0: abc -> 0 -name/0: assign y 2 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-equal ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1031 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1035 in location 1003 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- string-equal/100 {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]}, {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} -mem/0: location 1002 is 1031 -mem/0: location 1003 is 1035 -run/0: instruction string-equal/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1039 -run/0: instruction string-equal/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1041 -run/0: instruction string-equal/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -mem/0: storing 3 in location 1042 -run/0: instruction string-equal/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1035 -mem/0: storing 1035 in location 1043 -run/0: instruction string-equal/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -mem/0: storing 3 in location 1044 -run/0: instruction string-equal/6 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing lengths", value: 0, type: 0, properties: ["comparing lengths": "literal-string"]} -string-equal/0: comparing lengths -run/0: instruction string-equal/7 -run/0: {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]} <- equal/13 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1042 is 3 -run/0: ingredient 1 is b-len -mem/0: location 1044 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1045 -run/0: instruction string-equal/8 -run/0: break-if/11 {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1045 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 10 -run/0: instruction string-equal/11 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing characters", value: 0, type: 0, properties: ["comparing characters": "literal-string"]} -string-equal/0: comparing characters -run/0: instruction string-equal/12 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1046 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 0 -run/0: address to copy is 1032 -run/0: its type is 4 -mem/0: location 1032 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 0 -run/0: address to copy is 1036 -run/0: its type is 4 -mem/0: location 1036 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 97 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 97 -run/0: product 0 is 1 -mem/0: storing 1 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1046 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 1 -run/0: address to copy is 1033 -run/0: its type is 4 -mem/0: location 1033 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 1 -run/0: address to copy is 1037 -run/0: its type is 4 -mem/0: location 1037 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 98 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 98 -run/0: product 0 is 1 -mem/0: storing 1 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1046 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 2 -run/0: address to copy is 1034 -run/0: its type is 4 -mem/0: location 1034 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1048 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1043 is 1035 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1046 is 2 -run/0: address to copy is 1038 -run/0: its type is 4 -mem/0: location 1038 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1049 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1048 is 99 -run/0: ingredient 1 is b2 -mem/0: location 1049 is 99 -run/0: product 0 is 1 -mem/0: storing 1 in location 1050 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1050 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1046 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1046 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1042 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1047 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1047 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 25 -run/0: instruction string-equal/26 -run/0: reply/33 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: result 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction string-equal-identical/1 -run/0: memory-should-contain/46 {name: " - 3 <- 1 # abc == abc - ", value: 0, type: 0, properties: [" - 3 <- 1 # abc == abc - ": "literal-string"]} -run/0: checking location 3 diff --git a/cpp/.traces/string-equal-reflexive b/cpp/.traces/string-equal-reflexive deleted file mode 100644 index f7127192..00000000 --- a/cpp/.traces/string-equal-reflexive +++ /dev/null @@ -1,309 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 1 # x == x for all x - ", value: 0, type: 0, properties: [" - 3 <- 1 # x == x for all x - ": "literal-string"]} -after-brace/0: recipe string-equal-reflexive -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-equal-reflexive -run/0: instruction string-equal-reflexive/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: instruction: string-equal -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: location -> 1 -new/0: abc -> 0 -name/0: assign x 1 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-equal ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} <- new/44 {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -mem/0: storing 1031 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- string-equal/100 {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]}, {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} -mem/0: location 1002 is 1031 -mem/0: location 1002 is 1031 -run/0: instruction string-equal/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1035 -run/0: instruction string-equal/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1037 -run/0: instruction string-equal/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1037 is 1031 -mem/0: storing 3 in location 1038 -run/0: instruction string-equal/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1039 -run/0: instruction string-equal/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1039 is 1031 -mem/0: storing 3 in location 1040 -run/0: instruction string-equal/6 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing lengths", value: 0, type: 0, properties: ["comparing lengths": "literal-string"]} -string-equal/0: comparing lengths -run/0: instruction string-equal/7 -run/0: {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]} <- equal/13 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1038 is 3 -run/0: ingredient 1 is b-len -mem/0: location 1040 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1041 -run/0: instruction string-equal/8 -run/0: break-if/11 {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1041 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 10 -run/0: instruction string-equal/11 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing characters", value: 0, type: 0, properties: ["comparing characters": "literal-string"]} -string-equal/0: comparing characters -run/0: instruction string-equal/12 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1042 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 0 -run/0: ingredient 1 is a-len -mem/0: location 1038 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1037 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 0 -run/0: address to copy is 1032 -run/0: its type is 4 -mem/0: location 1032 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1044 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1039 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 0 -run/0: address to copy is 1032 -run/0: its type is 4 -mem/0: location 1032 is 97 -run/0: product 0 is 97 -mem/0: storing 97 in location 1045 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1044 is 97 -run/0: ingredient 1 is b2 -mem/0: location 1045 is 97 -run/0: product 0 is 1 -mem/0: storing 1 in location 1046 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1046 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 0 -run/0: ingredient 1 is 1 -run/0: product 0 is 1 -mem/0: storing 1 in location 1042 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 1 -run/0: ingredient 1 is a-len -mem/0: location 1038 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1037 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 1 -run/0: address to copy is 1033 -run/0: its type is 4 -mem/0: location 1033 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1044 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1039 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 1 -run/0: address to copy is 1033 -run/0: its type is 4 -mem/0: location 1033 is 98 -run/0: product 0 is 98 -mem/0: storing 98 in location 1045 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1044 is 98 -run/0: ingredient 1 is b2 -mem/0: location 1045 is 98 -run/0: product 0 is 1 -mem/0: storing 1 in location 1046 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1046 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 1 -run/0: ingredient 1 is 1 -run/0: product 0 is 2 -mem/0: storing 2 in location 1042 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 2 -run/0: ingredient 1 is a-len -mem/0: location 1038 is 3 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/16 -run/0: {name: "a2", value: 8, type: 4, properties: ["a2": "character"]} <- index/26 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1037 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 2 -run/0: address to copy is 1034 -run/0: its type is 4 -mem/0: location 1034 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1044 -run/0: instruction string-equal/17 -run/0: {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} <- index/26 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]}, {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -run/0: ingredient 0 is {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1039 is 1031 -run/0: ingredient 1 is {name: "i", value: 6, type: 1, properties: ["i": "integer"]} -mem/0: location 1042 is 2 -run/0: address to copy is 1034 -run/0: its type is 4 -mem/0: location 1034 is 99 -run/0: product 0 is 99 -mem/0: storing 99 in location 1045 -run/0: instruction string-equal/19 -run/0: {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]} <- equal/13 {name: "a2", value: 8, type: 4, properties: ["a2": "character"]}, {name: "b2", value: 9, type: 4, properties: ["b2": "character"]} -run/0: ingredient 0 is a2 -mem/0: location 1044 is 99 -run/0: ingredient 1 is b2 -mem/0: location 1045 is 99 -run/0: product 0 is 1 -mem/0: storing 1 in location 1046 -run/0: instruction string-equal/20 -run/0: break-if/11 {name: "chars-match?", value: 10, type: 3, properties: ["chars-match?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1046 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 22 -run/0: instruction string-equal/23 -run/0: {name: "i", value: 6, type: 1, properties: ["i": "integer"]} <- add/2 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 2 -run/0: ingredient 1 is 1 -run/0: product 0 is 3 -mem/0: storing 3 in location 1042 -run/0: instruction string-equal/24 -run/0: loop/10 {name: "", value: -11, type: , properties: ["": ]} -run/0: ingredient 0 is -11 -run/0: jumping to instruction 14 -run/0: instruction string-equal/14 -run/0: {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]} <- greater-or-equal/16 {name: "i", value: 6, type: 1, properties: ["i": "integer"]}, {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} -run/0: ingredient 0 is i -mem/0: location 1042 is 3 -run/0: ingredient 1 is a-len -mem/0: location 1038 is 3 -run/0: product 0 is 1 -mem/0: storing 1 in location 1043 -run/0: instruction string-equal/15 -run/0: break-if/11 {name: "done?", value: 7, type: 3, properties: ["done?": "boolean"]}, {name: "", value: 9, type: , properties: ["": ]} -mem/0: location 1043 is 1 -run/0: ingredient 0 is 1 -run/0: ingredient 1 is -run/0: jumping to instruction 25 -run/0: instruction string-equal/26 -run/0: reply/33 {name: "1", value: 1, type: 0, properties: ["1": "literal"]} -run/0: result 0 is 1 -mem/0: storing 1 in location 3 -run/0: instruction string-equal-reflexive/1 -run/0: memory-should-contain/46 {name: " - 3 <- 1 # x == x for all x - ", value: 0, type: 0, properties: [" - 3 <- 1 # x == x for all x - ": "literal-string"]} -run/0: checking location 3 diff --git a/cpp/.traces/string-equal-with-empty b/cpp/.traces/string-equal-with-empty deleted file mode 100644 index 71fb6770..00000000 --- a/cpp/.traces/string-equal-with-empty +++ /dev/null @@ -1,120 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: memory-should-contain -parse/0: ingredient: {name: " - 3 <- 0 # "" != abcd - ", value: 0, type: 0, properties: [" - 3 <- 0 # "" != abcd - ": "literal-string"]} -after-brace/0: recipe string-equal-with-empty -after-brace/0: run ... -after-brace/0: memory-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: string-equal-with-empty -run/0: instruction string-equal-with-empty/0 -run/0: run/45 {name: " - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ", value: 0, type: 0, properties: [" - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ": "literal-string"]} -parse/0: instruction: new -parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} -parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: new -parse/0: ingredient: {name: "", value: 0, type: 0, properties: ["": "literal-string"]} -parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: instruction: new -parse/0: ingredient: {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} -parse/0: product: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: instruction: string-equal -parse/0: ingredient: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} -parse/0: ingredient: {name: "y", value: 0, type: 2-5-4, properties: ["y": "address":"array":"character"]} -parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} -new/0: location -> 1 -new/0: -> 0 -name/0: assign x 1 -new/0: abcd -> 0 -name/0: assign y 2 -after-brace/0: recipe run1001 -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: new ... -after-brace/0: string-equal ... -run/0: instruction run1001/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1000 -run/0: instruction run1001/1 -run/0: {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]} <- new/44 {name: "", value: 0, type: 0, properties: ["": "literal-string"]} -mem/0: storing 1031 in location 1002 -run/0: instruction run1001/2 -run/0: {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} <- new/44 {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} -mem/0: storing 1032 in location 1003 -run/0: instruction run1001/3 -run/0: {name: "3", value: 3, type: 3, properties: ["3": "boolean", "raw": ]} <- string-equal/100 {name: "x", value: 1, type: 2-5-4, properties: ["x": "address":"array":"character"]}, {name: "y", value: 2, type: 2-5-4, properties: ["y": "address":"array":"character"]} -mem/0: location 1002 is 1031 -mem/0: location 1003 is 1032 -run/0: instruction string-equal/0 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new/44 {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]} -mem/0: array size is 30 -mem/0: new alloc: 1037 -run/0: instruction string-equal/1 -run/0: {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1031 -mem/0: storing 1031 in location 1039 -run/0: instruction string-equal/2 -run/0: {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]} <- length/28 {name: "a", value: 1, type: 2-5-4, properties: ["a": "address":"array":"character", "deref": ]} -mem/0: location 1039 is 1031 -mem/0: storing 0 in location 1040 -run/0: instruction string-equal/3 -run/0: {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character"]} <- next-ingredient/30 -run/0: product 0 is 1032 -mem/0: storing 1032 in location 1041 -run/0: instruction string-equal/4 -run/0: {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} <- length/28 {name: "b", value: 3, type: 2-5-4, properties: ["b": "address":"array":"character", "deref": ]} -mem/0: location 1041 is 1032 -mem/0: storing 4 in location 1042 -run/0: instruction string-equal/6 -run/0: trace/18 {name: "string-equal", value: 0, type: 0, properties: ["string-equal": "literal-string"]}, {name: "comparing lengths", value: 0, type: 0, properties: ["comparing lengths": "literal-string"]} -string-equal/0: comparing lengths -run/0: instruction string-equal/7 -run/0: {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]} <- equal/13 {name: "a-len", value: 2, type: 1, properties: ["a-len": "integer"]}, {name: "b-len", value: 4, type: 1, properties: ["b-len": "integer"]} -run/0: ingredient 0 is a-len -mem/0: location 1040 is 0 -run/0: ingredient 1 is b-len -mem/0: location 1042 is 4 -run/0: product 0 is 0 -mem/0: storing 0 in location 1043 -run/0: instruction string-equal/8 -run/0: break-if/11 {name: "length-equal?", value: 5, type: 3, properties: ["length-equal?": "boolean"]}, {name: "", value: 1, type: , properties: ["": ]} -mem/0: location 1043 is 0 -run/0: ingredient 0 is 0 -run/0: jump-if fell through -run/0: instruction string-equal/9 -run/0: reply/33 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: result 0 is 0 -mem/0: storing 0 in location 3 -run/0: instruction string-equal-with-empty/1 -run/0: memory-should-contain/46 {name: " - 3 <- 0 # "" != abcd - ", value: 0, type: 0, properties: [" - 3 <- 0 # "" != abcd - ": "literal-string"]} -run/0: checking location 3 diff --git a/cpp/.traces/string_literal b/cpp/.traces/string_literal deleted file mode 100644 index 991095f5..00000000 --- a/cpp/.traces/string_literal +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "abc def", value: 0, type: 0, properties: ["abc def": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} diff --git a/cpp/.traces/string_literal_and_comment b/cpp/.traces/string_literal_and_comment deleted file mode 100644 index 6df4c4d6..00000000 --- a/cpp/.traces/string_literal_and_comment +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} diff --git a/cpp/.traces/string_literal_nested b/cpp/.traces/string_literal_nested deleted file mode 100644 index 96a6e7b5..00000000 --- a/cpp/.traces/string_literal_nested +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "abc [def]", value: 0, type: 0, properties: ["abc [def]": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} diff --git a/cpp/.traces/string_literal_with_colons b/cpp/.traces/string_literal_with_colons deleted file mode 100644 index 98e7d604..00000000 --- a/cpp/.traces/string_literal_with_colons +++ /dev/null @@ -1,3 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "abc:def/ghi", value: 0, type: 0, properties: ["abc:def/ghi": "literal-string"]} -parse/0: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} diff --git a/cpp/.traces/subtract b/cpp/.traces/subtract deleted file mode 100644 index aeec0887..00000000 --- a/cpp/.traces/subtract +++ /dev/null @@ -1,32 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: subtract -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: subtract ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "23", value: 23, type: 0, properties: ["23": "literal"]} -run/0: ingredient 0 is 23 -mem/0: storing 23 in location 1 -run/0: instruction main/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 2 -run/0: instruction main/2 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- subtract/3 {name: "1", value: 1, type: 1, properties: ["1": "integer"]}, {name: "2", value: 2, type: 1, properties: ["2": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 23 -run/0: ingredient 1 is 2 -mem/0: location 2 is 34 -run/0: product 0 is -11 -mem/0: storing -11 in location 3 diff --git a/cpp/.traces/subtract_literal b/cpp/.traces/subtract_literal deleted file mode 100644 index 9d8202ca..00000000 --- a/cpp/.traces/subtract_literal +++ /dev/null @@ -1,14 +0,0 @@ -parse/0: instruction: subtract -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe main -after-brace/0: subtract ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- subtract/3 {name: "5", value: 5, type: 0, properties: ["5": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} -run/0: ingredient 0 is 5 -run/0: ingredient 1 is 2 -run/0: product 0 is 3 -mem/0: storing 3 in location 1 diff --git a/cpp/.traces/surrounding_space b/cpp/.traces/surrounding_space deleted file mode 100644 index aeddde25..00000000 --- a/cpp/.traces/surrounding_space +++ /dev/null @@ -1,51 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "10", value: 0, type: 1, properties: ["10": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal"]} -parse/0: product: {name: "20", value: 0, type: 1, properties: ["20": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "20", value: 0, type: 0, properties: ["20": "literal"]} -parse/0: product: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "dummy"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "32", value: 0, type: 0, properties: ["32": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "33", value: 0, type: 0, properties: ["33": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer", "space": "1"]} -name/0: recipe main is surrounded by dummy -after-brace/0: recipe main -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: {name: "10", value: 10, type: 1, properties: ["10": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 10 -run/0: instruction main/1 -run/0: {name: "20", value: 20, type: 1, properties: ["20": "integer"]} <- copy/1 {name: "5", value: 5, type: 0, properties: ["5": "literal"]} -run/0: ingredient 0 is 5 -mem/0: storing 5 in location 20 -run/0: instruction main/2 -run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- copy/1 {name: "10", value: 10, type: 0, properties: ["10": "literal"]} -run/0: ingredient 0 is 10 -run/0: instruction main/3 -run/0: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "dummy"]} <- copy/1 {name: "20", value: 20, type: 0, properties: ["20": "literal"]} -run/0: ingredient 0 is 20 -mem/0: storing 20 in location 11 -run/0: instruction main/4 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "32", value: 32, type: 0, properties: ["32": "literal"]} -run/0: ingredient 0 is 32 -mem/0: storing 32 in location 12 -run/0: instruction main/5 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer", "space": "1"]} <- copy/1 {name: "33", value: 33, type: 0, properties: ["33": "literal"]} -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 22 diff --git a/cpp/.traces/trace b/cpp/.traces/trace deleted file mode 100644 index f2c6721b..00000000 --- a/cpp/.traces/trace +++ /dev/null @@ -1,10 +0,0 @@ -parse/0: instruction: trace -parse/0: ingredient: {name: "foo", value: 0, type: 0, properties: ["foo": "literal-string"]} -parse/0: ingredient: {name: "this is a trace in mu", value: 0, type: 0, properties: ["this is a trace in mu": "literal-string"]} -after-brace/0: recipe main -after-brace/0: trace ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: trace/18 {name: "foo", value: 0, type: 0, properties: ["foo": "literal-string"]}, {name: "this is a trace in mu", value: 0, type: 0, properties: ["this is a trace in mu": "literal-string"]} -foo/0: this is a trace in mu diff --git a/cpp/.traces/trace_check_passes_silently b/cpp/.traces/trace_check_passes_silently deleted file mode 100644 index c5a73e5d..00000000 --- a/cpp/.traces/trace_check_passes_silently +++ /dev/null @@ -1,37 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -after-brace/0: trace-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]} -parse/0: ingredient: {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: trace/18 {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]}, {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -a/0: b -run/0: instruction main/1 -run/0: trace-should-contain/47 {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} diff --git a/cpp/.traces/trace_check_warns_on_failure b/cpp/.traces/trace_check_warns_on_failure deleted file mode 100644 index 7911d5ae..00000000 --- a/cpp/.traces/trace_check_warns_on_failure +++ /dev/null @@ -1,21 +0,0 @@ -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: trace-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: trace-should-contain/47 {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -warn/0: missing [b] in trace layer a diff --git a/cpp/.traces/trace_check_warns_on_failure_in_later_line b/cpp/.traces/trace_check_warns_on_failure_in_later_line deleted file mode 100644 index adf98716..00000000 --- a/cpp/.traces/trace_check_warns_on_failure_in_later_line +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace-should-contain -parse/0: ingredient: {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -after-brace/0: trace-should-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]} -parse/0: ingredient: {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: trace/18 {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]}, {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -a/0: b -run/0: instruction main/1 -run/0: trace-should-contain/47 {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -warn/0: missing [d] in trace layer a diff --git a/cpp/.traces/trace_negative_check_passes_silently b/cpp/.traces/trace_negative_check_passes_silently deleted file mode 100644 index e433c340..00000000 --- a/cpp/.traces/trace_negative_check_passes_silently +++ /dev/null @@ -1,16 +0,0 @@ -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: trace-should-not-contain/48 {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} diff --git a/cpp/.traces/trace_negative_check_warns_on_any_unexpected_line b/cpp/.traces/trace_negative_check_warns_on_any_unexpected_line deleted file mode 100644 index daa52d8e..00000000 --- a/cpp/.traces/trace_negative_check_warns_on_any_unexpected_line +++ /dev/null @@ -1,42 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - trace [a], [d] - ", value: 0, type: 0, properties: [" - trace [a], [d] - ": "literal-string"]} -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - trace [a], [d] - ", value: 0, type: 0, properties: [" - trace [a], [d] - ": "literal-string"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]} -parse/0: ingredient: {name: "d", value: 0, type: 0, properties: ["d": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: trace/18 {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]}, {name: "d", value: 0, type: 0, properties: ["d": "literal-string"]} -a/0: d -run/0: instruction main/1 -run/0: trace-should-not-contain/48 {name: " - a: b - a: d - ", value: 0, type: 0, properties: [" - a: b - a: d - ": "literal-string"]} -warn/0: unexpected [d] in trace layer a diff --git a/cpp/.traces/trace_negative_check_warns_on_failure b/cpp/.traces/trace_negative_check_warns_on_failure deleted file mode 100644 index a236464f..00000000 --- a/cpp/.traces/trace_negative_check_warns_on_failure +++ /dev/null @@ -1,38 +0,0 @@ -parse/0: instruction: run -parse/0: ingredient: {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace-should-not-contain -parse/0: ingredient: {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} -after-brace/0: recipe main -after-brace/0: run ... -after-brace/0: trace-should-not-contain ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: main -run/0: instruction main/0 -run/0: run/45 {name: " - trace [a], [b] - ", value: 0, type: 0, properties: [" - trace [a], [b] - ": "literal-string"]} -parse/0: instruction: trace -parse/0: ingredient: {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]} -parse/0: ingredient: {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -after-brace/0: recipe run1001 -after-brace/0: trace ... -run/0: instruction run1001/0 -run/0: trace/18 {name: "a", value: 0, type: 0, properties: ["a": "literal-string"]}, {name: "b", value: 0, type: 0, properties: ["b": "literal-string"]} -a/0: b -run/0: instruction main/1 -run/0: trace-should-not-contain/48 {name: " - a: b - ", value: 0, type: 0, properties: [" - a: b - ": "literal-string"]} -warn/0: unexpected [b] in trace layer a diff --git a/cpp/.traces/wait_for_location b/cpp/.traces/wait_for_location deleted file mode 100644 index ca8b9424..00000000 --- a/cpp/.traces/wait_for_location +++ /dev/null @@ -1,45 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: instruction: wait-for-location -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe f1 -after-brace/0: copy ... -after-brace/0: start-running ... -after-brace/0: wait-for-location ... -after-brace/0: copy ... -after-brace/0: recipe f2 -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 -run/0: instruction f1/1 -run/0: start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -run/0: instruction f1/2 -run/0: wait-for-location/36 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: waiting for location 1 to change from 0 -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -schedule/0: waking up routine -schedule/0: f1 -run/0: instruction f1/3 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy/1 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -mem/0: storing 34 in location 2 diff --git a/cpp/.traces/wait_for_routine b/cpp/.traces/wait_for_routine deleted file mode 100644 index b3efbb97..00000000 --- a/cpp/.traces/wait_for_routine +++ /dev/null @@ -1,47 +0,0 @@ -parse/0: instruction: copy -parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: instruction: start-running -parse/0: ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer", "routine": ]} -parse/0: instruction: wait-for-routine -parse/0: ingredient: {name: "2", value: 0, type: 1, properties: ["2": "integer", "routine": ]} -parse/0: instruction: copy -parse/0: ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -parse/0: instruction: copy -parse/0: ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]} -parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -after-brace/0: recipe f1 -after-brace/0: copy ... -after-brace/0: start-running ... -after-brace/0: wait-for-routine ... -after-brace/0: copy ... -after-brace/0: recipe f2 -after-brace/0: copy ... -new/0: routine allocated memory from 1000 to 101000 -schedule/0: f1 -run/0: instruction f1/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "0", value: 0, type: 0, properties: ["0": "literal"]} -run/0: ingredient 0 is 0 -mem/0: storing 0 in location 1 -run/0: instruction f1/1 -run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer", "routine": ]} <- start-running/34 {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]} -run/0: ingredient 0 is f2 -new/0: routine allocated memory from 101000 to 201000 -mem/0: storing 2 in location 2 -run/0: instruction f1/2 -run/0: wait-for-routine/37 {name: "2", value: 2, type: 1, properties: ["2": "integer", "routine": ]} -run/0: waiting for routine 2 -schedule/0: waking up routine -schedule/0: f2 -run/0: instruction f2/0 -run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy/1 {name: "34", value: 34, type: 0, properties: ["34": "literal"]} -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -schedule/0: f1 -run/0: instruction f1/3 -run/0: {name: "3", value: 3, type: 1, properties: ["3": "integer"]} <- copy/1 {name: "1", value: 1, type: 1, properties: ["1": "integer"]} -run/0: ingredient 0 is 1 -mem/0: location 1 is 34 -mem/0: storing 34 in location 3 diff --git a/cpp/000organization.cc b/cpp/000organization.cc deleted file mode 100644 index 964180d4..00000000 --- a/cpp/000organization.cc +++ /dev/null @@ -1,121 +0,0 @@ -//: You guessed right: the '000' prefix means you should start reading here. -//: -//: This project is setup to load all files with a numeric prefix. Just create -//: a new file and start hacking. -//: -//: The first few files (00*) are independent of what this program does, an -//: experimental skeleton that will hopefully make it both easier for others to -//: understand and more malleable, easier to rewrite and remould into radically -//: different shapes without breaking in subtle corner cases. The premise is -//: that understandability and rewrite-friendliness are related in a virtuous -//: cycle. Doing one well makes it easier to do the other. -//: -//: Lower down, this file contains a legal, bare-bones C++ program. It doesn't -//: do anything yet; subsequent files will contain :(...) directives to insert -//: lines into it. For example: -//: :(after "more events") -//: This directive means: insert the following lines after a line in the -//: program containing the words "more events". -//: -//: A simple tool is included to 'tangle' all the files together in sequence -//: according to their directives into a single source file containing all the -//: code for the project, and then feed the source file to the compiler. -//: (It'll drop these comments starting with a '//:' prefix that only make -//: sense before tangling.) -//: -//: Directives free up the programmer to order code for others to read rather -//: than as forced by the computer or compiler. Each individual feature can be -//: organized in a self-contained 'layer' that adds code to many different data -//: structures and functions all over the program. The right decomposition into -//: layers will let each layer make sense in isolation. -//: -//: "If I look at any small part of it, I can see what is going on -- I don't -//: need to refer to other parts to understand what something is doing. -//: -//: If I look at any large part in overview, I can see what is going on -- I -//: don't need to know all the details to get it. -//: -//: Every level of detail is as locally coherent and as well thought-out as -//: any other level." -//: -//: -- Richard Gabriel, "The Quality Without A Name" -//: (http://dreamsongs.com/Files/PatternsOfSoftware.pdf, page 42) -//: -//: Directives are powerful; they permit inserting or modifying any point in -//: the program. Using them tastefully requires mapping out specific lines as -//: waypoints for future layers to hook into. Often such waypoints will be in -//: comments, capitalized to hint that other layers rely on their presence. -//: -//: A single waypoint might have many different code fragments hooking into -//: it from all over the codebase. Use 'before' directives to insert -//: code at a location in order, top to bottom, and 'after' directives to -//: insert code in reverse order. By convention waypoints intended for insertion -//: before begin with 'End'. Notice below how the layers line up above the "End -//: Foo" waypoint. -//: -//: File 001 File 002 File 003 -//: ============ =================== =================== -//: // Foo -//: ------------ -//: <---- :(before "End Foo") -//: .... -//: ... -//: ------------ -//: <---------------------------- :(before "End Foo") -//: .... -//: ... -//: // End Foo -//: ============ -//: -//: Here's part of a layer in color: http://i.imgur.com/0eONnyX.png. Directives -//: are shaded dark. -//: -//: Layers do more than just shuffle code around. Their guarantee is that it -//: should be possible to stop loading after any file/layer, build and run the -//: program, and pass all tests for loaded features. (Relevant is -//: http://youtube.com/watch?v=c8N72t7aScY, a scene from "2001: A Space -//: Odyssey".) Use the included script called 'test_all_layers' to check the -//: guarantee if you make any changes. -//: -//: This 'subsetting guarantee' ensures that this directory contains a -//: cleaned-up narrative of the evolution of this codebase. Organizing -//: autobiographically allows a newcomer to rapidly orient himself, reading the -//: first few files to understand a simple gestalt of a program's core purpose -//: and features, and later gradually working his way through other features as -//: the need arises. -//: -//: Programmers shouldn't need to understand everything about a program to hack -//: on it. But they shouldn't be prevented from a thorough understanding of -//: each aspect either. The goal of layers is to reward curiosity. - -// Includes -// End Includes - -// Types -// End Types - -// prototypes are auto-generated; define your functions in any order -#include "function_list" // by convention, files ending with '_list' are auto-generated - -// Globals -// End Globals - -int main(int argc, char* argv[]) { - - // End One-time Setup - - // End Commandline Parsing - - return 0; // End Main -} - -void setup() { - // End Setup -} - -void teardown() { - // End Teardown -} - -//: Without directives or with the :(code) directive, lines get added at the -//: end. diff --git a/cpp/001help.cc b/cpp/001help.cc deleted file mode 100644 index de81fbcc..00000000 --- a/cpp/001help.cc +++ /dev/null @@ -1,50 +0,0 @@ -//: Everything this project/binary supports. -//: This should give you a sense for what to look forward to in later layers. - -:(before "End Commandline Parsing") -if (argc <= 1 || is_equal(argv[1], "--help")) { - // this is the functionality later layers will provide - // currently no automated tests for commandline arg parsing - cerr << "To load files and run 'main':\n" - << " mu file1.mu file2.mu ...\n" - << "To run all tests:\n" - << " mu test\n" - << "To load files and then run all tests:\n" - << " mu test file1.mu file2.mu ...\n" - ; - return 0; -} - -//:: Helper function used by the above fragment of code (and later layers too, -//:: who knows?). -//: The :(code) directive appends function definitions to the end of the -//: project. Regardless of where functions are defined, we can call them -//: anywhere we like as long as we format the function header in a specific -//: way: put it all on a single line without indent, end the line with ') {' -//: and no trailing whitespace. As long as functions uniformly start this -//: way, our makefile contains a little command to automatically generate -//: declarations for them. -:(code) -bool is_equal(char* s, const char* lit) { - return strncmp(s, lit, strlen(lit)) == 0; -} - -:(before "End Includes") -#include<assert.h> - -#include<iostream> -using std::istream; -using std::ostream; -using std::iostream; -using std::cin; -using std::cout; -using std::cerr; - -#include<cstring> -#include<string> -using std::string; -typedef size_t index_t; -const index_t NOT_FOUND = string::npos; -:(after "int main(int argc, char* argv[])") -assert(sizeof(string::size_type) == sizeof(size_t)); -assert(sizeof(index_t) == sizeof(size_t)); diff --git a/cpp/002test.cc b/cpp/002test.cc deleted file mode 100644 index 776e78e9..00000000 --- a/cpp/002test.cc +++ /dev/null @@ -1,93 +0,0 @@ -//: A simple test harness. To create new tests define functions starting with -//: 'test_'. To run all tests so defined, run: -//: $ wart test -//: -//: So far it seems tasteful for layers to never ever reach back to modify -//: previously-defined tests. Every test is a contract once written, and should -//: pass as-is if it is included, regardless of how much later layers change -//: the program. Avoid writing 'temporary' tests that only work with some -//: subsets of the program. - -:(before "End Types") -typedef void (*test_fn)(void); - -:(before "End Globals") -const test_fn Tests[] = { - #include "test_list" // auto-generated; see makefile -}; - -bool Run_tests = false; -bool Passed = true; // set this to false inside any test to indicate failure -long Num_failures = 0; - -#define CHECK(X) \ - if (!(X)) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \ - Passed = false; \ - return; /* Currently we stop at the very first failure. */ \ - } - -#define CHECK_EQ(X, Y) \ - if ((X) != (Y)) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \ - cerr << " got " << (X) << '\n'; /* BEWARE: multiple eval */ \ - Passed = false; \ - return; /* Currently we stop at the very first failure. */ \ - } - -:(before "End Setup") -Passed = true; - -:(before "End Commandline Parsing") -if (argc > 1 && is_equal(argv[1], "test")) { - Run_tests = true; --argc; ++argv; // shift 'test' out of commandline args -} - -:(before "End Main") -if (Run_tests) { - // Test Runs - // we run some tests and then exit; assume no state need be maintained afterward - - // End Test Run Initialization - time_t t; time(&t); - cerr << "C tests: " << ctime(&t); - for (index_t i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { - run_test(i); - } - // End Tests - cerr << '\n'; - if (Num_failures > 0) - cerr << Num_failures << " failure" - << (Num_failures > 1 ? "s" : "") - << '\n'; - return 0; -} - -:(code) -void run_test(index_t i) { - if (i >= sizeof(Tests)/sizeof(Tests[0])) { - cerr << "no test " << i << '\n'; - return; - } - setup(); - // End Test Setup - (*Tests[i])(); - teardown(); - if (Passed) cerr << "."; -} - -bool is_number(const string& s) { - return s.find_first_not_of("0123456789-.") == string::npos; -} - -long long int to_int(string n) { - char* end = NULL; - long long int result = strtoll(n.c_str(), &end, /*any base*/0); - assert(*end == '\0'); - return result; -} - -:(before "End Includes") -#include<cstdlib> diff --git a/cpp/003trace.cc b/cpp/003trace.cc deleted file mode 100644 index 77d51fc4..00000000 --- a/cpp/003trace.cc +++ /dev/null @@ -1,478 +0,0 @@ -//: The goal of this skeleton is to make programs more easy to understand and -//: more malleable, easy to rewrite in radical ways without accidentally -//: breaking some corner case. Tests further both goals. They help -//: understandability by letting one make small changes and get feedback. What -//: if I wrote this line like so? What if I removed this function call, is it -//: really necessary? Just try it, see if the tests pass. Want to explore -//: rewriting this bit in this way? Tests put many refactorings on a firmer -//: footing. -//: -//: But the usual way we write tests seems incomplete. Refactorings tend to -//: work in the small, but don't help with changes to function boundaries. If -//: you want to extract a new function you have to manually test-drive it to -//: create tests for it. If you want to inline a function its tests are no -//: longer valid. In both cases you end up having to reorganize code as well as -//: tests, an error-prone activity. -//: -//: This file tries to fix this problem by supporting domain-driven testing -//: We try to focus on the domain of inputs the program should work on. All -//: tests invoke the program in a single way: by calling run() with different -//: inputs. The program operates on the input and logs _facts_ it deduces to a -//: trace: -//: trace("label") << "fact 1: " << val; -//: -//: The tests check for facts: -//: :(scenario foo) -//: 34 # call run() with this input -//: +label: fact 1: 34 # trace should have logged this at the end -//: -label: fact 1: 35 # trace should never contain such a line -//: -//: Since we never call anything but the run() function directly, we never have -//: to rewrite the tests when we reorganize the internals of the program. We -//: just have to make sure our rewrite deduces the same facts about the domain, -//: and that's something we're going to have to do anyway. -//: -//: To avoid the combinatorial explosion of integration tests, we organize the -//: program into different layers, and each fact is logged to the trace with a -//: specific label. Individual tests can focus on specific labels. In essence, -//: validating the facts logged with a specific label is identical to calling -//: some internal subsystem. -//: -//: Traces interact salubriously with layers. Thanks to our ordering -//: directives, each layer can contain its own tests. They may rely on other -//: layers, but when a test fails its usually due to breakage in the same -//: layer. When multiple tests fail, it's usually useful to debug the very -//: first test to fail. This is in contrast with the traditional approach, -//: where changes can cause breakages in faraway subsystems, and picking the -//: right test to debug can be an important skill to pick up. -//: -//: A final wrinkle is for recursive functions; it's often useful to segment -//: calls of different depth in the trace: -//: +eval/1: => 34 # the topmost call to eval should have logged this line -//: (look at new_trace_frame below) -//: -//: To build robust tests, trace facts about your domain rather than details of -//: how you computed them. -//: -//: More details: http://akkartik.name/blog/tracing-tests -//: -//: --- -//: -//: Between layers and domain-driven testing, programming starts to look like a -//: fundamentally different activity. Instead of a) superficial, b) local rules -//: on c) code [like http://blog.bbv.ch/2013/06/05/clean-code-cheat-sheet], -//: we allow programmers to engage with the a) deep, b) global structure of the -//: c) domain. If you can systematically track discontinuities in the domain -//: you don't care if the code used gotos as long as it passed the tests. If -//: tests become more robust to run it becomes easier to try out radically -//: different implementations for the same program. If code is super-easy to -//: rewrite, it becomes less important what indentation style it uses, or that -//: the objects are appropriately encapsulated, or that the functions are -//: referentially transparent. -//: -//: Instead of plumbing, programming becomes building and gradually refining a -//: map of the environment the program must operate under. Whether a program is -//: 'correct' at a given point in time is a red herring; what matters is -//: avoiding regression by monotonically nailing down the more 'eventful' parts -//: of the terrain. It helps readers new and old and rewards curiosity to -//: organize large programs in self-similar hiearchies of example scenarios -//: colocated with the code that makes them work. -//: -//: "Programming properly should be regarded as an activity by which -//: programmers form a mental model, rather than as production of a program." -//: -- Peter Naur (http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22) - -:(before "int main") -// End Tracing // hack to ensure most code in this layer comes before anything else - -:(before "End Tracing") -bool Hide_warnings = false; -:(before "End Setup") -//? cerr << "AAA setup\n"; //? 2 -Hide_warnings = false; - -:(before "End Tracing") -struct trace_stream { - vector<pair<string, pair<int, string> > > past_lines; // [(layer label, frame, line)] - map<string, int> frame; - // accumulator for current line - ostringstream* curr_stream; - string curr_layer; - string dump_layer; - trace_stream() :curr_stream(NULL) {} - ~trace_stream() { if (curr_stream) delete curr_stream; } - - ostringstream& stream(string layer) { - newline(); - curr_stream = new ostringstream; - curr_layer = layer; - return *curr_stream; - } - - // be sure to call this before messing with curr_stream or curr_layer or frame - void newline() { - if (!curr_stream) return; - string curr_contents = curr_stream->str(); - curr_contents.erase(curr_contents.find_last_not_of("\r\n")+1); - past_lines.push_back(pair<string, pair<int, string> >(curr_layer, pair<int, string>(frame[curr_layer], curr_contents))); - if (curr_layer == dump_layer || curr_layer == "dump" || dump_layer == "all" || - (!Hide_warnings && curr_layer == "warn")) - cerr << curr_layer << '/' << frame[curr_layer] << ": " << curr_contents << '\n'; - delete curr_stream; - curr_stream = NULL; - } - - // Useful for debugging. - string readable_contents(string layer) { // missing layer = everything, frame, hierarchical layers - newline(); - ostringstream output; - string real_layer, frame; - parse_layer_and_frame(layer, &real_layer, &frame); - for (vector<pair<string, pair<int, string> > >::iterator p = past_lines.begin(); p != past_lines.end(); ++p) - if (layer.empty() || prefix_match(real_layer, p->first)) - output << p->first << "/" << p->second.first << ": " << p->second.second << '\n'; - return output.str(); - } - - // Useful for a newcomer to visualize the program at work. - void dump_browseable_contents(string layer) { - ofstream dump("dump"); - dump << "<div class='frame' frame_index='1'>start</div>\n"; - for (vector<pair<string, pair<int, string> > >::iterator p = past_lines.begin(); p != past_lines.end(); ++p) { - if (p->first != layer) continue; - dump << "<div class='frame"; - if (p->second.first > 1) dump << " hidden"; - dump << "' frame_index='" << p->second.first << "'>"; - dump << p->second.second; - dump << "</div>\n"; - } - dump.close(); - } -}; - - - -trace_stream* Trace_stream = NULL; - -// Top-level helper. IMPORTANT: can't nest. -#define trace(layer) !Trace_stream ? cerr /*print nothing*/ : Trace_stream->stream(layer) -// Warnings should go straight to cerr by default since calls to trace() have -// some unfriendly constraints (they delay printing, they can't nest) -#define raise ((!Trace_stream || !Hide_warnings) ? cerr /*do print*/ : Trace_stream->stream("warn")) - -// A separate helper for debugging. We should only trace domain-specific -// facts. For everything else use log. -#define xlog if (false) log -// To turn on logging replace 'xlog' with 'log'. -#define log cerr - -:(before "End Types") -// raise << die exits after printing -- unless Hide_warnings is set. -struct die {}; -:(before "End Tracing") -ostream& operator<<(ostream& os, unused die) { - if (Hide_warnings) return os; - os << "dying"; - if (Trace_stream) Trace_stream->newline(); - exit(1); -} - -#define CLEAR_TRACE delete Trace_stream, Trace_stream = new trace_stream; - -#define DUMP(layer) if (Trace_stream) cerr << Trace_stream->readable_contents(layer); - -// Trace_stream is a resource, lease_tracer uses RAII to manage it. -string Trace_file; -static string Trace_dir = ".traces/"; -struct lease_tracer { - lease_tracer() { Trace_stream = new trace_stream; } - ~lease_tracer() { -//? cerr << "write to file? " << Trace_file << "$\n"; //? 2 - if (!Trace_file.empty()) { -//? cerr << "writing\n"; //? 2 - ofstream fout((Trace_dir+Trace_file).c_str()); - fout << Trace_stream->readable_contents(""); - fout.close(); - } - delete Trace_stream, Trace_stream = NULL, Trace_file = ""; - } -}; - -// To transparently save traces, start tests with the TEST() macro. -#define TEST(name) void test_##name() { Trace_file = #name; - -#define START_TRACING_UNTIL_END_OF_SCOPE lease_tracer leased_tracer; -:(before "End Test Setup") -START_TRACING_UNTIL_END_OF_SCOPE -//? Trace_stream->dump_layer = "all"; //? 1 - -:(before "End Tracing") -void trace_all(const string& label, const list<string>& in) { - for (list<string>::const_iterator p = in.begin(); p != in.end(); ++p) - trace(label) << *p; -} - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string expected) { // missing layer == anywhere, frame, hierarchical layers - vector<string> expected_lines = split(expected, ""); - index_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - string layer, frame, contents; - parse_layer_frame_contents(expected_lines[curr_expected_line], &layer, &frame, &contents); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !prefix_match(layer, p->first)) - continue; - - if (!frame.empty() && strtol(frame.c_str(), NULL, 0) != p->second.first) - continue; - - if (contents != p->second.second) - continue; - - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - parse_layer_frame_contents(expected_lines[curr_expected_line], &layer, &frame, &contents); - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << contents << "] in trace:\n"; - DUMP(layer); - Passed = false; - return false; -} - -void parse_layer_frame_contents(const string& orig, string* layer, string* frame, string* contents) { - string layer_and_frame; - parse_contents(orig, ": ", &layer_and_frame, contents); - parse_layer_and_frame(layer_and_frame, layer, frame); -} - -void parse_contents(const string& s, const string& delim, string* prefix, string* contents) { - index_t pos = s.find(delim); - if (pos == NOT_FOUND) { - *prefix = ""; - *contents = s; - } - else { - *prefix = s.substr(0, pos); - *contents = s.substr(pos+delim.size()); - } -} - -void parse_layer_and_frame(const string& orig, string* layer, string* frame) { - index_t last_slash = orig.rfind('/'); - if (last_slash == NOT_FOUND - || orig.find_last_not_of("0123456789") != last_slash) { - *layer = orig; - *frame = ""; - } - else { - *layer = orig.substr(0, last_slash); - *frame = orig.substr(last_slash+1); - } -} - - - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string layer, string expected) { // empty layer == everything, multiple layers, hierarchical layers - vector<string> expected_lines = split(expected, ""); - index_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !any_prefix_match(layers, p->first)) - continue; - if (p->second.second != expected_lines[curr_expected_line]) - continue; - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << expected_lines[curr_expected_line] << "] in trace:\n"; - DUMP(layer); - Passed = false; - return false; -} - -#define CHECK_TRACE_CONTENTS(...) check_trace_contents(__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) - -int trace_count(string layer) { - return trace_count(layer, ""); -} - -int trace_count(string layer, string line) { - Trace_stream->newline(); - long result = 0; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (any_prefix_match(layers, p->first)) - if (line == "" || p->second.second == line) - ++result; - } - return result; -} - -int trace_count(string layer, int frame, string line) { - Trace_stream->newline(); - long result = 0; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (any_prefix_match(layers, p->first) && p->second.first == frame) - if (line == "" || p->second.second == line) - ++result; - } - return result; -} - -#define CHECK_TRACE_WARNS() CHECK(trace_count("warn") > 0) -#define CHECK_TRACE_DOESNT_WARN() \ - if (trace_count("warn") > 0) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): unexpected warnings\n"; \ - DUMP("warn"); \ - Passed = false; \ - return; \ - } - -bool trace_doesnt_contain(string layer, string line) { - return trace_count(layer, line) == 0; -} - -bool trace_doesnt_contain(string expected) { - vector<string> tmp = split(expected, ": "); - return trace_doesnt_contain(tmp[0], tmp[1]); -} - -bool trace_doesnt_contain(string layer, int frame, string line) { - return trace_count(layer, frame, line) == 0; -} - -#define CHECK_TRACE_DOESNT_CONTAIN(...) CHECK(trace_doesnt_contain(__VA_ARGS__)) - - - -// manage layer counts in Trace_stream using RAII -struct lease_trace_frame { - string layer; - lease_trace_frame(string l) :layer(l) { - if (!Trace_stream) return; - Trace_stream->newline(); - ++Trace_stream->frame[layer]; - } - ~lease_trace_frame() { - if (!Trace_stream) return; - Trace_stream->newline(); - --Trace_stream->frame[layer]; - } -}; -#define new_trace_frame(layer) lease_trace_frame leased_frame(layer); - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string layer, int frame, string expected) { // multiple layers, hierarchical layers - vector<string> expected_lines = split(expected, ""); // hack: doesn't handle newlines in embedded in lines - index_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !any_prefix_match(layers, p->first)) - continue; - if (p->second.first != frame) - continue; - if (p->second.second != expected_lines[curr_expected_line]) - continue; - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << expected_lines[curr_expected_line] << "] in trace/" << frame << ":\n"; - DUMP(layer); - Passed = false; - return false; -} - -#define CHECK_TRACE_TOP(layer, expected) CHECK_TRACE_CONTENTS(layer, 1, expected) - - - -vector<string> split(string s, string delim) { - vector<string> result; - index_t begin=0, end=s.find(delim); - while (true) { - if (end == NOT_FOUND) { - result.push_back(string(s, begin, NOT_FOUND)); - break; - } - result.push_back(string(s, begin, end-begin)); - begin = end+delim.size(); - end = s.find(delim, begin); - } - return result; -} - -bool any_prefix_match(const vector<string>& pats, const string& needle) { - if (pats.empty()) return false; - if (*pats[0].rbegin() != '/') - // prefix match not requested - return find(pats.begin(), pats.end(), needle) != pats.end(); - // first pat ends in a '/'; assume all pats do. - for (vector<string>::const_iterator p = pats.begin(); p != pats.end(); ++p) - if (headmatch(needle, *p)) return true; - return false; -} - -bool prefix_match(const string& pat, const string& needle) { - if (*pat.rbegin() != '/') - // prefix match not requested - return pat == needle; - return headmatch(needle, pat); -} - -bool headmatch(const string& s, const string& pat) { - if (pat.size() > s.size()) return false; - return std::mismatch(pat.begin(), pat.end(), s.begin()).first == pat.end(); -} - -:(before "End Includes") -#include<vector> -using std::vector; -#include<list> -using std::list; -#include<utility> -using std::pair; -#include<map> -using std::map; -#include<set> -using std::set; -#include<algorithm> - -#include<iostream> -using std::istream; -using std::ostream; -using std::cin; -using std::cout; -using std::cerr; - -#include<sstream> -using std::istringstream; -using std::ostringstream; - -#include<fstream> -using std::ifstream; -using std::ofstream; - -#define unused __attribute__((unused)) diff --git a/cpp/003trace.test.cc b/cpp/003trace.test.cc deleted file mode 100644 index 0acf8807..00000000 --- a/cpp/003trace.test.cc +++ /dev/null @@ -1,169 +0,0 @@ -void test_trace_check_compares() { - CHECK_TRACE_CONTENTS("test layer", ""); - trace("test layer") << "foo"; - CHECK_TRACE_CONTENTS("test layer", "foo"); -} - -void test_trace_check_filters_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - CHECK_TRACE_CONTENTS("test layer 1", "foo"); -} - -void test_trace_check_ignores_other_lines() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "bar"; - CHECK_TRACE_CONTENTS("test layer 1", "foo"); -} - -void test_trace_ignores_trailing_whitespace() { - trace("test layer 1") << "foo\n"; - CHECK_TRACE_CONTENTS("test layer 1", "foo"); -} - -void test_trace_check_always_finds_empty_lines() { - CHECK_TRACE_CONTENTS("test layer 1", ""); -} - -void test_trace_check_treats_empty_layers_as_wildcards() { - trace("test layer 1") << "foo"; - CHECK_TRACE_CONTENTS("", "foo"); -} - -void test_trace_check_multiple_lines_at_once() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - CHECK_TRACE_CONTENTS("", "foobar"); -} - -void test_trace_check_always_finds_empty_lines2() { - CHECK_TRACE_CONTENTS("test layer 1", ""); -} - -void test_trace_orders_across_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("", "foobarqux"); -} - -void test_trace_orders_across_layers2() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("foobarqux"); -} - -void test_trace_checks_ordering_spanning_multiple_layers() { - trace("layer1") << "foo"; - trace("layer2") << "bar"; - trace("layer1") << "qux"; - CHECK_TRACE_CONTENTS("layer1: foolayer2: barlayer1: qux"); -} - -void test_trace_segments_within_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - new_trace_frame("test layer 1"); - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1", "fooqux"); - CHECK_TRACE_CONTENTS("test layer 1", 0, "foo"); - CHECK_TRACE_DOESNT_CONTAIN("test layer 1", 1, "foo"); -} - -void test_trace_checks_ordering_across_layers_and_frames() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - new_trace_frame("test layer 1"); - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1/0: footest layer 2: bartest layer 1: qux"); - CHECK_TRACE_CONTENTS("test layer 1: footest layer 2: bartest layer 1/1: qux"); -} - -void trace_test_fn(int n) { - if (n == 0) return; - new_trace_frame("foo"); - trace("foo") << "before: " << n; - trace_test_fn(n-1); - trace("foo") << "after: " << n; -} - -void test_trace_keeps_level_together() { - CHECK_TRACE_CONTENTS("foo", ""); - trace_test_fn(4); - CHECK_TRACE_CONTENTS("foo", 2, "before: 3after: 3"); -} - -void test_trace_supports_multiple_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1,test layer 2", "foobarqux"); -} - -void test_trace_supports_hierarchical_layers() { - trace("test layer/a") << "foo"; - trace("different layer/c") << "foo 2"; - trace("test layer/b") << "bar"; - CHECK_TRACE_CONTENTS("test layer/", "foobar"); -} - -void test_trace_supports_count() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "foo"; - CHECK_EQ(trace_count("test layer 1", "foo"), 2); -} - -void test_trace_supports_count2() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "bar"; - CHECK_EQ(trace_count("test layer 1"), 2); -} - -// pending: DUMP tests -// pending: readable_contents() adds newline if necessary. -// pending: raise also prints to stderr. -// pending: raise doesn't print to stderr if Hide_warnings is set. -// pending: raise doesn't have to be saved if Hide_warnings is set, just printed. -// pending: raise prints to stderr if Trace_stream is NULL. -// pending: raise prints to stderr if Trace_stream is NULL even if Hide_warnings is set. -// pending: raise << ... die() doesn't die if Hide_warnings is set. - - - -// can't check trace because trace methods call 'split' - -void test_split_returns_at_least_one_elem() { - vector<string> result = split("", ","); - CHECK_EQ(result.size(), 1); - CHECK_EQ(result[0], ""); -} - -void test_split_returns_entire_input_when_no_delim() { - vector<string> result = split("abc", ","); - CHECK_EQ(result.size(), 1); - CHECK_EQ(result[0], "abc"); -} - -void test_split_works() { - vector<string> result = split("abc,def", ","); - CHECK_EQ(result.size(), 2); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); -} - -void test_split_works2() { - vector<string> result = split("abc,def,ghi", ","); - CHECK_EQ(result.size(), 3); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); - CHECK_EQ(result[2], "ghi"); -} - -void test_split_handles_multichar_delim() { - vector<string> result = split("abc,,def,,ghi", ",,"); - CHECK_EQ(result.size(), 3); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); - CHECK_EQ(result[2], "ghi"); -} diff --git a/cpp/010vm.cc b/cpp/010vm.cc deleted file mode 100644 index 38fc582c..00000000 --- a/cpp/010vm.cc +++ /dev/null @@ -1,259 +0,0 @@ -:(after "Types") -// A program is a book of 'recipes' (functions) -typedef size_t recipe_number; -:(before "End Globals") -map<string, recipe_number> Recipe_number; -map<recipe_number, recipe> Recipe; -recipe_number Next_recipe_number = 1; - -:(before "End Types") -// Recipes are lists of instructions. To run a recipe, the computer runs its -// instructions. -struct recipe { - string name; - vector<instruction> steps; - // End recipe Fields -}; - -:(before "struct recipe") -// Each instruction is either of the form: -// product1, product2, product3, ... <- operation ingredient1, ingredient2, ingredient3, ... -// or just a single 'label' starting with a non-alphanumeric character -// +label -// Labels don't do anything, they're just waypoints. -struct instruction { - bool is_label; - string label; // only if is_label - string name; // only if !is_label - recipe_number operation; // Recipe_number[name] - vector<reagent> ingredients; // only if !is_label - vector<reagent> products; // only if !is_label - instruction(); - void clear(); - string to_string() const; -}; - -:(before "struct instruction") -// Ingredients and products are a single species -- a reagent. Reagents refer -// either to numbers or to locations in memory along with 'type' tags telling -// us how to interpret them. They also can contain arbitrary other lists of -// properties besides types, but we're getting ahead of ourselves. -struct reagent { - vector<pair<string, vector<string> > > properties; - string name; - long long int value; - bool initialized; - vector<type_number> types; - reagent(string s); - reagent(); - void set_value(long long int v) { value = v; initialized = true; } - string to_string() const; -}; - -:(before "struct reagent") -struct property { - vector<string> values; -}; - -:(before "End Globals") -// Locations refer to a common 'memory'. Each location can store a number. -map<index_t, long long int> Memory; -:(before "End Setup") -Memory.clear(); - -:(after "Types") -// Mu types encode how the numbers stored in different parts of memory are -// interpreted. A location tagged as a 'character' type will interpret the -// number 97 as the letter 'a', while a different location of type 'integer' -// would not. -// -// Unlike most computers today, mu stores types in a single big table, shared -// by all the mu programs on the computer. This is useful in providing a -// seamless experience to help understand arbitrary mu programs. -typedef size_t type_number; -:(before "End Globals") -map<string, type_number> Type_number; -map<type_number, type_info> Type; -type_number Next_type_number = 1; -:(code) -void setup_types() { - Type.clear(); Type_number.clear(); - Type_number["literal"] = 0; - Next_type_number = 1; - // Mu Types Initialization - type_number integer = Type_number["integer"] = Next_type_number++; - Type_number["location"] = Type_number["integer"]; // wildcard type: either a pointer or a scalar - Type[integer].name = "integer"; - type_number address = Type_number["address"] = Next_type_number++; - Type[address].name = "address"; - type_number boolean = Type_number["boolean"] = Next_type_number++; - Type[boolean].name = "boolean"; - type_number character = Type_number["character"] = Next_type_number++; - Type[character].name = "character"; - // Array types are a special modifier to any other type. For example, - // array:integer or array:address:boolean. - type_number array = Type_number["array"] = Next_type_number++; - Type[array].name = "array"; - // End Mu Types Initialization -} -:(before "End One-time Setup") -setup_types(); - -:(before "End Types") -// You can construct arbitrary new types. New types are either 'containers' -// with multiple 'elements' of other types, or 'exclusive containers' containing -// one of multiple 'variants'. (These are similar to C structs and unions, -// respectively, though exclusive containers implicitly include a tag element -// recording which variant they should be interpreted as.) -// -// For example, storing bank balance and name for an account might require a -// container, but if bank accounts may be either for individuals or groups, -// with different properties for each, that may require an exclusive container -// whose variants are individual-account and joint-account containers. -enum kind_of_type { - primitive, - container, - exclusive_container -}; - -struct type_info { - string name; - kind_of_type kind; - size_t size; // only if type is not primitive; primitives and addresses have size 1 (except arrays are dynamic) - vector<vector<type_number> > elements; - vector<string> element_names; - // End type_info Fields - type_info() :kind(primitive), size(0) {} -}; - -enum primitive_recipes { - IDLE = 0, - COPY, - // End Primitive Recipe Declarations - MAX_PRIMITIVE_RECIPES, -}; -:(code) -//: It's all very well to construct recipes out of other recipes, but we need -//: to know how to do *something* out of the box. For the following -//: recipes there are only codes, no entries in the book, because mu just knows -//: what to do for them. -void setup_recipes() { - Recipe.clear(); Recipe_number.clear(); - Recipe_number["idle"] = IDLE; - // Primitive Recipe Numbers - Recipe_number["copy"] = COPY; - // End Primitive Recipe Numbers -} -//: We could just reset the recipe table after every test, but that gets slow -//: all too quickly. Instead, initialize the common stuff just once at -//: startup. Later layers will carefully undo each test's additions after -//: itself. -:(before "End One-time Setup") -setup_recipes(); -assert(MAX_PRIMITIVE_RECIPES < 100); // level 0 is primitives; until 99 -Next_recipe_number = 100; -// End Load Recipes -:(before "End Test Run Initialization") -assert(Next_recipe_number < 1000); // functions being tested didn't overflow into test space -:(before "End Setup") -Next_recipe_number = 1000; // consistent new numbers for each test - - - -//:: Helpers - -:(code) -instruction::instruction() :is_label(false), operation(IDLE) {} -void instruction::clear() { is_label=false; label.clear(); operation=IDLE; ingredients.clear(); products.clear(); } - -// Reagents have the form <name>:<type>:<type>:.../<property>/<property>/... -reagent::reagent(string s) :value(0), initialized(false) { - istringstream in(s); - in >> std::noskipws; - // properties - while (!in.eof()) { - istringstream row(slurp_until(in, '/')); - row >> std::noskipws; - string name = slurp_until(row, ':'); - vector<string> values; - while (!row.eof()) - values.push_back(slurp_until(row, ':')); - properties.push_back(pair<string, vector<string> >(name, values)); - } - // structures for the first row of properties - name = properties[0].first; - for (index_t i = 0; i < properties[0].second.size(); ++i) { - types.push_back(Type_number[properties[0].second[i]]); - } - if (name == "_" && types.empty()) { - types.push_back(0); - properties[0].second.push_back("dummy"); - } -} -reagent::reagent() :value(0), initialized(false) { - // The first property is special, so ensure we always have it. - // Other properties can be pushed back, but the first must always be - // assigned to. - properties.push_back(pair<string, vector<string> >("", vector<string>())); -} -string reagent::to_string() const { - ostringstream out; - out << "{name: \"" << name << "\", value: " << value << ", type: "; - for (index_t i = 0; i < types.size(); ++i) { - out << types[i]; - if (i < types.size()-1) out << "-"; - } - if (!properties.empty()) { - out << ", properties: ["; - for (index_t i = 0; i < properties.size(); ++i) { - out << "\"" << properties[i].first << "\": "; - for (index_t j = 0; j < properties[i].second.size(); ++j) { - out << "\"" << properties[i].second[j] << "\""; - if (j < properties[i].second.size()-1) out << ":"; - } - if (i < properties.size()-1) out << ", "; - else out << "]"; - } - } - out << "}"; - return out.str(); -} - -string instruction::to_string() const { - if (is_label) return label; - ostringstream out; - for (index_t i = 0; i < products.size(); ++i) { - if (i > 0) out << ", "; - out << products[i].to_string(); - } - if (!products.empty()) out << " <- "; - out << name << '/' << operation << ' '; - for (index_t i = 0; i < ingredients.size(); ++i) { - if (i > 0) out << ", "; - out << ingredients[i].to_string(); - } - return out.str(); -} - -string slurp_until(istream& in, char delim) { - ostringstream out; - char c; - while (in >> c) { - if (c == delim) { - // drop the delim - break; - } - out << c; - } - return out.str(); -} - -void dump_memory() { - map<int, int> ordered(Memory.begin(), Memory.end()); - for (map<int, int>::iterator p = ordered.begin(); p != ordered.end(); ++p) { - cout << p->first << ": " << p->second << '\n'; - } -} -:(before "End Includes") -#include <map> -using std::map; diff --git a/cpp/011load.cc b/cpp/011load.cc deleted file mode 100644 index 3f0f8e1e..00000000 --- a/cpp/011load.cc +++ /dev/null @@ -1,328 +0,0 @@ -//: Phase 1 of running mu code: load it from a textual representation. - -:(scenarios load) -:(scenario first_recipe) -recipe main [ - 1:integer <- copy 23:literal -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(code) -vector<recipe_number> load(string form) { - istringstream in(form); - in >> std::noskipws; - return load(in); -} - -vector<recipe_number> load(istream& in) { - vector<recipe_number> result; - while (!in.eof()) { - skip_whitespace_and_comments(in); - if (in.eof()) break; - string command = next_word(in); - // Command Handlers - if (command == "recipe") { - result.push_back(add_recipe(in)); - } - // End Command Handlers - else { - raise << "unknown top-level command: " << command << '\n'; - } - } - return result; -} - -recipe_number add_recipe(istream& in) { - skip_whitespace_and_comments(in); - string recipe_name = next_word(in); -//? cout << "recipe name: ^" << recipe_name << "$\n"; //? 3 - if (recipe_name.empty()) - raise << "empty recipe name\n"; -//? raise << "empty recipe name in " << in.str() << '\n'; - if (Recipe_number.find(recipe_name) == Recipe_number.end()) { - Recipe_number[recipe_name] = Next_recipe_number++; -//? cout << "AAA: " << recipe_name << " is now " << Recipe_number[recipe_name] << '\n'; //? 1 - } - recipe_number r = Recipe_number[recipe_name]; - if (Recipe.find(r) != Recipe.end()) { - raise << "redefining recipe " << Recipe[r].name << "\n"; - Recipe.erase(r); - } -//? cout << recipe_name << ": adding recipe " << r << '\n'; //? 3 - - skip_whitespace(in); - if (in.get() != '[') - raise << "recipe body must begin with '['\n"; - -//? show_rest_of_stream(in); //? 1 - skip_whitespace_and_comments(in); -//? show_rest_of_stream(in); //? 1 - - instruction curr; - while (next_instruction(in, &curr)) { - // End Rewrite Instruction(curr) -//? if (!curr.products.empty()) cout << curr.products[0].to_string() << '\n'; //? 1 - Recipe[r].steps.push_back(curr); - } - Recipe[r].name = recipe_name; -//? cout << "recipe " << recipe_name << " has " << Recipe[r].steps.size() << " steps.\n"; //? 1 - // track added recipes because we may need to undo them in tests; see below - recently_added_recipes.push_back(r); - return r; -} - -bool next_instruction(istream& in, instruction* curr) { - curr->clear(); - if (in.eof()) return false; -//? show_rest_of_stream(in); //? 1 - skip_whitespace(in); if (in.eof()) return false; -//? show_rest_of_stream(in); //? 1 - skip_whitespace_and_comments(in); if (in.eof()) return false; - - vector<string> words; -//? show_rest_of_stream(in); //? 1 - while (in.peek() != '\n') { - skip_whitespace(in); if (in.eof()) return false; -//? show_rest_of_stream(in); //? 1 - string word = next_word(in); if (in.eof()) return false; - words.push_back(word); - skip_whitespace(in); if (in.eof()) return false; - } - skip_whitespace_and_comments(in); if (in.eof()) return false; - -//? if (words.size() == 1) cout << words[0] << ' ' << words[0].size() << '\n'; //? 1 - if (words.size() == 1 && words[0] == "]") { -//? cout << "AAA\n"; //? 1 - return false; // end of recipe - } - - if (words.size() == 1 && !isalnum(words[0][0]) && words[0][0] != '$') { - curr->is_label = true; - curr->label = words[0]; - trace("parse") << "label: " << curr->label; - return !in.eof(); - } - - vector<string>::iterator p = words.begin(); - if (find(words.begin(), words.end(), "<-") != words.end()) { - for (; *p != "<-"; ++p) { - if (*p == ",") continue; - curr->products.push_back(reagent(*p)); - } - ++p; // skip <- - } - - curr->name = *p; - if (Recipe_number.find(*p) == Recipe_number.end()) { - Recipe_number[*p] = Next_recipe_number++; -//? cout << "AAA: " << *p << " is now " << Recipe_number[*p] << '\n'; //? 1 - } - if (Recipe_number[*p] == 0) { - raise << "Recipe " << *p << " has number 0, which is reserved for IDLE.\n" << die(); - } - curr->operation = Recipe_number[*p]; ++p; - - for (; p != words.end(); ++p) { - if (*p == ",") continue; - curr->ingredients.push_back(reagent(*p)); - } - - trace("parse") << "instruction: " << curr->name; - for (vector<reagent>::iterator p = curr->ingredients.begin(); p != curr->ingredients.end(); ++p) { - trace("parse") << " ingredient: " << p->to_string(); - } - for (vector<reagent>::iterator p = curr->products.begin(); p != curr->products.end(); ++p) { - trace("parse") << " product: " << p->to_string(); - } - return !in.eof(); -} - -string next_word(istream& in) { -//? cout << "AAA next_word\n"; //? 1 - ostringstream out; - skip_whitespace(in); - slurp_word(in, out); - skip_whitespace(in); - skip_comment(in); - return out.str(); -} - -void slurp_word(istream& in, ostream& out) { -//? cout << "AAA slurp_word\n"; //? 1 - char c; - if (in.peek() == ',') { - in >> c; - out << c; - return; - } - while (in >> c) { -//? cout << c << '\n'; //? 1 - if (isspace(c) || c == ',') { - in.putback(c); - break; - } - out << c; - } -} - -void skip_whitespace(istream& in) { - while (isspace(in.peek()) && in.peek() != '\n') { - in.get(); - } -} - -void skip_whitespace_and_comments(istream& in) { - while (true) { - if (isspace(in.peek())) in.get(); - else if (in.peek() == '#') skip_comment(in); - else break; - } -} - -void skip_comment(istream& in) { - if (in.peek() == '#') { - in.get(); - while (in.peek() != '\n') in.get(); - } -} - -void skip_comma(istream& in) { - skip_whitespace(in); - if (in.peek() == ',') in.get(); - skip_whitespace(in); -} - -// for debugging -:(before "End Globals") -bool Show_rest_of_stream = false; -:(code) -void show_rest_of_stream(istream& in) { - if (!Show_rest_of_stream) return; - cerr << '^'; - char c; - while (in >> c) { - cerr << c; - } - cerr << "$\n"; - exit(0); -} - -//: Have tests clean up any recipes they added. -:(before "End Globals") -vector<recipe_number> recently_added_recipes; -:(before "End Setup") -for (index_t i = 0; i < recently_added_recipes.size(); ++i) { -//? cout << "AAA clearing " << Recipe[recently_added_recipes[i]].name << '\n'; //? 2 - Recipe_number.erase(Recipe[recently_added_recipes[i]].name); - Recipe.erase(recently_added_recipes[i]); -} -// Clear Other State For recently_added_recipes -recently_added_recipes.clear(); - -:(scenario parse_comment_outside_recipe) -# this comment will be dropped by the tangler, so we need a dummy recipe to stop that -recipe f1 [ ] -# this comment will go through to 'load' -recipe main [ - 1:integer <- copy 23:literal -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(scenario parse_comment_amongst_instruction) -recipe main [ - # comment - 1:integer <- copy 23:literal -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(scenario parse_comment_amongst_instruction2) -recipe main [ - # comment - 1:integer <- copy 23:literal - # comment -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(scenario parse_comment_amongst_instruction3) -recipe main [ - 1:integer <- copy 23:literal - # comment - 2:integer <- copy 23:literal -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} - -:(scenario parse_comment_after_instruction) -recipe main [ - 1:integer <- copy 23:literal # comment -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(scenario parse_label) -recipe main [ - +foo -] -+parse: label: +foo - -:(scenario parse_dollar_as_recipe_name) -recipe main [ - $foo -] -+parse: instruction: $foo - -:(scenario parse_multiple_properties) -recipe main [ - 1:integer <- copy 23:literal/foo:bar:baz -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal", "foo": "bar":"baz"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} - -:(scenario parse_multiple_products) -recipe main [ - 1:integer, 2:integer <- copy 23:literal -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -+parse: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} - -:(scenario parse_multiple_ingredients) -recipe main [ - 1:integer, 2:integer <- copy 23:literal, 4:integer -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: ingredient: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -+parse: product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]} - -:(scenario parse_multiple_types) -recipe main [ - 1:integer, 2:address:integer <- copy 23:literal, 4:integer -] -+parse: instruction: copy -+parse: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} -+parse: ingredient: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} -+parse: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} -+parse: product: {name: "2", value: 0, type: 2-1, properties: ["2": "address":"integer"]} - -:(scenario parse_properties) -recipe main [ - 1:integer:address/deref <- copy 23:literal -] -+parse: product: {name: "1", value: 0, type: 1-2, properties: ["1": "integer":"address", "deref": ]} diff --git a/cpp/012transform.cc b/cpp/012transform.cc deleted file mode 100644 index 2c1e4610..00000000 --- a/cpp/012transform.cc +++ /dev/null @@ -1,55 +0,0 @@ -//: Phase 2: Filter loaded recipes through an extensible list of 'transforms'. -//: -//: The hope is that this framework of transform tools will provide a -//: deconstructed alternative to conventional compilers. - -:(before "End recipe Fields") -index_t transformed_until; - recipe() :transformed_until(-1) {} - -:(before "End Types") -typedef void (*transform_fn)(recipe_number); - -:(before "End Globals") -vector<transform_fn> Transform; - -:(code) -void transform_all() { -//? cout << "AAA transform_all\n"; //? 1 - for (index_t t = 0; t < Transform.size(); ++t) { - for (map<recipe_number, recipe>::iterator p = Recipe.begin(); p != Recipe.end(); ++p) { - recipe& r = p->second; - if (r.steps.empty()) continue; - if (r.transformed_until != t-1) continue; - (*Transform[t])(/*recipe_number*/p->first); - r.transformed_until = t; - } - } - parse_int_reagents(); // do this after all other transforms have run -} - -void parse_int_reagents() { -//? cout << "parse_int_reagents\n"; //? 1 - for (map<recipe_number, recipe>::iterator p = Recipe.begin(); p != Recipe.end(); ++p) { - recipe& r = p->second; - if (r.steps.empty()) continue; - for (index_t index = 0; index < r.steps.size(); ++index) { - instruction& inst = r.steps[index]; - for (index_t i = 0; i < inst.ingredients.size(); ++i) { - populate_value(inst.ingredients[i]); - } - for (index_t i = 0; i < inst.products.size(); ++i) { - populate_value(inst.products[i]); - } - } - } -} - -void populate_value(reagent& r) { - if (r.initialized) return; - char* end = NULL; - int result = strtol(r.name.c_str(), &end, /*any base*/0); - if (*end != '\0') return; -//? cout << "setting value\n"; //? 1 - r.set_value(result); -} diff --git a/cpp/013literal_string.cc b/cpp/013literal_string.cc deleted file mode 100644 index 57ac8c3a..00000000 --- a/cpp/013literal_string.cc +++ /dev/null @@ -1,78 +0,0 @@ -//: For convenience, some instructions will take literal arrays of characters (strings). -//: -//: Instead of quotes, we'll use [] to delimit strings. That'll reduce the -//: need for escaping since we can support nested brackets. And we can also -//: imagine that 'recipe' might one day itself be defined in mu, doing its own -//: parsing. - -:(scenarios load) -:(scenario string_literal) -recipe main [ - 1:address:array:character <- copy [abc def] # copy can't really take a string -] -+parse: ingredient: {name: "abc def", value: 0, type: 0, properties: ["abc def": "literal-string"]} - -:(scenario string_literal_with_colons) -recipe main [ - 1:address:array:character <- copy [abc:def/ghi] -] -+parse: ingredient: {name: "abc:def/ghi", value: 0, type: 0, properties: ["abc:def/ghi": "literal-string"]} - -:(before "End Mu Types Initialization") -Type_number["literal-string"] = 0; - -:(after "string next_word(istream& in)") - if (in.peek() == '[') { - string result = slurp_quoted(in); - skip_whitespace(in); - skip_comment(in); - return result; - } - -:(code) -string slurp_quoted(istream& in) { - assert(!in.eof()); - assert(in.peek() == '['); - ostringstream out; - int size = 0; - while (!in.eof()) { - char c = in.get(); -//? cout << c << '\n'; //? 1 - out << c; -//? cout << out.str() << "$\n"; //? 1 - if (c == '[') ++size; - if (c == ']') --size; - if (size == 0) break; - } - return out.str(); -} - -:(after "reagent::reagent(string s)") -//? cout << s[0] << '\n'; //? 1 - if (s[0] == '[') { - assert(s[s.size()-1] == ']'); - // delete [] delimiters - s.erase(0, 1); - s.erase(s.size()-1, s.size()); - name = s; - types.push_back(0); - properties.push_back(pair<string, vector<string> >(name, vector<string>())); - properties.back().second.push_back("literal-string"); - return; - } - -:(scenario string_literal_nested) -recipe main [ - 1:address:array:character <- copy [abc [def]] -] -+parse: ingredient: {name: "abc [def]", value: 0, type: 0, properties: ["abc [def]": "literal-string"]} - -:(scenario string_literal_and_comment) -recipe main [ - 1:address:array:character <- copy [abc] # comment -] -+parse: instruction: copy -+parse: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} -+parse: product: {name: "1", value: 0, type: 2-5-4, properties: ["1": "address":"array":"character"]} -# no other ingredients -$parse: 3 diff --git a/cpp/014types.cc b/cpp/014types.cc deleted file mode 100644 index 4ff0f545..00000000 --- a/cpp/014types.cc +++ /dev/null @@ -1,96 +0,0 @@ -//: Textual form for types. - -:(scenarios load) -:(scenario container) -container foo [ - x:integer - y:integer -] -+parse: reading container foo -+parse: element name: x -+parse: type: 1 -+parse: element name: y -+parse: type: 1 - -:(before "End Command Handlers") -else if (command == "container") { - insert_container(command, container, in); -} - -:(code) -void insert_container(const string& command, kind_of_type kind, istream& in) { - skip_whitespace(in); - string name = next_word(in); - trace("parse") << "reading " << command << ' ' << name; -//? cout << name << '\n'; //? 1 - assert(Type_number.find(name) == Type_number.end()); - Type_number[name] = Next_type_number++; - skip_bracket(in, "'container' must begin with '['"); - assert(Type.find(Type_number[name]) == Type.end()); - type_info& t = Type[Type_number[name]]; - recently_added_types.push_back(Type_number[name]); - t.name = name; - t.kind = kind; - while (!in.eof()) { - skip_whitespace_and_comments(in); - string element = next_word(in); - if (element == "]") break; - istringstream inner(element); - t.element_names.push_back(slurp_until(inner, ':')); - trace("parse") << " element name: " << t.element_names.back(); - vector<type_number> types; - while (!inner.eof()) { - string type_name = slurp_until(inner, ':'); - if (Type_number.find(type_name) == Type_number.end()) - raise << "unknown type " << type_name << '\n'; - types.push_back(Type_number[type_name]); - trace("parse") << " type: " << types.back(); - } - t.elements.push_back(types); - } - assert(t.elements.size() == t.element_names.size()); - t.size = t.elements.size(); -} - -//:: Similarly for exclusive_container. - -:(scenario exclusive_container) -exclusive-container foo [ - x:integer - y:integer -] -+parse: reading exclusive-container foo -+parse: element name: x -+parse: type: 1 -+parse: element name: y -+parse: type: 1 - -:(before "End Command Handlers") -else if (command == "exclusive-container") { - insert_container(command, exclusive_container, in); -} - -//:: ensure types created in one scenario don't leak outside it. -:(before "End Globals") -vector<type_number> recently_added_types; -:(before "End Setup") -for (index_t i = 0; i < recently_added_types.size(); ++i) { -//? cout << "erasing " << Type[recently_added_types[i]].name << '\n'; //? 1 - Type_number.erase(Type[recently_added_types[i]].name); - Type.erase(recently_added_types[i]); -} -recently_added_types.clear(); -//: lastly, ensure scenarios are consistent by always starting them at the -//: same type number. -Next_type_number = 1000; -:(before "End Test Run Initialization") -assert(Next_type_number < 1000); -:(before "End Setup") -Next_type_number = 1000; - -:(code) -void skip_bracket(istream& in, string message) { - skip_whitespace_and_comments(in); - if (in.get() != '[') - raise << message << '\n'; -} diff --git a/cpp/020run.cc b/cpp/020run.cc deleted file mode 100644 index ee0bbb61..00000000 --- a/cpp/020run.cc +++ /dev/null @@ -1,206 +0,0 @@ -//: Phase 3: Start running a loaded and transformed recipe. -//: -//: So far we've seen recipes as lists of instructions, and instructions point -//: at other recipes. To kick things off mu needs to know how to run certain -//: 'primitive' recipes. That will then give the ability to run recipes -//: containing these primitives. -//: -//: This layer defines a skeleton with just two primitive recipes: IDLE which -//: does nothing, and COPY, which can copy numbers from one memory location to -//: another. Later layers will add more primitives. - -:(scenario copy_literal) -recipe main [ - 1:integer <- copy 23:literal -] -+run: instruction main/0 -+run: ingredient 0 is 23 -+mem: storing 23 in location 1 - -:(scenario copy) -recipe main [ - 1:integer <- copy 23:literal - 2:integer <- copy 1:integer -] -+run: instruction main/1 -+run: ingredient 0 is 1 -+mem: location 1 is 23 -+mem: storing 23 in location 2 - -:(before "End Types") -// Book-keeping while running a recipe. -//: Later layers will change this. -struct routine { - recipe_number running_recipe; - index_t running_step_index; - routine(recipe_number r) :running_recipe(r), running_step_index(0) {} - bool completed() const; -}; - -:(before "End Globals") -routine* Current_routine = NULL; - -:(code) -void run(recipe_number r) { - routine rr(r); - Current_routine = &rr; - run_current_routine(); -} - -void run_current_routine() -{ // curly on a separate line, because later layers will modify header - while (!Current_routine->completed()) // later layers will modify condition - { - // Running One Instruction. - if (current_instruction().is_label) { ++current_step_index(); continue; } - trace("run") << "instruction " << current_recipe_name() << '/' << current_step_index(); - trace("run") << current_instruction().to_string(); -//? cout << "operation " << current_instruction().operation << '\n'; //? 3 - switch (current_instruction().operation) { - // Primitive Recipe Implementations - case COPY: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> data = read_memory(current_instruction().ingredients[0]); - write_memory(current_instruction().products[0], data); - break; - } - // End Primitive Recipe Implementations - default: { - cout << "not a primitive op: " << current_instruction().operation << '\n'; - } - } - ++current_step_index(); - } -} - -//: Some helpers. -//: We'll need to override these later as we change the definition of routine. -//: Important that they return referrences into the routine. - -inline index_t& current_step_index() { - return Current_routine->running_step_index; -} - -inline const string& current_recipe_name() { - return Recipe[Current_routine->running_recipe].name; -} - -inline const instruction& current_instruction() { - return Recipe[Current_routine->running_recipe].steps[Current_routine->running_step_index]; -} - -inline bool routine::completed() const { - return running_step_index >= Recipe[running_recipe].steps.size(); -} - -:(before "End Commandline Parsing") -if (argc > 1) { - for (int i = 1; i < argc; ++i) { - load_permanently(argv[i]); - } -} - -:(before "End Main") -if (!Run_tests) { - setup(); - Trace_stream = new trace_stream; -//? Trace_stream->dump_layer = "all"; //? 2 - transform_all(); - recipe_number r = Recipe_number[string("main")]; -//? Trace_stream->dump_layer = "all"; //? 1 - if (r) run(r); -//? dump_memory(); //? 1 - teardown(); -} - -:(code) -void load_permanently(string filename) { - ifstream fin(filename.c_str()); - if (!fin) { - raise << "no such file " << filename << '\n'; - return; - } - fin >> std::noskipws; - load(fin); - transform_all(); - fin.close(); - // freeze everything so it doesn't get cleared by tests - recently_added_recipes.clear(); - recently_added_types.clear(); -} - -//:: On startup, load everything in core.mu -:(before "End Load Recipes") -load_permanently("core.mu"); - -:(code) -// helper for tests -void run(string form) { - vector<recipe_number> tmp = load(form); - if (tmp.empty()) return; - transform_all(); - run(tmp.front()); -} - -//:: Reading from memory, writing to memory. - -vector<long long int> read_memory(reagent x) { -//? cout << "read_memory: " << x.to_string() << '\n'; //? 1 - vector<long long int> result; - if (isa_literal(x)) { - result.push_back(x.value); - return result; - } - index_t base = x.value; - size_t size = size_of(x); - for (index_t offset = 0; offset < size; ++offset) { - int val = Memory[base+offset]; - trace("mem") << "location " << base+offset << " is " << val; - result.push_back(val); - } - return result; -} - -void write_memory(reagent x, vector<long long int> data) { - if (is_dummy(x)) return; - index_t base = x.value; - if (size_of(x) != data.size()) - raise << "size mismatch in storing to " << x.to_string() << '\n'; - for (index_t offset = 0; offset < data.size(); ++offset) { - trace("mem") << "storing " << data[offset] << " in location " << base+offset; - Memory[base+offset] = data[offset]; - } -} - -:(code) -size_t size_of(const reagent& r) { - return size_of(r.types); -} -size_t size_of(const vector<type_number>& types) { - // End size_of(types) Cases - return 1; -} - -bool is_dummy(const reagent& x) { - return x.name == "_"; -} - -bool isa_literal(const reagent& r) { - return r.types.size() == 1 && r.types[0] == 0; -} - -:(scenario run_label) -recipe main [ - +foo - 1:integer <- copy 23:literal - 2:integer <- copy 1:integer -] -+run: instruction main/1 -+run: instruction main/2 --run: instruction main/0 - -:(scenario run_dummy) -recipe main [ - _ <- copy 0:literal -] -+run: instruction main/0 diff --git a/cpp/021arithmetic.cc b/cpp/021arithmetic.cc deleted file mode 100644 index e9496248..00000000 --- a/cpp/021arithmetic.cc +++ /dev/null @@ -1,226 +0,0 @@ -//: Arithmetic primitives - -:(before "End Primitive Recipe Declarations") -ADD, -:(before "End Primitive Recipe Numbers") -Recipe_number["add"] = ADD; -:(before "End Primitive Recipe Implementations") -case ADD: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] + arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario add_literal) -recipe main [ - 1:integer <- add 23:literal, 34:literal -] -+run: instruction main/0 -+run: ingredient 0 is 23 -+run: ingredient 1 is 34 -+run: product 0 is 57 -+mem: storing 57 in location 1 - -:(scenario add) -recipe main [ - 1:integer <- copy 23:literal - 2:integer <- copy 34:literal - 3:integer <- add 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 23 -+run: ingredient 1 is 2 -+mem: location 2 is 34 -+run: product 0 is 57 -+mem: storing 57 in location 3 - -:(before "End Primitive Recipe Declarations") -SUBTRACT, -:(before "End Primitive Recipe Numbers") -Recipe_number["subtract"] = SUBTRACT; -:(before "End Primitive Recipe Implementations") -case SUBTRACT: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] - arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario subtract_literal) -recipe main [ - 1:integer <- subtract 5:literal, 2:literal -] -+run: instruction main/0 -+run: ingredient 0 is 5 -+run: ingredient 1 is 2 -+run: product 0 is 3 -+mem: storing 3 in location 1 - -:(scenario subtract) -recipe main [ - 1:integer <- copy 23:literal - 2:integer <- copy 34:literal - 3:integer <- subtract 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 23 -+run: ingredient 1 is 2 -+mem: location 2 is 34 -+run: product 0 is -11 -+mem: storing -11 in location 3 - -:(before "End Primitive Recipe Declarations") -MULTIPLY, -:(before "End Primitive Recipe Numbers") -Recipe_number["multiply"] = MULTIPLY; -:(before "End Primitive Recipe Implementations") -case MULTIPLY: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - trace("run") << "ingredient 1 is " << arg1[0]; - vector<long long int> result; - result.push_back(arg0[0] * arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario multiply_literal) -recipe main [ - 1:integer <- multiply 2:literal, 3:literal -] -+run: instruction main/0 -+run: ingredient 0 is 2 -+run: ingredient 1 is 3 -+run: product 0 is 6 -+mem: storing 6 in location 1 - -:(scenario multiply) -recipe main [ - 1:integer <- copy 4:literal - 2:integer <- copy 6:literal - 3:integer <- multiply 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 4 -+run: ingredient 1 is 2 -+mem: location 2 is 6 -+run: product 0 is 24 -+mem: storing 24 in location 3 - -:(before "End Primitive Recipe Declarations") -DIVIDE, -:(before "End Primitive Recipe Numbers") -Recipe_number["divide"] = DIVIDE; -:(before "End Primitive Recipe Implementations") -case DIVIDE: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - trace("run") << "ingredient 1 is " << arg1[0]; - vector<long long int> result; - result.push_back(arg0[0] / arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario divide_literal) -recipe main [ - 1:integer <- divide 8:literal, 2:literal -] -+run: instruction main/0 -+run: ingredient 0 is 8 -+run: ingredient 1 is 2 -+run: product 0 is 4 -+mem: storing 4 in location 1 - -:(scenario divide) -recipe main [ - 1:integer <- copy 27:literal - 2:integer <- copy 3:literal - 3:integer <- divide 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 27 -+run: ingredient 1 is 2 -+mem: location 2 is 3 -+run: product 0 is 9 -+mem: storing 9 in location 3 - -:(before "End Primitive Recipe Declarations") -DIVIDE_WITH_REMAINDER, -:(before "End Primitive Recipe Numbers") -Recipe_number["divide-with-remainder"] = DIVIDE_WITH_REMAINDER; -:(before "End Primitive Recipe Implementations") -case DIVIDE_WITH_REMAINDER: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result0; - result0.push_back(arg0[0] / arg1[0]); - trace("run") << "product 0 is " << result0[0]; - write_memory(current_instruction().products[0], result0); - vector<long long int> result1; - result1.push_back(arg0[0] % arg1[0]); - trace("run") << "product 1 is " << result1[0]; - write_memory(current_instruction().products[1], result1); - break; -} - -:(scenario divide_with_remainder_literal) -recipe main [ - 1:integer, 2:integer <- divide-with-remainder 9:literal, 2:literal -] -+run: instruction main/0 -+run: ingredient 0 is 9 -+run: ingredient 1 is 2 -+run: product 0 is 4 -+mem: storing 4 in location 1 -+run: product 1 is 1 -+mem: storing 1 in location 2 - -:(scenario divide_with_remainder) -recipe main [ - 1:integer <- copy 27:literal - 2:integer <- copy 11:literal - 3:integer, 4:integer <- divide-with-remainder 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 27 -+run: ingredient 1 is 2 -+mem: location 2 is 11 -+run: product 0 is 2 -+mem: storing 2 in location 3 -+run: product 1 is 5 -+mem: storing 5 in location 4 diff --git a/cpp/022boolean.cc b/cpp/022boolean.cc deleted file mode 100644 index 013519fd..00000000 --- a/cpp/022boolean.cc +++ /dev/null @@ -1,94 +0,0 @@ -//: Boolean primitives - -:(before "End Primitive Recipe Declarations") -AND, -:(before "End Primitive Recipe Numbers") -Recipe_number["and"] = AND; -:(before "End Primitive Recipe Implementations") -case AND: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] && arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario and) -recipe main [ - 1:integer <- copy 1:literal - 2:integer <- copy 0:literal - 3:integer <- and 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 1 -+run: ingredient 1 is 2 -+mem: location 2 is 0 -+run: product 0 is 0 -+mem: storing 0 in location 3 - -:(before "End Primitive Recipe Declarations") -OR, -:(before "End Primitive Recipe Numbers") -Recipe_number["or"] = OR; -:(before "End Primitive Recipe Implementations") -case OR: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] || arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario or) -recipe main [ - 1:integer <- copy 1:literal - 2:integer <- copy 0:literal - 3:integer <- or 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 1 -+run: ingredient 1 is 2 -+mem: location 2 is 0 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(before "End Primitive Recipe Declarations") -NOT, -:(before "End Primitive Recipe Numbers") -Recipe_number["not"] = NOT; -:(before "End Primitive Recipe Implementations") -case NOT: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - vector<long long int> result; - result.push_back(!arg0[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario not) -recipe main [ - 1:integer <- copy 1:literal - 2:integer <- not 1:integer -] -+run: instruction main/1 -+run: ingredient 0 is 1 -+mem: location 1 is 1 -+run: product 0 is 0 -+mem: storing 0 in location 2 diff --git a/cpp/023jump.cc b/cpp/023jump.cc deleted file mode 100644 index 7e649ddd..00000000 --- a/cpp/023jump.cc +++ /dev/null @@ -1,115 +0,0 @@ -//: Jump primitives - -:(before "End Primitive Recipe Declarations") -JUMP, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump"] = JUMP; -:(before "End Primitive Recipe Implementations") -case JUMP: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].value; - current_step_index() += current_instruction().ingredients[0].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_can_skip_instructions) -recipe main [ - jump 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 0 is 1 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_backward) -recipe main [ - jump 1:offset # 0 -+ - jump 1:offset # | +-+ 1 - # \/ /\ | - jump -2:offset # 2 +-->+ | -] # \/ 3 -+run: instruction main/0 -+run: instruction main/2 -+run: instruction main/1 - -:(before "End Primitive Recipe Declarations") -JUMP_IF, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump-if"] = JUMP_IF; -:(before "End Primitive Recipe Implementations") -case JUMP_IF: { - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 0 is " << arg0[0]; - if (!arg0[0]) { - trace("run") << "jump-if fell through"; - break; - } - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - current_step_index() += current_instruction().ingredients[1].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_if) -recipe main [ - jump-if 999:literal 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 1 is 1 -+run: jumping to instruction 2 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_if_fallthrough) -recipe main [ - jump-if 0:literal 1:offset - 123:integer <- copy 1:literal -] -+run: instruction main/0 -+run: jump-if fell through -+run: instruction main/1 -+mem: storing 1 in location 123 - -:(before "End Primitive Recipe Declarations") -JUMP_UNLESS, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump-unless"] = JUMP_UNLESS; -:(before "End Primitive Recipe Implementations") -case JUMP_UNLESS: { - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 0 is " << arg0[0]; - if (arg0[0]) { - trace("run") << "jump-unless fell through"; - break; - } - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - current_step_index() += current_instruction().ingredients[1].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_unless) -recipe main [ - jump-unless 0:literal 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 1 is 1 -+run: jumping to instruction 2 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_unless_fallthrough) -recipe main [ - jump-unless 999:literal 1:offset - 123:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 0 is 999 -+run: jump-unless fell through -+run: instruction main/1 -+mem: storing 1 in location 123 diff --git a/cpp/024compare.cc b/cpp/024compare.cc deleted file mode 100644 index 91cea1e6..00000000 --- a/cpp/024compare.cc +++ /dev/null @@ -1,262 +0,0 @@ -//: Comparison primitives - -:(before "End Primitive Recipe Declarations") -EQUAL, -:(before "End Primitive Recipe Numbers") -Recipe_number["equal"] = EQUAL; -:(before "End Primitive Recipe Implementations") -case EQUAL: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - vector<long long int> result; - result.push_back(equal(arg0.begin(), arg0.end(), arg1.begin())); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario equal) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 33:literal - 3:integer <- equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 0 -+mem: storing 0 in location 3 - -:(scenario equal2) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 34:literal - 3:integer <- equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 34 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(before "End Primitive Recipe Declarations") -GREATER_THAN, -:(before "End Primitive Recipe Numbers") -Recipe_number["greater-than"] = GREATER_THAN; -:(before "End Primitive Recipe Implementations") -case GREATER_THAN: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] > arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario greater_than) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 33:literal - 3:integer <- greater-than 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario greater_than2) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 34:literal - 3:integer <- greater-than 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 34 -+run: product 0 is 0 -+mem: storing 0 in location 3 - -:(before "End Primitive Recipe Declarations") -LESSER_THAN, -:(before "End Primitive Recipe Numbers") -Recipe_number["lesser-than"] = LESSER_THAN; -:(before "End Primitive Recipe Implementations") -case LESSER_THAN: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] < arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario lesser_than) -recipe main [ - 1:integer <- copy 32:literal - 2:integer <- copy 33:literal - 3:integer <- lesser-than 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 32 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario lesser_than2) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 33:literal - 3:integer <- lesser-than 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 0 -+mem: storing 0 in location 3 - -:(before "End Primitive Recipe Declarations") -GREATER_OR_EQUAL, -:(before "End Primitive Recipe Numbers") -Recipe_number["greater-or-equal"] = GREATER_OR_EQUAL; -:(before "End Primitive Recipe Implementations") -case GREATER_OR_EQUAL: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] >= arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario greater_or_equal) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 33:literal - 3:integer <- greater-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario greater_or_equal2) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 34:literal - 3:integer <- greater-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 34 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario greater_or_equal3) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 35:literal - 3:integer <- greater-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 35 -+run: product 0 is 0 -+mem: storing 0 in location 3 - -:(before "End Primitive Recipe Declarations") -LESSER_OR_EQUAL, -:(before "End Primitive Recipe Numbers") -Recipe_number["lesser-or-equal"] = LESSER_OR_EQUAL; -:(before "End Primitive Recipe Implementations") -case LESSER_OR_EQUAL: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - vector<long long int> arg1 = read_memory(current_instruction().ingredients[1]); - assert(arg1.size() == 1); - vector<long long int> result; - result.push_back(arg0[0] <= arg1[0]); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -:(scenario lesser_or_equal) -recipe main [ - 1:integer <- copy 32:literal - 2:integer <- copy 33:literal - 3:integer <- lesser-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 32 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario lesser_or_equal2) -recipe main [ - 1:integer <- copy 33:literal - 2:integer <- copy 33:literal - 3:integer <- lesser-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 33 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 1 -+mem: storing 1 in location 3 - -:(scenario lesser_or_equal3) -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 33:literal - 3:integer <- lesser-or-equal 1:integer, 2:integer -] -+run: instruction main/2 -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+run: ingredient 1 is 2 -+mem: location 2 is 33 -+run: product 0 is 0 -+mem: storing 0 in location 3 diff --git a/cpp/025trace.cc b/cpp/025trace.cc deleted file mode 100644 index ae06cb8b..00000000 --- a/cpp/025trace.cc +++ /dev/null @@ -1,21 +0,0 @@ -//: Allow mu programs to log facts just like we've been doing in C++ so far. - -:(scenario trace) -recipe main [ - trace [foo], [this is a trace in mu] -] -+foo: this is a trace in mu - -:(before "End Primitive Recipe Declarations") -TRACE, -:(before "End Primitive Recipe Numbers") -Recipe_number["trace"] = TRACE; -:(before "End Primitive Recipe Implementations") -case TRACE: { - assert(isa_literal(current_instruction().ingredients[0])); - string label = current_instruction().ingredients[0].name; - assert(isa_literal(current_instruction().ingredients[1])); - string message = current_instruction().ingredients[1].name; - trace(label) << message; - break; -} diff --git a/cpp/026assert.cc b/cpp/026assert.cc deleted file mode 100644 index 6ab49db2..00000000 --- a/cpp/026assert.cc +++ /dev/null @@ -1,20 +0,0 @@ -:(scenario assert) -% Hide_warnings = true; -recipe main [ - assert 0:literal, [this is an assert in mu] -] -+warn: this is an assert in mu - -:(before "End Primitive Recipe Declarations") -ASSERT, -:(before "End Primitive Recipe Numbers") -Recipe_number["assert"] = ASSERT; -:(before "End Primitive Recipe Implementations") -case ASSERT: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - vector<long long int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - if (arg0[0] == 0) - raise << current_instruction().ingredients[1].name << '\n'; - break; -} diff --git a/cpp/027debug.cc b/cpp/027debug.cc deleted file mode 100644 index 27ac8ce6..00000000 --- a/cpp/027debug.cc +++ /dev/null @@ -1,52 +0,0 @@ -//: Recipe to look at elements of containers. - -:(before "End Primitive Recipe Declarations") -_PRINT, -:(before "End Primitive Recipe Numbers") -Recipe_number["$print"] = _PRINT; -:(before "End Primitive Recipe Implementations") -case _PRINT: { - if (isa_literal(current_instruction().ingredients[0])) { - trace("run") << "$print: " << current_instruction().ingredients[0].name; - cout << current_instruction().ingredients[0].name; - break; - } - vector<long long int> result(read_memory(current_instruction().ingredients[0])); - for (index_t i = 0; i < result.size(); ++i) { - trace("run") << "$print: " << result[i]; - if (i > 0) cout << " "; - cout << result[i]; - } - break; -} - -:(before "End Primitive Recipe Declarations") -_START_TRACING, -:(before "End Primitive Recipe Numbers") -Recipe_number["$start-tracing"] = _START_TRACING; -:(before "End Primitive Recipe Implementations") -case _START_TRACING: { - Trace_stream->dump_layer = "all"; -//? cout << Trace_stream << ": " << Trace_stream->dump_layer << '\n'; //? 1 - break; -} - -:(before "End Primitive Recipe Declarations") -_STOP_TRACING, -:(before "End Primitive Recipe Numbers") -Recipe_number["$stop-tracing"] = _STOP_TRACING; -:(before "End Primitive Recipe Implementations") -case _STOP_TRACING: { - Trace_stream->dump_layer = ""; - break; -} - -:(before "End Primitive Recipe Declarations") -_EXIT, -:(before "End Primitive Recipe Numbers") -Recipe_number["$exit"] = _EXIT; -:(before "End Primitive Recipe Implementations") -case _EXIT: { - exit(0); - break; -} diff --git a/cpp/030container.cc b/cpp/030container.cc deleted file mode 100644 index 9de3aad7..00000000 --- a/cpp/030container.cc +++ /dev/null @@ -1,169 +0,0 @@ -//: Containers contain a fixed number of elements of different types. - -:(before "End Mu Types Initialization") -//: We'll use this container as a running example, with two integer elements. -type_number point = Type_number["point"] = Next_type_number++; -Type[point].size = 2; -Type[point].kind = container; -Type[point].name = "point"; -vector<type_number> i; -i.push_back(integer); -Type[point].elements.push_back(i); -Type[point].elements.push_back(i); - -:(scenario copy_multiple_locations) -# Containers can be copied around with a single instruction just like integers, -# no matter how large they are. -recipe main [ - 1:integer <- copy 34:literal - 2:integer <- copy 35:literal - 3:point <- copy 1:point -] -+run: ingredient 0 is 1 -+mem: location 1 is 34 -+mem: location 2 is 35 -+mem: storing 34 in location 3 -+mem: storing 35 in location 4 - -:(before "End Mu Types Initialization") -// A more complex container, containing another container as one of its -// elements. -type_number point_integer = Type_number["point-integer"] = Next_type_number++; -Type[point_integer].size = 2; -Type[point_integer].kind = container; -Type[point_integer].name = "point-integer"; -vector<type_number> p2; -p2.push_back(point); -Type[point_integer].elements.push_back(p2); -vector<type_number> i2; -i2.push_back(integer); -Type[point_integer].elements.push_back(i2); - -:(scenario copy_handles_nested_container_elements) -recipe main [ - 12:integer <- copy 34:literal - 13:integer <- copy 35:literal - 14:integer <- copy 36:literal - 15:point-integer <- copy 12:point-integer -] -+mem: storing 36 in location 17 - -:(before "End size_of(types) Cases") -type_info t = Type[types[0]]; -if (t.kind == container) { - // size of a container is the sum of the sizes of its elements - size_t result = 0; - for (index_t i = 0; i < t.elements.size(); ++i) { - result += size_of(t.elements[i]); - } - return result; -} - -//:: To access elements of a container, use 'get' -:(scenario get) -recipe main [ - 12:integer <- copy 34:literal - 13:integer <- copy 35:literal - 15:integer <- get 12:point, 1:offset -] -+run: instruction main/2 -+run: ingredient 0 is 12 -+run: ingredient 1 is 1 -+run: address to copy is 13 -+run: its type is 1 -+mem: location 13 is 35 -+run: product 0 is 35 -+mem: storing 35 in location 15 - -:(before "End Primitive Recipe Declarations") -GET, -:(before "End Primitive Recipe Numbers") -Recipe_number["get"] = GET; -:(before "End Primitive Recipe Implementations") -case GET: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - reagent base = current_instruction().ingredients[0]; - index_t base_address = base.value; - type_number base_type = base.types[0]; - assert(Type[base_type].kind == container); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - assert(isa_literal(current_instruction().ingredients[1])); - index_t offset = current_instruction().ingredients[1].value; - index_t src = base_address; - for (index_t i = 0; i < offset; ++i) { - src += size_of(Type[base_type].elements[i]); - } - trace("run") << "address to copy is " << src; - assert(Type[base_type].kind == container); - assert(Type[base_type].elements.size() > offset); - type_number src_type = Type[base_type].elements[offset][0]; - trace("run") << "its type is " << src_type; - reagent tmp; - tmp.set_value(src); - tmp.types.push_back(src_type); - vector<long long int> result(read_memory(tmp)); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} - -//: 'get' requires a literal in ingredient 1. We'll use a synonym called -//: 'offset'. -:(before "End Mu Types Initialization") -Type_number["offset"] = 0; - -:(scenario get_handles_nested_container_elements) -recipe main [ - 12:integer <- copy 34:literal - 13:integer <- copy 35:literal - 14:integer <- copy 36:literal - 15:integer <- get 12:point-integer, 1:offset -] -+run: instruction main/2 -+run: ingredient 0 is 12 -+run: ingredient 1 is 1 -+run: address to copy is 14 -+run: its type is 1 -+mem: location 14 is 36 -+run: product 0 is 36 -+mem: storing 36 in location 15 - -//:: To write to elements of containers, you need their address. - -:(scenario get_address) -recipe main [ - 12:integer <- copy 34:literal - 13:integer <- copy 35:literal - 15:address:integer <- get-address 12:point, 1:offset -] -+run: instruction main/2 -+run: ingredient 0 is 12 -+run: ingredient 1 is 1 -+run: address to copy is 13 -+mem: storing 13 in location 15 - -:(before "End Primitive Recipe Declarations") -GET_ADDRESS, -:(before "End Primitive Recipe Numbers") -Recipe_number["get-address"] = GET_ADDRESS; -:(before "End Primitive Recipe Implementations") -case GET_ADDRESS: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - reagent base = current_instruction().ingredients[0]; - index_t base_address = base.value; - type_number base_type = base.types[0]; - assert(Type[base_type].kind == container); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - assert(isa_literal(current_instruction().ingredients[1])); - index_t offset = current_instruction().ingredients[1].value; - index_t src = base_address; - for (index_t i = 0; i < offset; ++i) { - src += size_of(Type[base_type].elements[i]); - } - trace("run") << "address to copy is " << src; - vector<long long int> result; - result.push_back(src); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} diff --git a/cpp/031address.cc b/cpp/031address.cc deleted file mode 100644 index 1c830c74..00000000 --- a/cpp/031address.cc +++ /dev/null @@ -1,130 +0,0 @@ -//: Instructions can read from addresses pointing at other locations using the -//: 'deref' property. - -:(scenario copy_indirect) -recipe main [ - 1:address:integer <- copy 2:literal - 2:integer <- copy 34:literal - # This loads location 1 as an address and looks up *that* location. - 3:integer <- copy 1:address:integer/deref -] -+run: instruction main/2 -+mem: location 1 is 2 -+mem: location 2 is 34 -+mem: storing 34 in location 3 - -:(before "index_t base = x.value" following "vector<long long int> read_memory(reagent x)") -x = canonize(x); - -//: similarly, write to addresses pointing at other locations using the -//: 'deref' property -:(scenario store_indirect) -recipe main [ - 1:address:integer <- copy 2:literal - 1:address:integer/deref <- copy 34:literal -] -+run: instruction main/1 -+mem: location 1 is 2 -+mem: storing 34 in location 2 - -:(before "index_t base = x.value" following "void write_memory(reagent x, vector<long long int> data)") -x = canonize(x); - -:(code) -reagent canonize(reagent x) { - if (isa_literal(x)) return x; -//? cout << "canonize\n"; //? 1 - reagent r = x; -//? cout << x.to_string() << " => " << r.to_string() << '\n'; //? 1 - while (has_property(r, "deref")) - r = deref(r); - return r; -} - -reagent deref(reagent x) { -//? cout << "deref: " << x.to_string() << "\n"; //? 2 - static const type_number ADDRESS = Type_number["address"]; - reagent result; - assert(x.types[0] == ADDRESS); - - // compute value - result.set_value(Memory[x.value]); - trace("mem") << "location " << x.value << " is " << result.value; - - // populate types - copy(++x.types.begin(), x.types.end(), inserter(result.types, result.types.begin())); - - // drop-one 'deref' - index_t i = 0; - size_t len = x.properties.size(); - for (i = 0; i < len; ++i) { - if (x.properties[i].first == "deref") break; - result.properties.push_back(x.properties[i]); - } - ++i; // skip first deref - for (; i < len; ++i) { - result.properties.push_back(x.properties[i]); - } - return result; -} - -//:: 'get' can read from container address -:(scenario get_indirect) -recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get 1:address:point/deref, 0:offset -] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 34 -+mem: storing 34 in location 4 - -:(scenario include_nonderef_properties) -recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get 1:address:point/deref/foo, 0:offset -] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 34 -+mem: storing 34 in location 4 - -:(after "reagent base = " following "case GET:") -base = canonize(base); - -:(scenario get_address_indirect) -# 'get' can read from container address -recipe main [ - 1:integer <- copy 2:literal - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer <- get-address 1:address:point/deref, 0:offset -] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 2 - -:(after "reagent base = " following "case GET_ADDRESS:") -base = canonize(base); - -//:: helpers - -:(code) -bool has_property(reagent x, string name) { - for (index_t i = 0; i < x.properties.size(); ++i) { - if (x.properties[i].first == name) return true; - } - return false; -} - -vector<string> property(const reagent& r, const string& name) { - for (index_t p = 0; p != r.properties.size(); ++p) { - if (r.properties[p].first == name) - return r.properties[p].second; - } - return vector<string>(); -} diff --git a/cpp/032array.cc b/cpp/032array.cc deleted file mode 100644 index de19b719..00000000 --- a/cpp/032array.cc +++ /dev/null @@ -1,180 +0,0 @@ -//: Arrays contain a variable number of elements of the same type. Their value -//: starts with the length of the array. -//: -//: You can create arrays of containers, but containers can only contain -//: elements of a fixed size, so you can't create containers containing arrays. -//: Create containers containing addresses to arrays instead. - -:(scenario copy_array) -# Arrays can be copied around with a single instruction just like integers, -# no matter how large they are. -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:array:integer <- copy 1:array:integer -] -+run: instruction main/4 -+run: ingredient 0 is 1 -+mem: location 1 is 3 -+mem: location 2 is 14 -+mem: location 3 is 15 -+mem: location 4 is 16 -+mem: storing 3 in location 5 -+mem: storing 14 in location 6 -+mem: storing 15 in location 7 -+mem: storing 16 in location 8 - -:(scenario copy_array_indirect) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:address:array:integer <- copy 1:literal - 6:array:integer <- copy 5:address:array:integer/deref -] -+run: instruction main/5 -+run: ingredient 0 is 5 -+mem: location 1 is 3 -+mem: location 2 is 14 -+mem: location 3 is 15 -+mem: location 4 is 16 -+mem: storing 3 in location 6 -+mem: storing 14 in location 7 -+mem: storing 15 in location 8 -+mem: storing 16 in location 9 - -//: disable the size mismatch check since the destination array need not be initialized -:(replace "if (size_of(x) != data.size())" following "void write_memory(reagent x, vector<long long int> data)") -if (x.types[0] != Type_number["array"] && size_of(x) != data.size()) -:(after "size_t size_of(const reagent& r)") - static const type_number ARRAY = Type_number["array"]; - if (r.types[0] == ARRAY) { - assert(r.types.size() > 1); - // skip the 'array' type to get at the element type - return 1 + Memory[r.value]*size_of(array_element(r.types)); - } - -//:: To access elements of an array, use 'index' - -:(scenario index) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:integer <- index 1:array:integer, 0:literal -] -+run: instruction main/4 -+run: address to copy is 2 -+run: its type is 1 -+mem: location 2 is 14 -+run: product 0 is 14 -+mem: storing 14 in location 5 - -:(scenario index_direct_offset) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:integer <- copy 0:literal - 6:integer <- index 1:array:integer, 5:integer -] -+run: instruction main/5 -+run: address to copy is 2 -+run: its type is 1 -+mem: location 2 is 14 -+run: product 0 is 14 -+mem: storing 14 in location 6 - -:(before "End Primitive Recipe Declarations") -INDEX, -:(before "End Primitive Recipe Numbers") -Recipe_number["index"] = INDEX; -:(before "End Primitive Recipe Implementations") -case INDEX: { - static const type_number ARRAY = Type_number["array"]; -//? if (Trace_stream) Trace_stream->dump_layer = "run"; //? 1 - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].to_string(); - reagent base = canonize(current_instruction().ingredients[0]); -//? trace("run") << "ingredient 0 after canonize: " << base.to_string(); //? 1 - index_t base_address = base.value; - assert(base.types[0] == ARRAY); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].to_string(); - reagent offset = canonize(current_instruction().ingredients[1]); -//? trace("run") << "ingredient 1 after canonize: " << offset.to_string(); //? 1 - vector<long long int> offset_val(read_memory(offset)); - vector<type_number> element_type = array_element(base.types); -//? trace("run") << "offset: " << offset_val[0]; //? 1 -//? trace("run") << "size of elements: " << size_of(element_type); //? 1 - index_t src = base_address + 1 + offset_val[0]*size_of(element_type); - trace("run") << "address to copy is " << src; - trace("run") << "its type is " << element_type[0]; - reagent tmp; - tmp.set_value(src); - copy(element_type.begin(), element_type.end(), inserter(tmp.types, tmp.types.begin())); -//? trace("run") << "AAA: " << tmp.to_string() << '\n'; //? 3 - vector<long long int> result(read_memory(tmp)); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); -//? if (Trace_stream) Trace_stream->dump_layer = ""; //? 1 - break; -} - -:(code) -vector<type_number> array_element(const vector<type_number>& types) { - return vector<type_number>(++types.begin(), types.end()); -} - -:(scenario index_address) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:integer <- index-address 1:array:integer, 0:literal -] -+run: instruction main/4 -+run: address to copy is 2 -+mem: storing 2 in location 5 - -//:: To write to elements of containers, you need their address. - -:(scenario index_indirect) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:address:array:integer <- copy 1:literal - 6:integer <- index 5:address:array:integer/deref, 1:literal -] -+run: instruction main/5 -+mem: storing 15 in location 6 - -:(before "End Primitive Recipe Declarations") -INDEX_ADDRESS, -:(before "End Primitive Recipe Numbers") -Recipe_number["index-address"] = INDEX_ADDRESS; -:(before "End Primitive Recipe Implementations") -case INDEX_ADDRESS: { - static const type_number ARRAY = Type_number["array"]; - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - reagent base = canonize(current_instruction().ingredients[0]); - index_t base_address = base.value; - assert(base.types[0] == ARRAY); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].to_string(); - reagent offset = canonize(current_instruction().ingredients[1]); - vector<long long int> offset_val(read_memory(offset)); - vector<type_number> element_type = array_element(base.types); - index_t src = base_address + 1 + offset_val[0]*size_of(element_type); - trace("run") << "address to copy is " << src; - vector<long long int> result; - result.push_back(src); - trace("run") << "product 0 is " << result[0]; - write_memory(current_instruction().products[0], result); - break; -} diff --git a/cpp/033length.cc b/cpp/033length.cc deleted file mode 100644 index 126a14e7..00000000 --- a/cpp/033length.cc +++ /dev/null @@ -1,30 +0,0 @@ -//: Recipe to compute the length of an array. - -:(scenario array_length) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 14:literal - 3:integer <- copy 15:literal - 4:integer <- copy 16:literal - 5:integer <- length 1:array:integer -] -+run: instruction main/4 -+mem: storing 3 in location 5 - -:(before "End Primitive Recipe Declarations") -LENGTH, -:(before "End Primitive Recipe Numbers") -Recipe_number["length"] = LENGTH; -:(before "End Primitive Recipe Implementations") -case LENGTH: { - reagent x = canonize(current_instruction().ingredients[0]); - if (x.types[0] != Type_number["array"]) { - raise << "tried to calculate length of non-array " << x.to_string() << '\n'; - break; - } - vector<long long int> result; -//? cout << "length: " << x.value << '\n'; //? 1 - result.push_back(Memory[x.value]); - write_memory(current_instruction().products[0], result); - break; -} diff --git a/cpp/034exclusive_container.cc b/cpp/034exclusive_container.cc deleted file mode 100644 index 45164c35..00000000 --- a/cpp/034exclusive_container.cc +++ /dev/null @@ -1,108 +0,0 @@ -//: Exclusive containers contain exactly one of a fixed number of 'variants' -//: of different types. -//: -//: They also implicitly contain a tag describing precisely which variant is -//: currently stored in them. - -:(before "End Mu Types Initialization") -//: We'll use this container as a running example, with two integer elements. -{ -type_number tmp = Type_number["integer-or-point"] = Next_type_number++; -Type[tmp].size = 2; -Type[tmp].kind = exclusive_container; -Type[tmp].name = "integer-or-point"; -//? cout << tmp << ": " << Type[tmp].elements.size() << '\n'; //? 1 -vector<type_number> t1; -t1.push_back(integer); -Type[tmp].elements.push_back(t1); -//? cout << Type[tmp].elements.size() << '\n'; //? 1 -vector<type_number> t2; -t2.push_back(point); -Type[tmp].elements.push_back(t2); -//? cout << Type[tmp].elements.size() << '\n'; //? 1 -//? cout << "point: " << point << '\n'; //? 1 -Type[tmp].element_names.push_back("i"); -Type[tmp].element_names.push_back("p"); -} - -:(scenario copy_exclusive_container) -# Copying exclusive containers copies all their contents and an extra location for the tag. -recipe main [ - 1:integer <- copy 1:literal # 'point' variant - 2:integer <- copy 34:literal - 3:integer <- copy 35:literal - 4:integer-or-point <- copy 1:integer-or-point -] -+mem: storing 1 in location 4 -+mem: storing 34 in location 5 -+mem: storing 35 in location 6 - -:(before "End size_of(types) Cases") -if (t.kind == exclusive_container) { - // size of an exclusive container is the size of its largest variant - // (So like containers, it can't contain arrays.) -//? cout << "--- " << types[0] << ' ' << t.size << '\n'; //? 1 -//? cout << "point: " << Type_number["point"] << " " << Type[Type_number["point"]].name << " " << Type[Type_number["point"]].size << '\n'; //? 1 -//? cout << t.name << ' ' << t.size << ' ' << t.elements.size() << '\n'; //? 1 - size_t result = 0; - for (index_t i = 0; i < t.size; ++i) { - size_t tmp = size_of(t.elements[i]); -//? cout << i << ": " << t.elements[i][0] << ' ' << tmp << ' ' << result << '\n'; //? 1 - if (tmp > result) result = tmp; - } - // ...+1 for its tag. - return result+1; -} - -//:: To access variants of an exclusive container, use 'maybe-convert'. -//: It always returns an address (so that you can modify it) or null (to -//: signal that the conversion failed (because the container contains a -//: different variant). - -//: 'maybe-convert' requires a literal in ingredient 1. We'll use a synonym -//: called 'variant'. -:(before "End Mu Types Initialization") -Type_number["variant"] = 0; - -:(scenario maybe_convert) -recipe main [ - 12:integer <- copy 1:literal - 13:integer <- copy 35:literal - 14:integer <- copy 36:literal - 20:address:point <- maybe-convert 12:integer-or-point, 1:variant -] -+mem: storing 13 in location 20 - -:(scenario maybe_convert_fail) -recipe main [ - 12:integer <- copy 1:literal - 13:integer <- copy 35:literal - 14:integer <- copy 36:literal - 20:address:point <- maybe-convert 12:integer-or-point, 0:variant -] -+mem: storing 0 in location 20 - -:(before "End Primitive Recipe Declarations") -MAYBE_CONVERT, -:(before "End Primitive Recipe Numbers") -Recipe_number["maybe-convert"] = MAYBE_CONVERT; -:(before "End Primitive Recipe Implementations") -case MAYBE_CONVERT: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - reagent base = canonize(current_instruction().ingredients[0]); - index_t base_address = base.value; - type_number base_type = base.types[0]; - assert(Type[base_type].kind == exclusive_container); - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - assert(isa_literal(current_instruction().ingredients[1])); - index_t tag = current_instruction().ingredients[1].value; - vector<long long int> result; - if (tag == static_cast<index_t>(Memory[base_address])) { - result.push_back(base_address+1); - } - else { - result.push_back(0); - } - write_memory(current_instruction().products[0], result); - break; -} diff --git a/cpp/035call.cc b/cpp/035call.cc deleted file mode 100644 index 2cb40af8..00000000 --- a/cpp/035call.cc +++ /dev/null @@ -1,105 +0,0 @@ -//: So far the recipes we define can't run each other. Let's fix that. - -:(scenario calling_recipe) -recipe main [ - f -] -recipe f [ - 3:integer <- add 2:literal, 2:literal -] -+mem: storing 4 in location 3 - -:(scenario return_on_fallthrough) -recipe main [ - f - 1:integer <- copy 34:literal - 2:integer <- copy 34:literal - 3:integer <- copy 34:literal -] -recipe f [ - 4:integer <- copy 34:literal - 5:integer <- copy 34:literal -] -+run: instruction main/0 -+run: instruction f/0 -+run: instruction f/1 -+run: instruction main/1 -+run: instruction main/2 -+run: instruction main/3 - -:(before "struct routine {") -// Everytime a recipe runs another, we interrupt it and start running the new -// recipe. When that finishes, we continue this one where we left off. -// This requires maintaining a 'stack' of interrupted recipes or 'calls'. -struct call { - recipe_number running_recipe; - index_t running_step_index; - // End call Fields - call(recipe_number r) :running_recipe(r), running_step_index(0) {} -}; -typedef stack<call> call_stack; - -:(replace{} "struct routine") -struct routine { - call_stack calls; - // End routine Fields - routine(recipe_number r); - bool completed() const; - const vector<instruction>& steps() const; -}; -:(code) -routine::routine(recipe_number r) { - calls.push(call(r)); - // End routine Constructor -} - -//:: now update routine's helpers - -:(replace{} "inline index_t& current_step_index()") -inline index_t& current_step_index() { - return Current_routine->calls.top().running_step_index; -} -:(replace{} "inline const string& current_recipe_name()") -inline const string& current_recipe_name() { - return Recipe[Current_routine->calls.top().running_recipe].name; -} -:(replace{} "inline const instruction& current_instruction()") -inline const instruction& current_instruction() { - return Recipe[Current_routine->calls.top().running_recipe].steps[Current_routine->calls.top().running_step_index]; -} - -:(replace{} "default:" following "End Primitive Recipe Implementations") -default: { - // not a primitive; try to look up the book of recipes - if (Recipe.find(current_instruction().operation) == Recipe.end()) { - raise << "undefined operation " << current_instruction().operation << ": " << current_instruction().name << '\n'; - break; - } - Current_routine->calls.push(call(current_instruction().operation)); - continue; // not done with caller; don't increment current_step_index() -} - -//:: finally, we need to fix the termination conditions for the run loop - -:(replace{} "inline bool routine::completed() const") -inline bool routine::completed() const { - return calls.empty(); -} - -inline const vector<instruction>& routine::steps() const { - return Recipe[calls.top().running_recipe].steps; -} - -:(before "Running One Instruction") -// when we reach the end of one call, we may reach the end of the one below -// it, and the one below that, and so on -while (current_step_index() >= Current_routine->steps().size()) { - Current_routine->calls.pop(); - if (Current_routine->calls.empty()) return; - // todo: no results returned warning - ++current_step_index(); -} - -:(before "End Includes") -#include <stack> -using std::stack; diff --git a/cpp/036call_ingredient.cc b/cpp/036call_ingredient.cc deleted file mode 100644 index 6224f8df..00000000 --- a/cpp/036call_ingredient.cc +++ /dev/null @@ -1,129 +0,0 @@ -//: Calls can take ingredients just like primitives. To access a recipe's -//: ingredients, use 'next-ingredient'. - -:(scenario next_ingredient) -recipe main [ - f 2:literal -] -recipe f [ - 12:integer <- next-ingredient - 13:integer <- add 1:literal, 12:integer -] -+run: instruction f/1 -+mem: location 12 is 2 -+mem: storing 3 in location 13 - -:(scenario next_ingredient_missing) -recipe main [ - f -] -recipe f [ - _, 12:integer <- next-ingredient -] -+mem: storing 0 in location 12 - -:(before "End call Fields") -vector<vector<long long int> > ingredient_atoms; -index_t next_ingredient_to_process; -:(replace{} "call(recipe_number r)") -call(recipe_number r) :running_recipe(r), running_step_index(0), next_ingredient_to_process(0) {} - -:(replace "Current_routine->calls.push(call(current_instruction().operation))" following "End Primitive Recipe Implementations") -call callee(current_instruction().operation); -for (size_t i = 0; i < current_instruction().ingredients.size(); ++i) { - callee.ingredient_atoms.push_back(read_memory(current_instruction().ingredients[i])); -} -Current_routine->calls.push(callee); - -:(before "End Primitive Recipe Declarations") -NEXT_INGREDIENT, -:(before "End Primitive Recipe Numbers") -Recipe_number["next-ingredient"] = NEXT_INGREDIENT; -:(before "End Primitive Recipe Implementations") -case NEXT_INGREDIENT: { - if (Current_routine->calls.top().next_ingredient_to_process < Current_routine->calls.top().ingredient_atoms.size()) { - trace("run") << "product 0 is " - << Current_routine->calls.top().ingredient_atoms[Current_routine->calls.top().next_ingredient_to_process][0]; - write_memory(current_instruction().products[0], - Current_routine->calls.top().ingredient_atoms[Current_routine->calls.top().next_ingredient_to_process]); - if (current_instruction().products.size() > 1) { - vector<long long int> ingredient_exists; - ingredient_exists.push_back(1); - write_memory(current_instruction().products[1], ingredient_exists); - } - ++Current_routine->calls.top().next_ingredient_to_process; - } - else { - if (current_instruction().products.size() > 1) { - vector<long long int> no_ingredient; - no_ingredient.push_back(0); - write_memory(current_instruction().products[1], no_ingredient); - } - } - break; -} - -:(scenario rewind_ingredients) -recipe main [ - f 2:literal -] -recipe f [ - 12:integer <- next-ingredient # consume ingredient - _, 1:boolean <- next-ingredient # will not find any ingredients - rewind-ingredients - 13:integer, 2:boolean <- next-ingredient # will find ingredient again -] -+mem: storing 2 in location 12 -+mem: storing 0 in location 1 -+mem: storing 2 in location 13 -+mem: storing 1 in location 2 - -:(before "End Primitive Recipe Declarations") -REWIND_INGREDIENTS, -:(before "End Primitive Recipe Numbers") -Recipe_number["rewind-ingredients"] = REWIND_INGREDIENTS; -:(before "End Primitive Recipe Implementations") -case REWIND_INGREDIENTS: { - Current_routine->calls.top().next_ingredient_to_process = 0; - break; -} - -:(scenario ingredient) -recipe main [ - f 1:literal, 2:literal -] -recipe f [ - 12:integer <- ingredient 1:literal # consume second ingredient first - 13:integer, 1:boolean <- next-ingredient # next-ingredient tries to scan past that -] -+mem: storing 2 in location 12 -+mem: storing 0 in location 1 - -:(before "End Primitive Recipe Declarations") -INGREDIENT, -:(before "End Primitive Recipe Numbers") -Recipe_number["ingredient"] = INGREDIENT; -:(before "End Primitive Recipe Implementations") -case INGREDIENT: { - if (static_cast<index_t>(current_instruction().ingredients[0].value) < Current_routine->calls.top().ingredient_atoms.size()) { - Current_routine->calls.top().next_ingredient_to_process = current_instruction().ingredients[0].value; - trace("run") << "product 0 is " - << Current_routine->calls.top().ingredient_atoms[Current_routine->calls.top().next_ingredient_to_process][0]; - write_memory(current_instruction().products[0], - Current_routine->calls.top().ingredient_atoms[Current_routine->calls.top().next_ingredient_to_process]); - if (current_instruction().products.size() > 1) { - vector<long long int> ingredient_exists; - ingredient_exists.push_back(1); - write_memory(current_instruction().products[1], ingredient_exists); - } - ++Current_routine->calls.top().next_ingredient_to_process; - } - else { - if (current_instruction().products.size() > 1) { - vector<long long int> no_ingredient; - no_ingredient.push_back(0); - write_memory(current_instruction().products[1], no_ingredient); - } - } - break; -} diff --git a/cpp/037call_reply.cc b/cpp/037call_reply.cc deleted file mode 100644 index 697c6b84..00000000 --- a/cpp/037call_reply.cc +++ /dev/null @@ -1,95 +0,0 @@ -//: Calls can also generate products, using 'reply'. - -:(scenario reply) -recipe main [ - 3:integer, 4:integer <- f 2:literal -] -recipe f [ - 12:integer <- next-ingredient - 13:integer <- add 1:literal, 12:integer - reply 12:integer, 13:integer -] -+run: instruction main/0 -+run: result 0 is 2 -+mem: storing 2 in location 3 -+run: result 1 is 3 -+mem: storing 3 in location 4 - -:(before "End Primitive Recipe Declarations") -REPLY, -:(before "End Primitive Recipe Numbers") -Recipe_number["reply"] = REPLY; -:(before "End Primitive Recipe Implementations") -case REPLY: { - vector<vector<long long int> > callee_results; - for (index_t i = 0; i < current_instruction().ingredients.size(); ++i) { - callee_results.push_back(read_memory(current_instruction().ingredients[i])); - } - const instruction& reply_inst = current_instruction(); // save pointer into recipe before pop - Current_routine->calls.pop(); - assert(!Current_routine->calls.empty()); - const instruction& caller_instruction = current_instruction(); - assert(caller_instruction.products.size() <= callee_results.size()); - for (index_t i = 0; i < caller_instruction.products.size(); ++i) { - trace("run") << "result " << i << " is " << to_string(callee_results[i]); - // check that any reply ingredients with /same-as-ingredient connect up - // the corresponding ingredient and product in the caller. - if (has_property(reply_inst.ingredients[i], "same-as-ingredient")) { - vector<string> tmp = property(reply_inst.ingredients[i], "same-as-ingredient"); - assert(tmp.size() == 1); - long long int ingredient_index = to_int(tmp[0]); - if (caller_instruction.products[i].value != caller_instruction.ingredients[ingredient_index].value) - raise << "'same-as-ingredient' result " << caller_instruction.products[i].value << " must be location " << caller_instruction.ingredients[ingredient_index].value << '\n'; - } - write_memory(caller_instruction.products[i], callee_results[i]); - } - break; // instruction loop will increment caller's step_index -} - -//: Products can include containers and exclusive containers, addresses and arrays. -:(scenario reply_container) -recipe main [ - 3:point <- f 2:literal -] -recipe f [ - 12:integer <- next-ingredient - 13:integer <- copy 35:literal - reply 12:point -] -+run: instruction main/0 -+run: result 0 is [2, 35] -+mem: storing 2 in location 3 -+mem: storing 35 in location 4 - -//: In mu we'd like to assume that any instruction doesn't modify its -//: ingredients unless they're also products. The /same-as-ingredient inside -//: the recipe's 'reply' will help catch accidental misuse of such -//: 'ingredient-results' (sometimes called in-out parameters in other languages). -:(scenario reply_same_as_ingredient) -% Hide_warnings = true; -recipe main [ - 1:address:integer <- new integer:type - 2:address:integer <- test1 1:address:integer # call with different ingredient and product -] -recipe test1 [ - 10:address:integer <- next-ingredient - reply 10:address:integer/same-as-ingredient:0 -] -+warn: 'same-as-ingredient' result 2 must be location 1 - -:(code) -string to_string(const vector<long long int>& in) { - if (in.empty()) return "[]"; - ostringstream out; - if (in.size() == 1) { - out << in[0]; - return out.str(); - } - out << "["; - for (index_t i = 0; i < in.size(); ++i) { - if (i > 0) out << ", "; - out << in[i]; - } - out << "]"; - return out.str(); -} diff --git a/cpp/038scheduler.cc b/cpp/038scheduler.cc deleted file mode 100644 index d5d6ca87..00000000 --- a/cpp/038scheduler.cc +++ /dev/null @@ -1,244 +0,0 @@ -//: Run a second routine concurrently using fork, without any guarantees on -//: how the operations in each are interleaved with each other. - -:(scenario scheduler) -recipe f1 [ - start-running f2:recipe - 1:integer <- copy 3:literal -] -recipe f2 [ - 2:integer <- copy 4:literal -] -+schedule: f1 -+schedule: f2 - -//: first, add a deadline to run(routine) -//: these changes are ugly and brittle; just close your nose and get through the next few lines -:(replace "void run_current_routine()") -void run_current_routine(size_t time_slice) -:(replace "while (!Current_routine->completed())" following "void run_current_routine(size_t time_slice)") -size_t ninstrs = 0; -while (Current_routine->state == RUNNING && ninstrs < time_slice) -:(after "Running One Instruction") -ninstrs++; - -//: now the rest of the scheduler is clean - -:(before "struct routine") -enum routine_state { - RUNNING, - COMPLETED, - // End routine States -}; -:(before "End routine Fields") -enum routine_state state; -:(before "End routine Constructor") -state = RUNNING; - -:(before "End Globals") -vector<routine*> Routines; -index_t Current_routine_index = 0; -size_t Scheduling_interval = 500; -:(before "End Setup") -Scheduling_interval = 500; -:(replace{} "void run(recipe_number r)") -void run(recipe_number r) { - Routines.push_back(new routine(r)); - Current_routine_index = 0, Current_routine = Routines[0]; - while (!all_routines_done()) { - skip_to_next_routine(); -//? cout << "scheduler: " << Current_routine_index << '\n'; //? 1 - assert(Current_routine); - assert(Current_routine->state == RUNNING); - trace("schedule") << current_recipe_name(); - run_current_routine(Scheduling_interval); - if (Current_routine->completed()) - Current_routine->state = COMPLETED; - // End Scheduler State Transitions - } -//? cout << "done with run\n"; //? 1 -} - -:(code) -bool all_routines_done() { - for (index_t i = 0; i < Routines.size(); ++i) { -//? cout << "routine " << i << ' ' << Routines[i]->state << '\n'; //? 1 - if (Routines[i]->state == RUNNING) { - return false; - } - } - return true; -} - -// skip Current_routine_index past non-RUNNING routines -void skip_to_next_routine() { - assert(!Routines.empty()); - assert(Current_routine_index < Routines.size()); - for (index_t i = (Current_routine_index+1)%Routines.size(); i != Current_routine_index; i = (i+1)%Routines.size()) { - if (Routines[i]->state == RUNNING) { -//? cout << "switching to " << i << '\n'; //? 1 - Current_routine_index = i; - Current_routine = Routines[i]; - return; - } - } -//? cout << "all done\n"; //? 1 -} - -:(before "End Teardown") -for (index_t i = 0; i < Routines.size(); ++i) - delete Routines[i]; -Routines.clear(); - -//:: To schedule new routines to run, call 'start-scheduling'. - -//: 'start-scheduling' will return a unique id for the routine that was -//: created. -:(before "End routine Fields") -index_t id; -:(before "End Globals") -index_t Next_routine_id = 1; -:(before "End Setup") -Next_routine_id = 1; -:(before "End routine Constructor") -id = Next_routine_id; -Next_routine_id++; - -:(before "End Primitive Recipe Declarations") -START_RUNNING, -:(before "End Primitive Recipe Numbers") -Recipe_number["start-running"] = START_RUNNING; -:(before "End Primitive Recipe Implementations") -case START_RUNNING: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name; - assert(!current_instruction().ingredients[0].initialized); - routine* new_routine = new routine(Recipe_number[current_instruction().ingredients[0].name]); - // populate ingredients - for (index_t i = 1; i < current_instruction().ingredients.size(); ++i) - new_routine->calls.top().ingredient_atoms.push_back(read_memory(current_instruction().ingredients[i])); - Routines.push_back(new_routine); - if (!current_instruction().products.empty()) { - vector<long long int> result; - result.push_back(new_routine->id); - write_memory(current_instruction().products[0], result); - } - break; -} - -:(scenario scheduler_runs_single_routine) -% Scheduling_interval = 1; -recipe f1 [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal -] -+schedule: f1 -+run: instruction f1/0 -+schedule: f1 -+run: instruction f1/1 - -:(scenario scheduler_interleaves_routines) -% Scheduling_interval = 1; -recipe f1 [ - start-running f2:recipe - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal -] -recipe f2 [ - 3:integer <- copy 4:literal - 4:integer <- copy 4:literal -] -+schedule: f1 -+run: instruction f1/0 -+schedule: f2 -+run: instruction f2/0 -+schedule: f1 -+run: instruction f1/1 -+schedule: f2 -+run: instruction f2/1 -+schedule: f1 -+run: instruction f1/2 - -:(scenario start_running_takes_args) -recipe f1 [ - start-running f2:recipe, 3:literal -] -recipe f2 [ - 1:integer <- next-ingredient - 2:integer <- add 1:integer, 1:literal -] -+mem: storing 4 in location 2 - -:(scenario start_running_returns_routine_id) -recipe f1 [ - 1:integer <- start-running f2:recipe -] -recipe f2 [ - 12:integer <- copy 44:literal -] -+mem: storing 2 in location 1 - -:(scenario scheduler_skips_completed_routines) -# this scenario will require some careful setup in escaped C++ -# (straining our tangle capabilities to near-breaking point) -% recipe_number f1 = load("recipe f1 [\n1:integer <- copy 0:literal\n]").front(); -% recipe_number f2 = load("recipe f2 [\n2:integer <- copy 0:literal\n]").front(); -% Routines.push_back(new routine(f1)); // f1 meant to run -% Routines.push_back(new routine(f2)); -% Routines.back()->state = COMPLETED; // f2 not meant to run -#? % Trace_stream->dump_layer = "all"; -# must have at least one routine without escaping -recipe f3 [ - 3:integer <- copy 0:literal -] -# by interleaving '+' lines with '-' lines, we allow f1 and f3 to run in any order -+schedule: f1 -+mem: storing 0 in location 1 --schedule: f2 --mem: storing 0 in location 2 -+schedule: f3 -+mem: storing 0 in location 3 - -:(scenario scheduler_starts_at_middle_of_routines) -% Routines.push_back(new routine(COPY)); -% Routines.back()->state = COMPLETED; -recipe f1 [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal -] -+schedule: f1 --run: idle - -//:: 'routine-state' can tell if a given routine id is running - -:(scenario routine_state_test) -% Scheduling_interval = 2; -recipe f1 [ - 1:integer/child-id <- start-running f2:recipe - 12:integer <- copy 0:literal # race condition since we don't care about location 12 - # thanks to Scheduling_interval, f2's one instruction runs in between here and completes - 2:integer/state <- routine-state 1:integer/child-id -] -recipe f2 [ - 12:integer <- copy 0:literal - # trying to run a second instruction marks routine as completed -] -# recipe f2 should be in state COMPLETED -+mem: storing 1 in location 2 - -:(before "End Primitive Recipe Declarations") -ROUTINE_STATE, -:(before "End Primitive Recipe Numbers") -Recipe_number["routine-state"] = ROUTINE_STATE; -:(before "End Primitive Recipe Implementations") -case ROUTINE_STATE: { - vector<long long int> result; - index_t id = read_memory(current_instruction().ingredients[0])[0]; - for (index_t i = 0; i < Routines.size(); ++i) { - if (Routines[i]->id == id) { - result.push_back(Routines[i]->state); - write_memory(current_instruction().products[0], result); - break; - } - } - break; -} diff --git a/cpp/039wait.cc b/cpp/039wait.cc deleted file mode 100644 index 940cba89..00000000 --- a/cpp/039wait.cc +++ /dev/null @@ -1,109 +0,0 @@ -//: Routines can be put in a 'waiting' state, from which it will be ready to -//: run again when a specific memory location changes its value. This is mu's -//: basic technique for orchestrating the order in which different routines -//: operate. - -:(scenario wait_for_location) -recipe f1 [ - 1:integer <- copy 0:literal - start-running f2:recipe - wait-for-location 1:integer - # now wait for f2 to run and modify location 1 before using its value - 2:integer <- copy 1:integer -] -recipe f2 [ - 1:integer <- copy 34:literal -] -# if we got the synchronization wrong we'd be storing 0 in location 2 -+mem: storing 34 in location 2 - -//: define the new state that all routines can be in - -:(before "End routine States") -WAITING, -:(before "End routine Fields") -// only if state == WAITING -index_t waiting_on_location; -int old_value_of_wating_location; -:(before "End routine Constructor") -waiting_on_location = old_value_of_wating_location = 0; - -//: primitive recipe to put routines in that state - -:(before "End Primitive Recipe Declarations") -WAIT_FOR_LOCATION, -:(before "End Primitive Recipe Numbers") -Recipe_number["wait-for-location"] = WAIT_FOR_LOCATION; -:(before "End Primitive Recipe Implementations") -case WAIT_FOR_LOCATION: { - reagent loc = canonize(current_instruction().ingredients[0]); - Current_routine->state = WAITING; - Current_routine->waiting_on_location = loc.value; - Current_routine->old_value_of_wating_location = Memory[loc.value]; - trace("run") << "waiting for location " << loc.value << " to change from " << Memory[loc.value]; - break; -} - -//: scheduler tweak to get routines out of that state - -:(before "End Scheduler State Transitions") -for (index_t i = 0; i < Routines.size(); ++i) { - if (Routines[i]->state != WAITING) continue; - if (Memory[Routines[i]->waiting_on_location] && - Memory[Routines[i]->waiting_on_location] != Routines[i]->old_value_of_wating_location) { - trace("schedule") << "waking up routine\n"; - Routines[i]->state = RUNNING; - Routines[i]->waiting_on_location = Routines[i]->old_value_of_wating_location = 0; - } -} - -//: also allow waiting on a routine - -:(scenario wait_for_routine) -recipe f1 [ - 1:integer <- copy 0:literal - 2:integer/routine <- start-running f2:recipe - wait-for-routine 2:integer/routine - # now wait for f2 to run and modify location 1 before using its value - 3:integer <- copy 1:integer -] -recipe f2 [ - 1:integer <- copy 34:literal -] -# if we got the synchronization wrong we'd be storing 0 in location 3 -+mem: storing 34 in location 3 - -:(before "End routine Fields") -// only if state == WAITING -index_t waiting_on_routine; -:(before "End routine Constructor") -waiting_on_routine = 0; - -:(before "End Primitive Recipe Declarations") -WAIT_FOR_ROUTINE, -:(before "End Primitive Recipe Numbers") -Recipe_number["wait-for-routine"] = WAIT_FOR_ROUTINE; -:(before "End Primitive Recipe Implementations") -case WAIT_FOR_ROUTINE: { - reagent loc = canonize(current_instruction().ingredients[0]); - Current_routine->state = WAITING; - Current_routine->waiting_on_routine = loc.value; - trace("run") << "waiting for routine " << loc.value; - break; -} - -:(before "End Scheduler State Transitions") -for (index_t i = 0; i < Routines.size(); ++i) { - if (Routines[i]->state != WAITING) continue; - if (!Routines[i]->waiting_on_routine) continue; - index_t id = Routines[i]->waiting_on_routine; - assert(id != i); - for (index_t j = 0; j < Routines.size(); ++j) { - if (Routines[j]->id == id && Routines[j]->state != WAITING) { - trace("schedule") << "waking up routine\n"; - Routines[i]->state = RUNNING; - Routines[i]->waiting_on_routine = 0; - } - } -} - diff --git a/cpp/040brace.cc b/cpp/040brace.cc deleted file mode 100644 index 0b3f6f1b..00000000 --- a/cpp/040brace.cc +++ /dev/null @@ -1,384 +0,0 @@ -//: Structured programming -//: -//: Our jump recipes are quite inconvenient to use, so mu provides a -//: lightweight tool called 'transform_braces' to work in a slightly more -//: convenient format with nested braces: -//: -//: { -//: some instructions -//: { -//: more instructions -//: } -//: } -//: -//: Braces are just labels, they require no special parsing. The pseudo -//: recipes 'loop' and 'break' jump to just after the enclosing '{' and '}' -//: respectively. -//: -//: Conditional and unconditional 'loop' and 'break' should give us 80% of the -//: benefits of the control-flow primitives we're used to in other languages, -//: like 'if', 'while', 'for', etc. - -:(scenarios transform) -:(scenario brace_conversion) -recipe main [ - { - break - 1:integer <- copy 0:literal - } -] -+after-brace: recipe main -+after-brace: jump 1:offset -+after-brace: copy ... - -//: one-time setup -:(after "int main") - Transform.push_back(transform_braces); - -:(code) -void transform_braces(const recipe_number r) { -//? cout << "AAA transform_braces\n"; //? 1 -//? exit(0); //? 1 - const int OPEN = 0, CLOSE = 1; - list<pair<int/*OPEN/CLOSE*/, /*step*/index_t> > braces; - for (index_t index = 0; index < Recipe[r].steps.size(); ++index) { - const instruction& inst = Recipe[r].steps[index]; - if (inst.label == "{") { - trace("brace") << r << ": push (open, " << index << ")"; - braces.push_back(pair<int,index_t>(OPEN, index)); - } - if (inst.label == "}") { - trace("brace") << "push (close, " << index << ")"; - braces.push_back(pair<int,index_t>(CLOSE, index)); - } - } - stack</*step*/index_t> open_braces; - trace("after-brace") << "recipe " << Recipe[r].name; - for (index_t index = 0; index < Recipe[r].steps.size(); ++index) { - instruction& inst = Recipe[r].steps[index]; -//? cout << "AAA " << inst.name << ": " << inst.operation << '\n'; //? 1 - if (inst.label == "{") open_braces.push(index); - else if (inst.label == "}") open_braces.pop(); - else if (inst.is_label) - ; // do nothing - else if (inst.operation == Recipe_number["loop"]) { - inst.operation = Recipe_number["jump"]; - if (inst.ingredients.size() > 0 && isa_literal(inst.ingredients[0])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[0].name << ":offset"; - } - else { - reagent ing; - ing.set_value(open_braces.top()-index); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump " << ing.value << ":offset"; - trace("after-brace") << index << ": " << ing.to_string(); - trace("after-brace") << index << ": " << Recipe[r].steps[index].ingredients[0].to_string(); - } - } - else if (inst.operation == Recipe_number["break"]) { - inst.operation = Recipe_number["jump"]; - if (inst.ingredients.size() > 0 && isa_literal(inst.ingredients[0])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[0].name << ":offset"; - } - else { - reagent ing; - ing.set_value(matching_brace(open_braces.top(), braces) - index - 1); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump " << ing.value << ":offset"; - } - } - else if (inst.operation == Recipe_number["loop-if"]) { - inst.operation = Recipe_number["jump-if"]; - if (inst.ingredients.size() > 1 && isa_literal(inst.ingredients[1])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[1].name << ":offset"; - } - else { - reagent ing; - ing.set_value(open_braces.top()-index); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump-if " << inst.ingredients[0].name << ", " << ing.value << ":offset"; - } - } - else if (inst.operation == Recipe_number["break-if"]) { - inst.operation = Recipe_number["jump-if"]; - if (inst.ingredients.size() > 1 && isa_literal(inst.ingredients[1])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[1].name << ":offset"; - } - else { - reagent ing; - ing.set_value(matching_brace(open_braces.top(), braces) - index - 1); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump-if " << inst.ingredients[0].name << ", " << ing.value << ":offset"; - } - } - else if (inst.operation == Recipe_number["loop-unless"]) { - inst.operation = Recipe_number["jump-unless"]; - if (inst.ingredients.size() > 1 && isa_literal(inst.ingredients[1])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[1].name << ":offset"; - } - else { - reagent ing; - ing.set_value(open_braces.top()-index); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump-unless " << inst.ingredients[0].name << ", " << ing.value << ":offset"; - } - } - else if (inst.operation == Recipe_number["break-unless"]) { -//? cout << "AAA break-unless\n"; //? 1 - inst.operation = Recipe_number["jump-unless"]; - if (inst.ingredients.size() > 1 && isa_literal(inst.ingredients[1])) { - // explicit target; a later phase will handle it - trace("after-brace") << "jump " << inst.ingredients[1].name << ":offset"; - } - else { - reagent ing; - ing.set_value(matching_brace(open_braces.top(), braces) - index - 1); - inst.ingredients.push_back(ing); - trace("after-brace") << "jump-unless " << inst.ingredients[0].name << ", " << ing.value << ":offset"; - } - } - else { - trace("after-brace") << inst.name << " ..."; - } - } -} - -int matching_brace(index_t index, const list<pair<int, index_t> >& braces) { - int stacksize = 0; - for (list<pair<int, index_t> >::const_iterator p = braces.begin(); p != braces.end(); ++p) { - if (p->second < index) continue; - stacksize += (p->first ? 1 : -1); - if (stacksize == 0) return p->second; - } - assert(false); - return -1; -} - -// temporarily suppress run -void transform(string form) { - load(form); - transform_all(); -} - -//: Make sure these pseudo recipes get consistent numbers in all tests, even -//: though they aren't implemented. - -:(before "End Primitive Recipe Declarations") -BREAK, -BREAK_IF, -BREAK_UNLESS, -LOOP, -LOOP_IF, -LOOP_UNLESS, -:(before "End Primitive Recipe Numbers") -Recipe_number["break"] = BREAK; -Recipe_number["break-if"] = BREAK_IF; -Recipe_number["break-unless"] = BREAK_UNLESS; -Recipe_number["loop"] = LOOP; -Recipe_number["loop-if"] = LOOP_IF; -Recipe_number["loop-unless"] = LOOP_UNLESS; - -:(scenario loop) -recipe main [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal - { - 3:integer <- copy 0:literal - loop - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... -+after-brace: copy ... -+after-brace: jump -2:offset - -:(scenario break_empty_block) -recipe main [ - 1:integer <- copy 0:literal - { - break - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: jump 0:offset - -:(scenario break_cascading) -recipe main [ - 1:integer <- copy 0:literal - { - break - } - { - break - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: jump 0:offset -+after-brace: jump 0:offset - -:(scenario break_cascading2) -recipe main [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal - { - break - 3:integer <- copy 0:literal - } - { - break - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... -+after-brace: jump 1:offset -+after-brace: copy ... -+after-brace: jump 0:offset - -:(scenario break_if) -recipe main [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal - { - break-if 2:integer - 3:integer <- copy 0:literal - } - { - break - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... -+after-brace: jump-if 2, 1:offset -+after-brace: copy ... -+after-brace: jump 0:offset - -:(scenario break_nested) -recipe main [ - 1:integer <- copy 0:literal - { - 2:integer <- copy 0:literal - break - { - 3:integer <- copy 0:literal - } - 4:integer <- copy 0:literal - } -] -+after-brace: jump 4:offset - -:(scenario break_nested_degenerate) -recipe main [ - 1:integer <- copy 0:literal - { - 2:integer <- copy 0:literal - break - { - } - 4:integer <- copy 0:literal - } -] -+after-brace: jump 3:offset - -:(scenario break_nested_degenerate2) -recipe main [ - 1:integer <- copy 0:literal - { - 2:integer <- copy 0:literal - break - { - } - } -] -+after-brace: jump 2:offset - -:(scenario break_label) -recipe main [ - 1:integer <- copy 0:literal - { - break +foo:offset - } -] -+after-brace: jump +foo:offset - -:(scenario break_unless) -recipe main [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal - { - break-unless 2:integer - 3:integer <- copy 0:literal - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... -+after-brace: jump-unless 2, 1:offset -+after-brace: copy ... - -:(scenario loop_unless) -recipe main [ - 1:integer <- copy 0:literal - 2:integer <- copy 0:literal - { - loop-unless 2:integer - 3:integer <- copy 0:literal - } -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... -+after-brace: jump-unless 2, -1:offset -+after-brace: copy ... - -:(scenario loop_nested) -recipe main [ - 1:integer <- copy 0:literal - { - 2:integer <- copy 0:literal - { - 3:integer <- copy 0:literal - } - loop-if 4:boolean - 5:integer <- copy 0:literal - } -] -+after-brace: recipe main -+after-brace: jump-if 4, -5:offset - -:(scenario loop_label) -recipe main [ - 1:integer <- copy 0:literal - +foo - 2:integer <- copy 0:literal -] -+after-brace: recipe main -+after-brace: copy ... -+after-brace: copy ... - -//: test how things actually run -:(scenarios run) -:(scenario brace_conversion_and_run) -recipe test-factorial [ - 1:integer <- copy 5:literal - 2:integer <- copy 1:literal - { - 3:boolean <- equal 1:integer 1:literal - break-if 3:boolean -# $print 1:integer - 2:integer <- multiply 2:integer, 1:integer - 1:integer <- subtract 1:integer, 1:literal - loop - } - 4:integer <- copy 2:integer # trigger a read -] -+mem: location 2 is 120 diff --git a/cpp/041name.cc b/cpp/041name.cc deleted file mode 100644 index b54a1e78..00000000 --- a/cpp/041name.cc +++ /dev/null @@ -1,204 +0,0 @@ -//: A big convenience high-level languages provide is the ability to name memory -//: locations. In mu, a transform called 'transform_names' provides this -//: convenience. - -:(scenario convert_names) -recipe main [ - x:integer <- copy 0:literal -] -+name: assign x 1 -+run: instruction main/0 -+mem: storing 0 in location 1 - -:(scenario convert_names_warns) -% Hide_warnings = true; -recipe main [ - x:integer <- copy y:integer -] -+warn: use before set: y in main - -:(after "int main") - Transform.push_back(transform_names); - -:(before "End Globals") -map<recipe_number, map<string, index_t> > Name; -:(after "Clear Other State For recently_added_recipes") -for (index_t i = 0; i < recently_added_recipes.size(); ++i) { - Name.erase(recently_added_recipes[i]); -} - -:(code) -void transform_names(const recipe_number r) { - map<string, index_t>& names = Name[r]; - // store the indices 'used' so far in the map - index_t& curr_idx = names[""]; - ++curr_idx; // avoid using index 0, benign skip in some other cases -//? cout << "Recipe " << r << ": " << Recipe[r].name << '\n'; //? 3 -//? cout << Recipe[r].steps.size() << '\n'; //? 2 - for (index_t i = 0; i < Recipe[r].steps.size(); ++i) { -//? cout << "instruction " << i << '\n'; //? 2 - instruction& inst = Recipe[r].steps[i]; - // Per-recipe Transforms - // map names to addresses - for (index_t in = 0; in < inst.ingredients.size(); ++in) { -//? cout << "ingredients\n"; //? 2 - if (is_raw(inst.ingredients[in])) continue; -//? cout << "ingredient " << inst.ingredients[in].name << '\n'; //? 3 -//? cout << "ingredient " << inst.ingredients[in].to_string() << '\n'; //? 1 - if (inst.ingredients[in].name == "default-space") - inst.ingredients[in].initialized = true; - if (inst.ingredients[in].types.empty()) - raise << "missing type in " << inst.to_string() << '\n'; - assert(!inst.ingredients[in].types.empty()); - if (inst.ingredients[in].types[0] // not a literal - && !inst.ingredients[in].initialized - && !is_number(inst.ingredients[in].name)) { - if (!already_transformed(inst.ingredients[in], names)) { - raise << "use before set: " << inst.ingredients[in].name << " in " << Recipe[r].name << '\n'; - } - inst.ingredients[in].set_value(lookup_name(inst.ingredients[in], r)); -//? cout << "lookup ingredient " << Recipe[r].name << "/" << i << ": " << inst.ingredients[in].to_string() << '\n'; //? 1 - } - } - for (index_t out = 0; out < inst.products.size(); ++out) { -//? cout << "products\n"; //? 1 - if (is_raw(inst.products[out])) continue; -//? cout << "product " << out << '/' << inst.products.size() << " " << inst.products[out].name << '\n'; //? 4 -//? cout << inst.products[out].types[0] << '\n'; //? 1 - if (inst.products[out].name == "default-space") - inst.products[out].initialized = true; - if (inst.products[out].types[0] // not a literal - && !inst.products[out].initialized - && !is_number(inst.products[out].name)) { - if (names.find(inst.products[out].name) == names.end()) { - trace("name") << "assign " << inst.products[out].name << " " << curr_idx; - names[inst.products[out].name] = curr_idx; - curr_idx += size_of(inst.products[out]); - } - inst.products[out].set_value(lookup_name(inst.products[out], r)); -//? cout << "lookup product " << Recipe[r].name << "/" << i << ": " << inst.products[out].to_string() << '\n'; //? 1 - } - } - } -} - -bool already_transformed(const reagent& r, const map<string, index_t>& names) { - return names.find(r.name) != names.end(); -} - -index_t lookup_name(const reagent& r, const recipe_number default_recipe) { - return Name[default_recipe][r.name]; -} - -type_number skip_addresses(const vector<type_number>& types) { - for (index_t i = 0; i < types.size(); ++i) { - if (types[i] != Type_number["address"]) return types[i]; - } - raise << "expected a container" << '\n' << die(); - return -1; -} - -int find_element_name(const type_number t, const string& name) { - const type_info& container = Type[t]; -//? cout << "looking for element " << name << " in type " << container.name << " with " << container.element_names.size() << " elements\n"; //? 1 - for (index_t i = 0; i < container.element_names.size(); ++i) { - if (container.element_names[i] == name) return i; - } - raise << "unknown element " << name << " in container " << t << '\n' << die(); - return -1; -} - -bool is_raw(const reagent& r) { - for (index_t i = /*skip value+type*/1; i < r.properties.size(); ++i) { - if (r.properties[i].first == "raw") return true; - } - return false; -} - -:(scenario convert_names_passes_dummy) -# _ is just a dummy result that never gets consumed -recipe main [ - _, x:integer <- copy 0:literal -] -+name: assign x 1 --name: assign _ 1 - -//: one reserved word that we'll need later -:(scenario convert_names_passes_default_space) -recipe main [ - default-space:integer, x:integer <- copy 0:literal -] -+name: assign x 1 --name: assign default-space 1 - -//: an escape hatch to suppress name conversion that we'll use later -:(scenario convert_names_passes_raw) -recipe main [ - x:integer/raw <- copy 0:literal -] --name: assign x 1 - -//:: Support element names for containers in 'get' and 'get-address'. - -//: update our running example container for the next test -:(before "End Mu Types Initialization") -Type[point].element_names.push_back("x"); -Type[point].element_names.push_back("y"); -:(scenario convert_names_transforms_container_elements) -recipe main [ - a:integer <- get 0:point, y:offset - b:integer <- get 0:point, x:offset -] -+name: element y of type point is at offset 1 -+name: element x of type point is at offset 0 - -:(after "Per-recipe Transforms") -// replace element names of containers with offsets -if (inst.operation == Recipe_number["get"] - || inst.operation == Recipe_number["get-address"]) { - // at least 2 args, and second arg is offset - assert(inst.ingredients.size() >= 2); -//? cout << inst.ingredients[1].to_string() << '\n'; //? 1 - assert(isa_literal(inst.ingredients[1])); - if (inst.ingredients[1].name.find_first_not_of("0123456789") == string::npos) continue; - // since first non-address in base type must be a container, we don't have to canonize - type_number base_type = skip_addresses(inst.ingredients[0].types); - inst.ingredients[1].set_value(find_element_name(base_type, inst.ingredients[1].name)); - trace("name") << "element " << inst.ingredients[1].name << " of type " << Type[base_type].name << " is at offset " << inst.ingredients[1].value; -} - -//: this test is actually illegal so can't call run -:(scenarios transform) -:(scenario convert_names_handles_containers) -recipe main [ - a:point <- copy 0:literal - b:integer <- copy 0:literal -] -+name: assign a 1 -+name: assign b 3 - -//:: Support variant names for exclusive containers in 'maybe-convert'. - -:(scenarios run) -:(scenario maybe_convert_named) -recipe main [ - 12:integer <- copy 1:literal - 13:integer <- copy 35:literal - 14:integer <- copy 36:literal - 20:address:point <- maybe-convert 12:integer-or-point, p:variant -] -+name: variant p of type integer-or-point has tag 1 -+mem: storing 13 in location 20 - -:(after "Per-recipe Transforms") -// convert variant names of exclusive containers -if (inst.operation == Recipe_number["maybe-convert"]) { - // at least 2 args, and second arg is offset - assert(inst.ingredients.size() >= 2); - assert(isa_literal(inst.ingredients[1])); - if (inst.ingredients[1].name.find_first_not_of("0123456789") == string::npos) continue; - // since first non-address in base type must be an exclusive container, we don't have to canonize - type_number base_type = skip_addresses(inst.ingredients[0].types); - inst.ingredients[1].set_value(find_element_name(base_type, inst.ingredients[1].name)); - trace("name") << "variant " << inst.ingredients[1].name << " of type " << Type[base_type].name << " has tag " << inst.ingredients[1].value; -} diff --git a/cpp/042new.cc b/cpp/042new.cc deleted file mode 100644 index 81a4528a..00000000 --- a/cpp/042new.cc +++ /dev/null @@ -1,157 +0,0 @@ -//: A simple memory allocator to create space for new variables at runtime. - -:(scenarios run) -:(scenario new) -# call new two times with identical arguments; you should get back different results -recipe main [ - 1:address:integer/raw <- new integer:type - 2:address:integer/raw <- new integer:type - 3:boolean/raw <- equal 1:address:integer/raw, 2:address:integer/raw -] -+mem: storing 0 in location 3 - -:(before "End Globals") -size_t Reserved_for_tests = 1000; -index_t Memory_allocated_until = Reserved_for_tests; -size_t Initial_memory_per_routine = 100000; -:(before "End Setup") -Memory_allocated_until = Reserved_for_tests; -Initial_memory_per_routine = 100000; -:(before "End routine Fields") -index_t alloc, alloc_max; -:(before "End routine Constructor") -alloc = Memory_allocated_until; -Memory_allocated_until += Initial_memory_per_routine; -alloc_max = Memory_allocated_until; -trace("new") << "routine allocated memory from " << alloc << " to " << alloc_max; - -//:: First handle 'type' operands. - -:(before "End Mu Types Initialization") -Type_number["type"] = 0; -:(after "Per-recipe Transforms") -// replace type names with type_numbers -if (inst.operation == Recipe_number["new"]) { - // first arg must be of type 'type' - assert(inst.ingredients.size() >= 1); -//? cout << inst.ingredients[0].to_string() << '\n'; //? 1 - assert(isa_literal(inst.ingredients[0])); - if (inst.ingredients[0].properties[0].second[0] == "type") { - inst.ingredients[0].set_value(Type_number[inst.ingredients[0].name]); - } - trace("new") << inst.ingredients[0].name << " -> " << inst.ingredients[0].value; -} - -//:: Now implement the primitive recipe. - -:(before "End Primitive Recipe Declarations") -NEW, -:(before "End Primitive Recipe Numbers") -Recipe_number["new"] = NEW; -:(before "End Primitive Recipe Implementations") -case NEW: { - // compute the space we need - size_t size = 0; - size_t array_length = 0; - { - vector<type_number> type; - type.push_back(current_instruction().ingredients[0].value); - if (current_instruction().ingredients.size() > 1) { - // array - vector<long long int> capacity = read_memory(current_instruction().ingredients[1]); - array_length = capacity[0]; - trace("mem") << "array size is " << array_length; - size = array_length*size_of(type) + /*space for length*/1; - } - else { - // scalar - size = size_of(type); - } - } - // compute the resulting location - // really crappy at the moment - assert(size <= Initial_memory_per_routine); - if (Current_routine->alloc + size >= Current_routine->alloc_max) { - // waste the remaining space and create a new chunk - Current_routine->alloc = Memory_allocated_until; - Memory_allocated_until += Initial_memory_per_routine; - Current_routine->alloc_max = Memory_allocated_until; - trace("new") << "routine allocated memory from " << Current_routine->alloc << " to " << Current_routine->alloc_max; - } - const index_t result = Current_routine->alloc; - trace("mem") << "new alloc: " << result; - if (current_instruction().ingredients.size() > 1) { - // initialize array - Memory[result] = array_length; - } - // write result to memory - vector<long long int> tmp; - tmp.push_back(Current_routine->alloc); - write_memory(current_instruction().products[0], tmp); - // bump - Current_routine->alloc += size; - // no support for reclaiming memory - assert(Current_routine->alloc <= Current_routine->alloc_max); - break; -} - -:(scenario new_array) -recipe main [ - 1:address:array:integer/raw <- new integer:type, 5:literal - 2:address:integer/raw <- new integer:type - 3:integer/raw <- subtract 2:address:integer/raw, 1:address:array:integer/raw -] -+run: instruction main/0 -+mem: array size is 5 -+run: instruction main/1 -+run: instruction main/2 -+mem: storing 6 in location 3 - -//: Make sure that each routine gets a different alloc to start. -:(scenario new_concurrent) -recipe f1 [ - start-running f2:recipe - 1:address:integer/raw <- new integer:type -] -recipe f2 [ - 2:address:integer/raw <- new integer:type - # hack: assumes scheduler implementation - 3:boolean/raw <- equal 1:address:integer/raw, 2:address:integer/raw -] -+mem: storing 0 in location 3 - -//: If a routine runs out of its initial allocation, it should allocate more. -:(scenario new_overflow) -% Initial_memory_per_routine = 2; -recipe main [ - 1:address:integer/raw <- new integer:type - 2:address:point/raw <- new point:type # not enough room in initial page -] -+new: routine allocated memory from 1000 to 1002 -+new: routine allocated memory from 1002 to 1004 - -//:: Next, extend 'new' to handle a string literal argument. - -:(scenario new_string) -recipe main [ - 1:address:array:character <- new [abc def] - 2:character <- index 1:address:array:character/deref, 5:literal -] -# integer code for 'e' -+mem: storing 101 in location 2 - -:(after "case NEW" following "Primitive Recipe Implementations") -if (current_instruction().ingredients[0].properties[0].second[0] == "literal-string") { - // allocate an array just large enough for it - vector<long long int> result; - result.push_back(Current_routine->alloc); - write_memory(current_instruction().products[0], result); - // assume that all characters fit in a single location -//? cout << "new string literal: " << current_instruction().ingredients[0].name << '\n'; //? 1 - Memory[Current_routine->alloc++] = current_instruction().ingredients[0].name.size(); - for (index_t i = 0; i < current_instruction().ingredients[0].name.size(); ++i) { - Memory[Current_routine->alloc++] = current_instruction().ingredients[0].name[i]; - } - // mu strings are not null-terminated in memory - break; -} diff --git a/cpp/043space.cc b/cpp/043space.cc deleted file mode 100644 index 4230468f..00000000 --- a/cpp/043space.cc +++ /dev/null @@ -1,130 +0,0 @@ -//: Spaces help isolate functions from each other. You can create them at will, -//: and all addresses in arguments are implicitly based on the 'default-space' -//: (unless they have the /raw property) - -:(scenario set_default_space) -# if default-space is 10, and if an array of 5 locals lies from location 11 to 15 (inclusive), -# then location 0 is really location 11, location 1 is really location 12, and so on. -recipe main [ - 10:integer <- copy 5:literal # pretend array; in practice we'll use new - default-space:address:array:location <- copy 10:literal - 1:integer <- copy 23:literal -] -+mem: storing 23 in location 12 - -:(scenario deref_sidesteps_default_space) -recipe main [ - # pretend pointer from outside - 3:integer <- copy 34:literal - # pretend array - 1000:integer <- copy 5:literal - # actual start of this function - default-space:address:array:location <- copy 1000:literal - 1:address:integer <- copy 3:literal - 8:integer/raw <- copy 1:address:integer/deref -] -+mem: storing 34 in location 8 - -:(before "End call Fields") -index_t default_space; -:(replace "call(recipe_number r) :running_recipe(r)") -call(recipe_number r) :running_recipe(r), running_step_index(0), next_ingredient_to_process(0), default_space(0) {} - -:(replace "reagent r = x" following "reagent canonize(reagent x)") -reagent r = absolutize(x); -:(code) -reagent absolutize(reagent x) { -//? if (Recipe_number.find("increment-counter") != Recipe_number.end()) //? 1 -//? cout << "AAA " << "increment-counter/2: " << Recipe[Recipe_number["increment-counter"]].steps[2].products[0].to_string() << '\n'; //? 1 -//? cout << "absolutize " << x.to_string() << '\n'; //? 4 -//? cout << is_raw(x) << '\n'; //? 1 - if (is_raw(x) || is_dummy(x)) return x; -//? cout << "not raw: " << x.to_string() << '\n'; //? 1 - assert(x.initialized); - reagent r = x; - r.set_value(address(r.value, space_base(r))); -//? cout << "after absolutize: " << r.value << '\n'; //? 1 - r.properties.push_back(pair<string, vector<string> >("raw", vector<string>())); - assert(is_raw(r)); - return r; -} -:(before "return result" following "reagent deref(reagent x)") -result.properties.push_back(pair<string, vector<string> >("raw", vector<string>())); - -//:: fix 'get' - -:(scenario deref_sidesteps_default_space_in_get) -recipe main [ - # pretend pointer to container from outside - 12:integer <- copy 34:literal - 13:integer <- copy 35:literal - # pretend array - 1000:integer <- copy 5:literal - # actual start of this function - default-space:address:array:location <- copy 1000:literal - 1:address:point <- copy 12:literal - 9:integer/raw <- get 1:address:point/deref, 1:offset -] -+mem: storing 35 in location 9 - -:(after "reagent tmp" following "case GET:") -tmp.properties.push_back(pair<string, vector<string> >("raw", vector<string>())); - -//:: fix 'index' - -:(scenario deref_sidesteps_default_space_in_index) -recipe main [ - # pretend pointer to array from outside - 12:integer <- copy 2:literal - 13:integer <- copy 34:literal - 14:integer <- copy 35:literal - # pretend array - 1000:integer <- copy 5:literal - # actual start of this function - default-space:address:array:location <- copy 1000:literal - 1:address:array:integer <- copy 12:literal - 9:integer/raw <- index 1:address:array:integer/deref, 1:literal -] -+mem: storing 35 in location 9 - -:(after "reagent tmp" following "case INDEX:") -tmp.properties.push_back(pair<string, vector<string> >("raw", vector<string>())); - -//:: helpers - -:(code) -index_t space_base(const reagent& x) { - return Current_routine->calls.top().default_space; -} - -index_t address(index_t offset, index_t base) { - if (base == 0) return offset; // raw -//? cout << base << '\n'; //? 2 - if (offset >= static_cast<index_t>(Memory[base])) { - // todo: test - raise << "location " << offset << " is out of bounds " << Memory[base] << '\n'; - } - return base+1 + offset; -} - -:(after "void write_memory(reagent x, vector<long long int> data)") - if (x.name == "default-space") { - assert(data.size() == 1); - Current_routine->calls.top().default_space = data[0]; -//? cout << "AAA " << Current_routine->calls.top().default_space << '\n'; //? 1 - return; - } - -:(scenario get_default_space) -recipe main [ - default-space:address:array:location <- copy 10:literal - 1:integer/raw <- copy default-space:address:array:location -] -+mem: storing 10 in location 1 - -:(after "vector<long long int> read_memory(reagent x)") - if (x.name == "default-space") { - vector<long long int> result; - result.push_back(Current_routine->calls.top().default_space); - return result; - } diff --git a/cpp/044space_surround.cc b/cpp/044space_surround.cc deleted file mode 100644 index dfa6c9ef..00000000 --- a/cpp/044space_surround.cc +++ /dev/null @@ -1,50 +0,0 @@ -//: So far you can have global variables by not setting default-space, and -//: local variables by setting default-space. You can isolate variables -//: between those extremes by creating 'surrounding' spaces. -//: -//: (Surrounding spaces are like lexical scopes in other languages.) - -:(scenario surrounding_space) -# location 1 in space 1 refers to the space surrounding the default space, here 20. -recipe main [ - 10:integer <- copy 5:literal # pretend array - 20:integer <- copy 5:literal # pretend array - default-space:address:array:location <- copy 10:literal - 0:address:array:location/names:dummy <- copy 20:literal # later layers will explain the /names: property - 1:integer <- copy 32:literal - 1:integer/space:1 <- copy 33:literal -] -+run: instruction main/3 -+mem: storing 20 in location 11 -+run: instruction main/4 -+mem: storing 32 in location 12 -+run: instruction main/5 -+mem: storing 33 in location 22 - -//: If you think of a space as a collection of variables with a common -//: lifetime, surrounding allows managing shorter lifetimes inside a longer -//: one. - -:(replace{} "index_t space_base(const reagent& x)") -index_t space_base(const reagent& x) { - return space_base(x, space_index(x), Current_routine->calls.top().default_space); -} - -index_t space_base(const reagent& x, index_t space_index, index_t base) { -//? trace("foo") << "base of space " << space_index << '\n'; //? 1 - if (space_index == 0) { -//? trace("foo") << "base of space " << space_index << " is " << base << '\n'; //? 1 - return base; - } -//? trace("foo") << "base of space " << space_index << " is " << Memory[base+1] << '\n'; //? 1 - index_t result = space_base(x, space_index-1, Memory[base+1]); - return result; -} - -index_t space_index(const reagent& x) { - for (index_t i = 0; i < x.properties.size(); ++i) { - if (x.properties[i].first == "space") - return to_int(x.properties[i].second[0]); - } - return 0; -} diff --git a/cpp/045closure_name.cc b/cpp/045closure_name.cc deleted file mode 100644 index 3f90f308..00000000 --- a/cpp/045closure_name.cc +++ /dev/null @@ -1,133 +0,0 @@ -//: Writing to a literal (not computed) address of 0 in a recipe chains two -//: spaces together. When a variable has a property of /space:1, it looks up -//: the variable in the chained/surrounding space. /space:2 looks up the -//: surrounding space of the surrounding space, etc. - -:(scenario closure) -recipe main [ - default-space:address:array:location <- new location:type, 30:literal - 1:address:array:location/names:init-counter <- init-counter -#? $print [AAAAAAAAAAAAAAAA] -#? $print 1:address:array:location - 2:integer/raw <- increment-counter 1:address:array:location/names:init-counter - 3:integer/raw <- increment-counter 1:address:array:location/names:init-counter -] - -recipe init-counter [ - default-space:address:array:location <- new location:type, 30:literal - x:integer <- copy 23:literal - y:integer <- copy 3:literal # variable that will be incremented - reply default-space:address:array:location -] - -recipe increment-counter [ - default-space:address:array:location <- new space:literal, 30:literal - 0:address:array:location/names:init-counter <- next-ingredient # outer space must be created by 'init-counter' above - y:integer/space:1 <- add y:integer/space:1, 1:literal # increment - y:integer <- copy 234:literal # dummy - reply y:integer/space:1 -] - -+name: recipe increment-counter is surrounded by init-counter -+mem: storing 5 in location 3 - -//: To make this work, compute the recipe that provides names for the -//: surrounding space of each recipe. This must happen before transform_names. - -:(before "End Globals") -map<recipe_number, recipe_number> Surrounding_space; - -:(after "int main") - Transform.push_back(collect_surrounding_spaces); - -:(code) -void collect_surrounding_spaces(const recipe_number r) { - for (index_t i = 0; i < Recipe[r].steps.size(); ++i) { - const instruction& inst = Recipe[r].steps[i]; - if (inst.is_label) continue; - for (index_t j = 0; j < inst.products.size(); ++j) { - if (isa_literal(inst.products[j])) continue; - if (inst.products[j].name != "0") continue; - if (inst.products[j].types.size() != 3 - || inst.products[j].types[0] != Type_number["address"] - || inst.products[j].types[1] != Type_number["array"] - || inst.products[j].types[2] != Type_number["location"]) { - raise << "slot 0 should always have type address:array:location, but is " << inst.products[j].to_string() << '\n'; - continue; - } - vector<string> s = property(inst.products[j], "names"); - if (s.empty()) - raise << "slot 0 requires a /names property in recipe " << Recipe[r].name << die(); - if (s.size() > 1) raise << "slot 0 should have a single value in /names, got " << inst.products[j].to_string() << '\n'; - string surrounding_recipe_name = s[0]; - if (Surrounding_space.find(r) != Surrounding_space.end() - && Surrounding_space[r] != Recipe_number[surrounding_recipe_name]) { - raise << "recipe " << Recipe[r].name << " can have only one 'surrounding' recipe but has " << Recipe[Surrounding_space[r]].name << " and " << surrounding_recipe_name << '\n'; - continue; - } - trace("name") << "recipe " << Recipe[r].name << " is surrounded by " << surrounding_recipe_name; - Surrounding_space[r] = Recipe_number[surrounding_recipe_name]; - } - } -} - -//: Once surrounding spaces are available, transform_names uses them to handle -//: /space properties. - -:(replace{} "index_t lookup_name(const reagent& r, const recipe_number default_recipe)") -index_t lookup_name(const reagent& x, const recipe_number default_recipe) { -//? cout << "AAA " << default_recipe << " " << Recipe[default_recipe].name << '\n'; //? 2 -//? cout << "AAA " << x.to_string() << '\n'; //? 1 - if (!has_property(x, "space")) { - if (Name[default_recipe].empty()) raise << "name not found: " << x.name << '\n' << die(); - return Name[default_recipe][x.name]; - } - vector<string> p = property(x, "space"); - if (p.size() != 1) raise << "/space property should have exactly one (non-negative integer) value\n"; - int n = to_int(p[0]); - assert(n >= 0); - recipe_number surrounding_recipe = lookup_surrounding_recipe(default_recipe, n); - set<recipe_number> done; - vector<recipe_number> path; - return lookup_name(x, surrounding_recipe, done, path); -} - -// If the recipe we need to lookup this name in doesn't have names done yet, -// recursively call transform_names on it. -index_t lookup_name(const reagent& x, const recipe_number r, set<recipe_number>& done, vector<recipe_number>& path) { - if (!Name[r].empty()) return Name[r][x.name]; - if (done.find(r) != done.end()) { - raise << "can't compute address of " << x.to_string() << " because "; - for (index_t i = 1; i < path.size(); ++i) { - raise << path[i-1] << " requires computing names of " << path[i] << '\n'; - } - raise << path[path.size()-1] << " requires computing names of " << r << "..ad infinitum\n" << die(); - return 0; - } - done.insert(r); - path.push_back(r); - transform_names(r); // Not passing 'done' through. Might this somehow cause an infinite loop? - assert(!Name[r].empty()); - return Name[r][x.name]; -} - -recipe_number lookup_surrounding_recipe(const recipe_number r, index_t n) { - if (n == 0) return r; - if (Surrounding_space.find(r) == Surrounding_space.end()) { - raise << "don't know surrounding recipe of " << Recipe[r].name << '\n'; - return 0; - } - assert(Surrounding_space[r]); - return lookup_surrounding_recipe(Surrounding_space[r], n-1); -} - -//: weaken use-before-set warnings just a tad -:(replace{} "bool already_transformed(const reagent& r, const map<string, index_t>& names)") -bool already_transformed(const reagent& r, const map<string, index_t>& names) { - if (has_property(r, "space")) { - vector<string> p = property(r, "space"); - assert(p.size() == 1); - if (p[0] != "0") return true; - } - return names.find(r.name) != names.end(); -} diff --git a/cpp/050scenario.cc b/cpp/050scenario.cc deleted file mode 100644 index 07279d39..00000000 --- a/cpp/050scenario.cc +++ /dev/null @@ -1,477 +0,0 @@ -//: Mu scenarios. This will get long, but these are the tests we want to -//: support in this layer. - -//: You can use variable names in scenarios, but for the most part we'll use -//: raw location numbers, because that lets us make assertions on memory. -//: Tests should avoid abstraction as far as possible. -:(scenarios run_mu_scenario) -:(scenario scenario_block) -scenario foo [ - run [ - 1:integer <- copy 13:literal - ] - memory-should-contain [ - 1 <- 13 - ] -] -# checks are inside scenario - -:(scenario scenario_multiple_blocks) -scenario foo [ - run [ - 1:integer <- copy 13:literal - ] - memory-should-contain [ - 1 <- 13 - ] - run [ - 2:integer <- copy 13:literal - ] - memory-should-contain [ - 1 <- 13 - 2 <- 13 - ] -] - -:(scenario scenario_check_memory_and_trace) -scenario foo [ - run [ - 1:integer <- copy 13:literal - trace [a], [a b c] - ] - memory-should-contain [ - 1 <- 13 - ] - trace-should-contain [ - a: a b c - ] - trace-should-not-contain [ - a: x y z - ] -] - -//:: Core data structure - -:(before "End Types") -struct scenario { - string name; - string to_run; -}; - -:(before "End Globals") -vector<scenario> Scenarios; - -//:: Parse the 'scenario' form. -//: Simply store the text of the scenario. - -:(before "End Command Handlers") -else if (command == "scenario") { - Scenarios.push_back(parse_scenario(in)); -} - -:(code) -scenario parse_scenario(istream& in) { - scenario result; - result.name = next_word(in); - skip_bracket(in, "'scenario' must begin with '['"); - ostringstream buffer; - slurp_until_matching_bracket(in, buffer); - result.to_run = buffer.str(); - return result; -} - -//:: Run scenarios when we run 'mu test'. -//: Treat the text of the scenario as a regular series of instructions. - -:(before "End Tests") -time_t mu_time; time(&mu_time); -cerr << "\nMu tests: " << ctime(&mu_time); -for (index_t i = 0; i < Scenarios.size(); ++i) { -//? cerr << Passed << '\n'; //? 1 - run_mu_scenario(Scenarios[i]); - if (Passed) cerr << "."; -} - -:(before "End Globals") -const scenario* Current_scenario = NULL; -:(code) -void run_mu_scenario(const scenario& s) { - Current_scenario = &s; - bool not_already_inside_test = !Trace_stream; - if (not_already_inside_test) { - Trace_file = s.name; - Trace_stream = new trace_stream; - setup(); - } - run("recipe "+s.name+" [ " + s.to_run + " ]"); - if (not_already_inside_test) { - teardown(); - ofstream fout((Trace_dir+Trace_file).c_str()); - fout << Trace_stream->readable_contents(""); - fout.close(); - delete Trace_stream; - Trace_stream = NULL; - Trace_file = ""; - } - Current_scenario = NULL; -} - -//:: The special instructions we want to support inside scenarios. -//: In a compiler for the mu VM these will require more work. - -//: 'run' interprets a string as a set of instructions - -:(scenarios run) -:(scenario run) -#? % Trace_stream->dump_layer = "all"; -recipe main [ - run [ - 1:integer <- copy 13:literal - ] -] -+mem: storing 13 in location 1 - -:(before "End Primitive Recipe Declarations") -RUN, -:(before "End Primitive Recipe Numbers") -Recipe_number["run"] = RUN; -:(before "End Primitive Recipe Implementations") -case RUN: { -//? cout << "recipe " << current_instruction().ingredients[0].name << '\n'; //? 1 - ostringstream tmp; - tmp << "recipe run" << Next_recipe_number << " [ " << current_instruction().ingredients[0].name << " ]"; -//? Show_rest_of_stream = true; //? 1 - vector<recipe_number> tmp_recipe = load(tmp.str()); - // Predefined Scenario Locals In Run. - // End Predefined Scenario Locals In Run. - transform_all(); -//? cout << tmp_recipe[0] << ' ' << Recipe_number["main"] << '\n'; //? 1 - Current_routine->calls.push(call(tmp_recipe[0])); - continue; // not done with caller; don't increment current_step_index() -} - -:(scenario run_multiple) -recipe main [ - run [ - 1:integer <- copy 13:literal - ] - run [ - 2:integer <- copy 13:literal - ] -] -+mem: storing 13 in location 1 -+mem: storing 13 in location 2 - -//: 'memory-should-contain' raises warnings if specific locations aren't as expected -//: Also includes some special support for checking strings. - -:(scenario memory_check) -% Hide_warnings = true; -recipe main [ - memory-should-contain [ - 1 <- 13 - ] -] -+run: checking location 1 -+warn: expected location 1 to contain 13 but saw 0 - -:(before "End Primitive Recipe Declarations") -MEMORY_SHOULD_CONTAIN, -:(before "End Primitive Recipe Numbers") -Recipe_number["memory-should-contain"] = MEMORY_SHOULD_CONTAIN; -:(before "End Primitive Recipe Implementations") -case MEMORY_SHOULD_CONTAIN: { -//? cout << current_instruction().ingredients[0].name << '\n'; //? 1 - check_memory(current_instruction().ingredients[0].name); - break; -} - -:(code) -void check_memory(const string& s) { - istringstream in(s); - in >> std::noskipws; - set<index_t> locations_checked; - while (true) { - skip_whitespace_and_comments(in); - if (in.eof()) break; - string lhs = next_word(in); - if (!is_number(lhs)) { - check_type(lhs, in); - continue; - } - int address = to_int(lhs); - skip_whitespace_and_comments(in); - string _assign; in >> _assign; assert(_assign == "<-"); - skip_whitespace_and_comments(in); - int value = 0; in >> value; - if (locations_checked.find(address) != locations_checked.end()) - raise << "duplicate expectation for location " << address << '\n'; - trace("run") << "checking location " << address; - if (Memory[address] != value) { - if (Current_scenario) - raise << "\nF - " << Current_scenario->name << ": expected location " << address << " to contain " << value << " but saw " << Memory[address] << '\n'; - else - raise << "expected location " << address << " to contain " << value << " but saw " << Memory[address] << '\n'; - Passed = false; - return; - } - locations_checked.insert(address); - } -} - -void check_type(const string& lhs, istream& in) { - reagent x(lhs); - if (x.properties[0].second[0] == "string") { - x.set_value(to_int(x.name)); - skip_whitespace_and_comments(in); - string _assign = next_word(in); - assert(_assign == "<-"); - skip_whitespace_and_comments(in); - string literal = next_word(in); - index_t address = x.value; - // exclude quoting brackets - assert(literal[0] == '['); literal.erase(0, 1); - assert(literal[literal.size()-1] == ']'); literal.erase(literal.size()-1); - check_string(address, literal); - return; - } - raise << "don't know how to check memory for " << lhs << '\n'; -} - -void check_string(index_t address, const string& literal) { - trace("run") << "checking string length at " << address; - if (Memory[address] != static_cast<signed>(literal.size())) - raise << "expected location " << address << " to contain length " << literal.size() << " of string [" << literal << "] but saw " << Memory[address] << '\n'; - ++address; // now skip length - for (index_t i = 0; i < literal.size(); ++i) { - trace("run") << "checking location " << address+i; - if (Memory[address+i] != literal[i]) - raise << "expected location " << (address+i) << " to contain " << literal[i] << " but saw " << Memory[address+i] << '\n'; - } -} - -:(scenario memory_check_multiple) -% Hide_warnings = true; -recipe main [ - memory-should-contain [ - 1 <- 0 - 1 <- 0 - ] -] -+warn: duplicate expectation for location 1 - -:(scenario memory_check_string_length) -% Hide_warnings = true; -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 97:literal # 'a' - 3:integer <- copy 98:literal # 'b' - 4:integer <- copy 99:literal # 'c' - memory-should-contain [ - 1:string <- [ab] - ] -] -+warn: expected location 1 to contain length 2 of string [ab] but saw 3 - -:(scenario memory_check_string) -recipe main [ - 1:integer <- copy 3:literal - 2:integer <- copy 97:literal # 'a' - 3:integer <- copy 98:literal # 'b' - 4:integer <- copy 99:literal # 'c' - memory-should-contain [ - 1:string <- [abc] - ] -] -+run: checking string length at 1 -+run: checking location 2 -+run: checking location 3 -+run: checking location 4 - -:(code) -//: 'trace-should-contain' is like the '+' lines in our scenarios so far -// Like runs of contiguous '+' lines, order is important. The trace checks -// that the lines are present *and* in the specified sequence. (There can be -// other lines in between.) - -:(scenario trace_check_warns_on_failure) -% Hide_warnings = true; -recipe main [ - trace-should-contain [ - a: b - a: d - ] -] -+warn: missing [b] in trace layer a - -:(before "End Primitive Recipe Declarations") -TRACE_SHOULD_CONTAIN, -:(before "End Primitive Recipe Numbers") -Recipe_number["trace-should-contain"] = TRACE_SHOULD_CONTAIN; -:(before "End Primitive Recipe Implementations") -case TRACE_SHOULD_CONTAIN: { - check_trace(current_instruction().ingredients[0].name); - break; -} - -:(code) -// simplified version of check_trace_contents() that emits warnings rather -// than just printing to stderr -bool check_trace(const string& expected) { - Trace_stream->newline(); - vector<pair<string, string> > expected_lines = parse_trace(expected); - if (expected_lines.empty()) return true; - index_t curr_expected_line = 0; - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (expected_lines[curr_expected_line].first != p->first) continue; - if (expected_lines[curr_expected_line].second != p->second.second) continue; - // match - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - } - - raise << "missing [" << expected_lines[curr_expected_line].second << "] " - << "in trace layer " << expected_lines[curr_expected_line].first << '\n'; - Passed = false; - return false; -} - -vector<pair<string, string> > parse_trace(const string& expected) { - vector<string> buf = split(expected, "\n"); - vector<pair<string, string> > result; - for (index_t i = 0; i < buf.size(); ++i) { - buf[i] = trim(buf[i]); - if (buf[i].empty()) continue; - index_t delim = buf[i].find(": "); - result.push_back(pair<string, string>(buf[i].substr(0, delim), buf[i].substr(delim+2))); - } - return result; -} - -:(scenario trace_check_warns_on_failure_in_later_line) -% Hide_warnings = true; -recipe main [ - run [ - trace [a], [b] - ] - trace-should-contain [ - a: b - a: d - ] -] -+warn: missing [d] in trace layer a - -:(scenario trace_check_passes_silently) -% Hide_warnings = true; -recipe main [ - run [ - trace [a], [b] - ] - trace-should-contain [ - a: b - ] -] --warn: missing [b] in trace layer a - -//: 'trace-should-not-contain' is like the '-' lines in our scenarios so far -//: Each trace line is separately checked for absense. Order is *not* -//: important, so you can't say things like "B should not exist after A." - -:(scenario trace_negative_check_warns_on_failure) -% Hide_warnings = true; -recipe main [ - run [ - trace [a], [b] - ] - trace-should-not-contain [ - a: b - ] -] -+warn: unexpected [b] in trace layer a - -:(before "End Primitive Recipe Declarations") -TRACE_SHOULD_NOT_CONTAIN, -:(before "End Primitive Recipe Numbers") -Recipe_number["trace-should-not-contain"] = TRACE_SHOULD_NOT_CONTAIN; -:(before "End Primitive Recipe Implementations") -case TRACE_SHOULD_NOT_CONTAIN: { - check_trace_missing(current_instruction().ingredients[0].name); - break; -} - -:(code) -// simplified version of check_trace_contents() that emits warnings rather -// than just printing to stderr -bool check_trace_missing(const string& in) { - Trace_stream->newline(); - vector<pair<string, string> > lines = parse_trace(in); - for (index_t i = 0; i < lines.size(); ++i) { - if (trace_count(lines[i].first, lines[i].second) != 0) { - raise << "unexpected [" << lines[i].second << "] in trace layer " << lines[i].first << '\n'; - Passed = false; - return false; - } - } - return true; -} - -:(scenario trace_negative_check_passes_silently) -% Hide_warnings = true; -recipe main [ - trace-should-not-contain [ - a: b - ] -] --warn: unexpected [b] in trace layer a - -:(scenario trace_negative_check_warns_on_any_unexpected_line) -% Hide_warnings = true; -recipe main [ - run [ - trace [a], [d] - ] - trace-should-not-contain [ - a: b - a: d - ] -] -+warn: unexpected [d] in trace layer a - -//:: Helpers - -:(code) -// just for the scenarios running scenarios in C++ layers -void run_mu_scenario(const string& form) { - istringstream in(form); - in >> std::noskipws; - string _scenario = next_word(in); -//? cout << _scenario << '\n'; //? 1 - assert(_scenario == "scenario"); - scenario s = parse_scenario(in); - run_mu_scenario(s); -} - -void slurp_until_matching_bracket(istream& in, ostream& out) { - int brace_depth = 1; // just scanned '[' - char c; - while (in >> c) { - if (c == '[') ++brace_depth; - if (c == ']') --brace_depth; - if (brace_depth == 0) break; // drop final ']' - out << c; - } -} - -// see tests for this function in tangle/030tangle.test.cc -string trim(const string& s) { - string::const_iterator first = s.begin(); - while (first != s.end() && isspace(*first)) - ++first; - if (first == s.end()) return ""; - - string::const_iterator last = --s.end(); - while (last != s.begin() && isspace(*last)) - --last; - ++last; - return string(first, last); -} diff --git a/cpp/051scenario_test.mu b/cpp/051scenario_test.mu deleted file mode 100644 index 5064f8a5..00000000 --- a/cpp/051scenario_test.mu +++ /dev/null @@ -1,70 +0,0 @@ -# tests for 'scenario' in previous layer - -scenario first_scenario_in_mu [ - run [ - 1:integer <- add 2:literal, 2:literal - ] - memory-should-contain [ - 1 <- 4 - ] -] - -scenario scenario_with_comment_in_mu [ - run [ - # comment - 1:integer <- add 2:literal, 2:literal - ] - memory-should-contain [ - 1 <- 4 - ] -] - -scenario scenario_with_multiple_comments_in_mu [ - run [ - # comment1 - # comment2 - 1:integer <- add 2:literal, 2:literal - ] - memory-should-contain [ - 1 <- 4 - ] -] - -scenario check_string_in_memory [ - run [ - 1:integer <- copy 3:literal - 2:character <- copy 97:literal # 'a' - 3:character <- copy 98:literal # 'b' - 4:character <- copy 99:literal # 'c' - ] - memory-should-contain [ - 1:string <- [abc] - ] -] - -scenario check_trace [ - run [ - 1:integer <- add 2:literal, 2:literal - ] - trace-should-contain [ - mem: storing 4 in location 1 - ] -] - -scenario check_trace_negative [ - run [ - 1:integer <- add 2:literal, 2:literal - ] - trace-should-not-contain [ - mem: storing 5 in location 1 - ] -] - -scenario check_trace_instruction [ - run [ - trace [foo], [aaa] - ] - trace-should-contain [ - foo: aaa - ] -] diff --git a/cpp/060string.mu b/cpp/060string.mu deleted file mode 100644 index e6705a65..00000000 --- a/cpp/060string.mu +++ /dev/null @@ -1,506 +0,0 @@ -# Some useful helpers for dealing with strings. - -recipe string-equal [ - default-space:address:array:location <- new location:type, 30:literal - a:address:array:character <- next-ingredient - a-len:integer <- length a:address:array:character/deref - b:address:array:character <- next-ingredient - b-len:integer <- length b:address:array:character/deref - # compare lengths - { - trace [string-equal], [comparing lengths] - length-equal?:boolean <- equal a-len:integer, b-len:integer - break-if length-equal?:boolean - reply 0:literal - } - # compare each corresponding character - trace [string-equal], [comparing characters] - i:integer <- copy 0:literal - { - done?:boolean <- greater-or-equal i:integer, a-len:integer - break-if done?:boolean - a2:character <- index a:address:array:character/deref, i:integer - b2:character <- index b:address:array:character/deref, i:integer - { - chars-match?:boolean <- equal a2:character, b2:character - break-if chars-match?:boolean - reply 0:literal - } - i:integer <- add i:integer, 1:literal - loop - } - reply 1:literal -] - -scenario string-equal-reflexive [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character - ] - memory-should-contain [ - 3 <- 1 # x == x for all x - ] -] - -scenario string-equal-identical [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abc] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ] - memory-should-contain [ - 3 <- 1 # abc == abc - ] -] - -scenario string-equal-distinct-lengths [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ] - memory-should-contain [ - 3 <- 0 # abc != abcd - ] - trace-should-contain [ - string-equal: comparing lengths - ] - trace-should-not-contain [ - string-equal: comparing characters - ] -] - -scenario string-equal-with-empty [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [] - y:address:array:character <- new [abcd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ] - memory-should-contain [ - 3 <- 0 # "" != abcd - ] -] - -scenario string-equal-common-lengths-but-distinct [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:array:character <- new [abc] - y:address:array:character <- new [abd] - 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character - ] - memory-should-contain [ - 3 <- 0 # abc != abd - ] -] - -# A new type to help incrementally construct strings. -container buffer [ - length:integer - data:address:array:character -] - -recipe init-buffer [ - default-space:address:array:location <- new location:type, 30:literal -#? $print default-space:address:array:location -#? $print [ -#? ] - result:address:buffer <- new buffer:type - len:address:integer <- get-address result:address:buffer/deref, length:offset - len:address:integer/deref <- copy 0:literal - s:address:address:array:character <- get-address result:address:buffer/deref, data:offset - capacity:integer <- next-ingredient - s:address:address:array:character/deref <- new character:type, capacity:integer -#? $print s:address:address:array:character/deref -#? $print [ -#? ] - reply result:address:buffer -] - -recipe grow-buffer [ - default-space:address:array:location <- new location:type, 30:literal - in:address:buffer <- next-ingredient - # double buffer size - x:address:address:array:character <- get-address in:address:buffer/deref, data:offset - oldlen:integer <- length x:address:address:array:character/deref/deref - newlen:integer <- multiply oldlen:integer, 2:literal - olddata:address:array:character <- copy x:address:address:array:character/deref - x:address:address:array:character/deref <- new character:type, newlen:integer - # copy old contents - i:integer <- copy 0:literal - { - done?:boolean <- greater-or-equal i:integer, oldlen:integer - break-if done?:boolean - src:character <- index olddata:address:array:character/deref, i:integer - dest:address:character <- index-address x:address:address:array:character/deref/deref, i:integer - dest:address:character/deref <- copy src:character - i:integer <- add i:integer, 1:literal - loop - } - reply in:address:buffer -] - -recipe buffer-full? [ - default-space:address:array:location <- new location:type, 30:literal - in:address:buffer <- next-ingredient - len:integer <- get in:address:buffer/deref, length:offset - s:address:array:character <- get in:address:buffer/deref, data:offset - capacity:integer <- length s:address:array:character/deref - result:boolean <- greater-or-equal len:integer, capacity:integer - reply result:boolean -] - -# in:address:buffer <- buffer-append in:address:buffer, c:character -recipe buffer-append [ - default-space:address:array:location <- new location:type, 30:literal - in:address:buffer <- next-ingredient - c:character <- next-ingredient - { - # grow buffer if necessary - full?:boolean <- buffer-full? in:address:buffer - break-unless full?:boolean - in:address:buffer <- grow-buffer in:address:buffer - } - len:address:integer <- get-address in:address:buffer/deref, length:offset - s:address:array:character <- get in:address:buffer/deref, data:offset - dest:address:character <- index-address s:address:array:character/deref, len:address:integer/deref - dest:address:character/deref <- copy c:character - len:address:integer/deref <- add len:address:integer/deref, 1:literal - reply in:address:buffer/same-as-ingredient:0 -] - -scenario buffer-append-works [ - run [ - default-space:address:array:location <- new location:type, 30:literal - x:address:buffer <- init-buffer 3:literal - s1:address:array:character <- get x:address:buffer/deref, data:offset - x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' - x:address:buffer <- buffer-append x:address:buffer, 98:literal # 'b' - x:address:buffer <- buffer-append x:address:buffer, 99:literal # 'c' - s2:address:array:character <- get x:address:buffer/deref, data:offset - 1:boolean/raw <- equal s1:address:array:character, s2:address:array:character -#? $print s2:address:array:character -#? $print [ -#? ] -#? $print 1060:integer/raw -#? $print [ -#? ] -#? $print 1061:integer/raw -#? $print [ -#? ] -#? $print 1062:integer/raw -#? $print [ -#? ] -#? $print 1063:integer/raw -#? $print [ -#? ] -#? $print 1064:integer/raw -#? $print [ -#? ] -#? $print 1065:integer/raw -#? $print [ -#? ] - 2:array:character/raw <- copy s2:address:array:character/deref - +buffer-filled - x:address:buffer <- buffer-append x:address:buffer, 100:literal # 'd' - s3:address:array:character <- get x:address:buffer/deref, data:offset - 10:boolean/raw <- equal s1:address:array:character, s3:address:array:character - 11:integer/raw <- get x:address:buffer/deref, length:offset - 12:array:character/raw <- copy s3:address:array:character/deref - ] - memory-should-contain [ - # before +buffer-filled - 1 <- 1 # no change in data pointer - 2 <- 3 # size of data - 3 <- 97 # data - 4 <- 98 - 5 <- 99 - # in the end - 10 <- 0 # data pointer has grown - 11 <- 4 # final length - 12 <- 6 # but data's capacity has doubled - 13 <- 97 # data - 14 <- 98 - 15 <- 99 - 16 <- 100 - 17 <- 0 - 18 <- 0 - ] -] - -# result:address:array:character <- integer-to-decimal-string n:integer -recipe integer-to-decimal-string [ - default-space:address:array:location <- new location:type, 30:literal - n:integer <- next-ingredient - # is it zero? - { - break-if n:integer - result:address:array:character <- new [0] - reply result:address:array:character - } - # save sign - negate-result:boolean <- copy 0:literal - { - negative?:boolean <- lesser-than n:integer, 0:literal - break-unless negative?:boolean - negate-result:boolean <- copy 1:literal - n:integer <- multiply n:integer, -1:literal - } - # add digits from right to left into intermediate buffer - tmp:address:buffer <- init-buffer 30:literal - digit-base:integer <- copy 48:literal # '0' - { - done?:boolean <- equal n:integer, 0:literal - break-if done?:boolean - n:integer, digit:integer <- divide-with-remainder n:integer, 10:literal - c:character <- add digit-base:integer, digit:integer - tmp:address:buffer <- buffer-append tmp:address:buffer, c:character - loop - } - # add sign - { - break-unless negate-result:boolean - tmp:address:buffer <- buffer-append tmp:address:buffer, 45:literal # '-' - } - # reverse buffer into string result - len:integer <- get tmp:address:buffer/deref, length:offset - buf:address:array:character <- get tmp:address:buffer/deref, data:offset - result:address:array:character <- new character:type, len:integer - i:integer <- subtract len:integer, 1:literal - j:integer <- copy 0:literal - { - # while i >= 0 - done?:boolean <- lesser-than i:integer, 0:literal - break-if done?:boolean - # result[j] = tmp[i] - src:character <- index buf:address:array:character/deref, i:integer - dest:address:character <- index-address result:address:array:character/deref, j:integer - dest:address:character/deref <- copy src:character - # ++i - i:integer <- subtract i:integer, 1:literal - # --j - j:integer <- add j:integer, 1:literal - loop - } - reply result:address:array:character -] - -scenario integer-to-decimal-digit-zero [ - run [ - 1:address:array:character/raw <- integer-to-decimal-string 0:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ] - memory-should-contain [ - 2:string <- [0] - ] -] - -scenario integer-to-decimal-digit-positive [ - run [ - 1:address:array:character/raw <- integer-to-decimal-string 234:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ] - memory-should-contain [ - 2:string <- [234] - ] -] - -scenario integer-to-decimal-digit-negative [ - run [ - 1:address:array:character/raw <- integer-to-decimal-string -1:literal - 2:array:character/raw <- copy 1:address:array:character/deref/raw - ] - memory-should-contain [ - 2 <- 2 - 3 <- 45 # '-' - 4 <- 49 # '1' - ] -] - -recipe string-append [ - default-space:address:array:location <- new location:type, 30:literal - # result = new string[a.length + b.length] - a:address:array:character <- next-ingredient - a-len:integer <- length a:address:array:character/deref - b:address:array:character <- next-ingredient - b-len:integer <- length b:address:array:character/deref - result-len:integer <- add a-len:integer, b-len:integer - result:address:array:character <- new character:type, result-len:integer - # copy a into result - result-idx:integer <- copy 0:literal - i:integer <- copy 0:literal - { - # while i < a.length - a-done?:boolean <- greater-or-equal i:integer, a-len:integer - break-if a-done?:boolean - # result[result-idx] = a[i] - out:address:character <- index-address result:address:array:character/deref, result-idx:integer - in:character <- index a:address:array:character/deref, i:integer - out:address:character/deref <- copy in:character - # ++i - i:integer <- add i:integer, 1:literal - # ++result-idx - result-idx:integer <- add result-idx:integer, 1:literal - loop - } - # copy b into result - i:integer <- copy 0:literal - { - # while i < b.length - b-done?:boolean <- greater-or-equal i:integer, b-len:integer - break-if b-done?:boolean - # result[result-idx] = a[i] - out:address:character <- index-address result:address:array:character/deref, result-idx:integer - in:character <- index b:address:array:character/deref, i:integer - out:address:character/deref <- copy in:character - # ++i - i:integer <- add i:integer, 1:literal - # ++result-idx - result-idx:integer <- add result-idx:integer, 1:literal - loop - } - reply result:address:array:character -] - -scenario string-append-1 [ - run [ - 1:address:array:character/raw <- new [hello,] - 2:address:array:character/raw <- new [ world!] - 3:address:array:character/raw <- string-append 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ] - memory-should-contain [ - 4:string <- [hello, world!] - ] -] - -# replace underscores in first with remaining args -# result:address:array:character <- interpolate template:address:array:character, ... -recipe interpolate [ - default-space:array:address:location <- new location:type, 60:literal - template:address:array:character <- next-ingredient - # compute result-len, space to allocate for result - tem-len:integer <- length template:address:array:character/deref - result-len:integer <- copy tem-len:integer - { - # while arg received - a:address:array:character, arg-received?:boolean <- next-ingredient - break-unless arg-received?:boolean - # result-len = result-len + arg.length - 1 for the 'underscore' being replaced - a-len:integer <- length a:address:array:character/deref - result-len:integer <- add result-len:integer, a-len:integer - result-len:integer <- subtract result-len:integer, 1:literal - loop - } -#? $print tem-len:integer #? 1 -#? $print [ ] #? 1 -#? $print result-len:integer #? 1 -#? $print [ #? 1 -#? ] #? 1 - rewind-ingredients - _ <- next-ingredient # skip template - # result = new array:character[result-len] - result:address:array:character <- new character:type, result-len:integer - # repeatedly copy sections of template and 'holes' into result - result-idx:integer <- copy 0:literal - i:integer <- copy 0:literal - { - # while arg received - a:address:array:character, arg-received?:boolean <- next-ingredient - break-unless arg-received?:boolean - # copy template into result until '_' - { - # while i < template.length - tem-done?:boolean <- greater-or-equal i:integer, tem-len:integer - break-if tem-done?:boolean, 2:blocks - # while template[i] != '_' - in:character <- index template:address:array:character/deref, i:integer - underscore?:boolean <- equal in:character, 95:literal # '_' - break-if underscore?:boolean - # result[result-idx] = template[i] - out:address:character <- index-address result:address:array:character/deref, result-idx:integer - out:address:character/deref <- copy in:character - # ++i - i:integer <- add i:integer, 1:literal - # ++result-idx - result-idx:integer <- add result-idx:integer, 1:literal - loop - } - # copy 'a' into result - j:integer <- copy 0:literal - { - # while j < a.length - arg-done?:boolean <- greater-or-equal j:integer, a-len:integer - break-if arg-done?:boolean - # result[result-idx] = a[j] - in:character <- index a:address:array:character/deref, j:integer - out:address:character <- index-address result:address:array:character/deref, result-idx:integer - out:address:character/deref <- copy in:character - # ++j - j:integer <- add j:integer, 1:literal - # ++result-idx - result-idx:integer <- add result-idx:integer, 1:literal - loop - } - # skip '_' in template - i:integer <- add i:integer, 1:literal - loop # interpolate next arg - } - # done with holes; copy rest of template directly into result - { - # while i < template.length - tem-done?:boolean <- greater-or-equal i:integer, tem-len:integer - break-if tem-done?:boolean - # result[result-idx] = template[i] - in:character <- index template:address:array:character/deref, i:integer - out:address:character <- index-address result:address:array:character/deref, result-idx:integer - out:address:character/deref <- copy in:character - # ++i - i:integer <- add i:integer, 1:literal - # ++result-idx - result-idx:integer <- add result-idx:integer, 1:literal - loop - } - reply result:address:array:character -] - -scenario interpolate-works [ -#? dump run #? 1 - run [ - 1:address:array:character/raw <- new [abc _] - 2:address:array:character/raw <- new [def] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ] - memory-should-contain [ - 4:string <- [abc def] - ] -] - -scenario interpolate-at-start [ - run [ - 1:address:array:character/raw <- new [_, hello!] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ] - memory-should-contain [ - 4:string <- [abc, hello!] - 16 <- 0 # out of bounds - ] -] - -scenario interpolate-at-end [ - run [ - 1:address:array:character/raw <- new [hello, _] - 2:address:array:character/raw <- new [abc] - 3:address:array:character/raw <- interpolate 1:address:array:character/raw, 2:address:array:character/raw - 4:array:character/raw <- copy 3:address:array:character/raw/deref - ] - memory-should-contain [ - 4:string <- [hello, abc] - ] -] diff --git a/cpp/061channel.mu b/cpp/061channel.mu deleted file mode 100644 index bee6b785..00000000 --- a/cpp/061channel.mu +++ /dev/null @@ -1,266 +0,0 @@ -# Mu synchronizes using channels rather than locks, like Erlang and Go. -# -# The two ends of a channel will usually belong to different routines, but -# each end should only be used by a single one. Don't try to read from or -# write to it from multiple routines at once. -# -# The key property of channels is that writing to a full channel or reading -# from an empty one will put the current routine in 'waiting' state until the -# operation can be completed. - -scenario channel [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer, 1:address:channel <- read 1:address:channel - ] - memory-should-contain [ - 2 <- 34 - ] -] - -container channel [ - # To avoid locking, writer and reader will never write to the same location. - # So channels will include fields in pairs, one for the writer and one for the - # reader. - first-full:integer # for write - first-free:integer # for read - # A circular buffer contains values from index first-full up to (but not - # including) index first-empty. The reader always modifies it at first-full, - # while the writer always modifies it at first-empty. - data:address:array:location -] - -# result:address:channel <- init-channel capacity:integer -recipe init-channel [ - default-space:address:array:location <- new location:type, 30:literal - # result = new channel - result:address:channel <- new channel:type - # result.first-full = 0 - full:address:integer <- get-address result:address:channel/deref, first-full:offset - full:address:integer/deref <- copy 0:literal - # result.first-free = 0 - free:address:integer <- get-address result:address:channel/deref, first-free:offset - free:address:integer/deref <- copy 0:literal - # result.data = new location[ingredient+1] - capacity:integer <- next-ingredient - capacity:integer <- add capacity:integer, 1:literal # unused slot for 'full?' below - dest:address:address:array:location <- get-address result:address:channel/deref, data:offset - dest:address:address:array:location/deref <- new location:type, capacity:integer - reply result:address:channel -] - -# chan:address:channel <- write chan:address:channel, val:location -recipe write [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - val:location <- next-ingredient - { - # block if chan is full - full:boolean <- channel-full? chan:address:channel - break-unless full:boolean - full-address:address:integer <- get-address chan:address:channel/deref, first-full:offset - wait-for-location full-address:address:integer/deref - } - # store val - circular-buffer:address:array:location <- get chan:address:channel/deref, data:offset - free:address:integer <- get-address chan:address:channel/deref, first-free:offset - dest:address:location <- index-address circular-buffer:address:array:location/deref, free:address:integer/deref - dest:address:location/deref <- copy val:location - # increment free - free:address:integer/deref <- add free:address:integer/deref, 1:literal - { - # wrap free around to 0 if necessary - len:integer <- length circular-buffer:address:array:location/deref - at-end?:boolean <- greater-or-equal free:address:integer/deref, len:integer - break-unless at-end?:boolean - free:address:integer/deref <- copy 0:literal - } - reply chan:address:channel/same-as-ingredient:0 -] - -# result:location, chan:address:channel <- read chan:address:channel -recipe read [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - { - # block if chan is empty - empty:boolean <- channel-empty? chan:address:channel - break-unless empty:boolean - free-address:address:integer <- get-address chan:address:channel/deref, first-free:offset - wait-for-location free-address:address:integer/deref - } - # read result - full:address:integer <- get-address chan:address:channel/deref, first-full:offset - circular-buffer:address:array:location <- get chan:address:channel/deref, data:offset - result:location <- index circular-buffer:address:array:location/deref, full:address:integer/deref - # increment full - full:address:integer/deref <- add full:address:integer/deref, 1:literal - { - # wrap full around to 0 if necessary - len:integer <- length circular-buffer:address:array:location/deref - at-end?:boolean <- greater-or-equal full:address:integer/deref, len:integer - break-unless at-end?:boolean - full:address:integer/deref <- copy 0:literal - } - reply result:location, chan:address:channel/same-as-ingredient:0 -] - -scenario channel-initialization [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ] - memory-should-contain [ - 2 <- 0 # first-full - 3 <- 0 # first-free - ] -] - -scenario channel-write-increments-free [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ] - memory-should-contain [ - 2 <- 0 # first-full - 3 <- 1 # first-free - ] -] - -scenario channel-read-increments-full [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- get 1:address:channel/deref, first-full:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - ] - memory-should-contain [ - 2 <- 1 # first-full - 3 <- 1 # first-free - ] -] - -scenario channel-wrap [ - run [ - # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity - # write and read a value - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - # first-free will now be 1 - 2:integer <- get 1:address:channel/deref, first-free:offset - 3:integer <- get 1:address:channel/deref, first-free:offset - # write second value, verify that first-free wraps - 1:address:channel <- write 1:address:channel, 34:literal - 4:integer <- get 1:address:channel/deref, first-free:offset - # read second value, verify that first-full wraps - _, 1:address:channel <- read 1:address:channel - 5:integer <- get 1:address:channel/deref, first-full:offset - ] - memory-should-contain [ - 2 <- 1 # first-free after first write - 3 <- 1 # first-full after first read - 4 <- 0 # first-free after second write, wrapped - 5 <- 0 # first-full after second read, wrapped - ] -] - -## helpers - -# An empty channel has first-empty and first-full both at the same value. -recipe channel-empty? [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - # return chan.first-full == chan.first-free - full:integer <- get chan:address:channel/deref, first-full:offset - free:integer <- get chan:address:channel/deref, first-free:offset - result:boolean <- equal full:integer, free:integer - reply result:boolean -] - -# A full channel has first-empty just before first-full, wasting one slot. -# (Other alternatives: https://en.wikipedia.org/wiki/Circular_buffer#Full_.2F_Empty_Buffer_Distinction) -recipe channel-full? [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - # tmp = chan.first-free + 1 - tmp:integer <- get chan:address:channel/deref, first-free:offset - tmp:integer <- add tmp:integer, 1:literal - { - # if tmp == chan.capacity, tmp = 0 - len:integer <- channel-capacity chan:address:channel - at-end?:boolean <- greater-or-equal tmp:integer, len:integer - break-unless at-end?:boolean - tmp:integer <- copy 0:literal - } - # return chan.first-full == tmp - full:integer <- get chan:address:channel/deref, first-full:offset - result:boolean <- equal full:integer, tmp:integer - reply result:boolean -] - -# result:integer <- channel-capacity chan:address:channel -recipe channel-capacity [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - q:address:array:location <- get chan:address:channel/deref, data:offset - result:integer <- length q:address:array:location/deref - reply result:integer -] - -scenario channel-new-empty-not-full [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ] - memory-should-contain [ - 2 <- 1 # empty? - 3 <- 0 # full? - ] -] - -scenario channel-write-not-empty [ - run [ - 1:address:channel <- init-channel 3:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ] - memory-should-contain [ - 2 <- 0 # empty? - 3 <- 0 # full? - ] -] - -scenario channel-write-full [ - run [ - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ] - memory-should-contain [ - 2 <- 0 # empty? - 3 <- 1 # full? - ] -] - -scenario channel-read-not-full [ - run [ - 1:address:channel <- init-channel 1:literal/capacity - 1:address:channel <- write 1:address:channel, 34:literal - _, 1:address:channel <- read 1:address:channel - 2:integer <- channel-empty? 1:address:channel - 3:integer <- channel-full? 1:address:channel - ] - memory-should-contain [ - 2 <- 1 # empty? - 3 <- 0 # full? - ] -] diff --git a/cpp/062array.mu b/cpp/062array.mu deleted file mode 100644 index 95af1412..00000000 --- a/cpp/062array.mu +++ /dev/null @@ -1,40 +0,0 @@ -scenario array-from-args [ - run [ - 1:address:array:location <- init-array 0:literal, 1:literal, 2:literal - 2:array:location <- copy 1:address:array:location/deref - ] - memory-should-contain [ - 2 <- 3 # array length - 3 <- 0 - 4 <- 1 - 5 <- 2 - ] -] - -# create an array out of a list of scalar args -recipe init-array [ - default-space:address:array:location <- new location:type, 30:literal - capacity:integer <- copy 0:literal - { - # while read curr-value - curr-value:location, exists?:boolean <- next-ingredient - break-unless exists?:boolean - capacity:integer <- add capacity:integer, 1:literal - loop - } - result:address:array:location <- new location:type, capacity:integer - rewind-ingredients - i:integer <- copy 0:literal - { - # while read curr-value - done?:boolean <- greater-or-equal i:integer, capacity:integer - break-if done?:boolean - curr-value:location, exists?:boolean <- next-ingredient - assert exists?:boolean, [error in rewinding ingredients to init-array] - tmp:address:location <- index-address result:address:array:location/deref, i:integer - tmp:address:location/deref <- copy curr-value:location - i:integer <- add i:integer, 1:literal - loop - } - reply result:address:array:location -] diff --git a/cpp/070display.cc b/cpp/070display.cc deleted file mode 100644 index aa2c31b8..00000000 --- a/cpp/070display.cc +++ /dev/null @@ -1,212 +0,0 @@ -//: Take charge of the text-mode display and keyboard. - -// uncomment to debug console programs -:(before "End Globals") -//? ofstream LOG("log.txt"); - -//:: Display management - -:(before "End Globals") -index_t Display_row = 0, Display_column = 0; - -:(before "End Primitive Recipe Declarations") -SWITCH_TO_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["switch-to-display"] = SWITCH_TO_DISPLAY; -:(before "End Primitive Recipe Implementations") -case SWITCH_TO_DISPLAY: { - tb_init(); - Display_row = Display_column = 0; - break; -} - -:(before "End Primitive Recipe Declarations") -RETURN_TO_CONSOLE, -:(before "End Primitive Recipe Numbers") -Recipe_number["return-to-console"] = RETURN_TO_CONSOLE; -:(before "End Primitive Recipe Implementations") -case RETURN_TO_CONSOLE: { - tb_shutdown(); - break; -} - -:(before "End Primitive Recipe Declarations") -CLEAR_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["clear-display"] = CLEAR_DISPLAY; -:(before "End Primitive Recipe Implementations") -case CLEAR_DISPLAY: { - tb_clear(); - Display_row = Display_column = 0; - break; -} - -:(before "End Primitive Recipe Declarations") -CLEAR_LINE_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["clear-line-on-display"] = CLEAR_LINE_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case CLEAR_LINE_ON_DISPLAY: { - size_t width = tb_width(); - for (index_t x = Display_column; x < width; ++x) { - tb_change_cell(x, Display_row, ' ', TB_WHITE, TB_DEFAULT); - } - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -PRINT_CHARACTER_TO_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["print-character-to-display"] = PRINT_CHARACTER_TO_DISPLAY; -:(before "End Primitive Recipe Implementations") -case PRINT_CHARACTER_TO_DISPLAY: { - vector<long long int> arg = read_memory(current_instruction().ingredients[0]); - int h=tb_height(), w=tb_width(); - size_t height = (h >= 0) ? h : 0; - size_t width = (w >= 0) ? w : 0; - if (arg[0] == '\n') { - if (Display_row < height) { - Display_column = 0; - ++Display_row; - tb_set_cursor(Display_column, Display_row); - tb_present(); - } - break; - } - tb_change_cell(Display_column, Display_row, arg[0], TB_WHITE, TB_DEFAULT); - if (Display_column < width) { - Display_column++; - tb_set_cursor(Display_column, Display_row); - } - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -CURSOR_POSITION_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["cursor-position-on-display"] = CURSOR_POSITION_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case CURSOR_POSITION_ON_DISPLAY: { - vector<long long int> row; - row.push_back(Display_row); - write_memory(current_instruction().products[0], row); - vector<long long int> column; - column.push_back(Display_column); - write_memory(current_instruction().products[1], column); - break; -} - -:(before "End Primitive Recipe Declarations") -MOVE_CURSOR_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["move-cursor-on-display"] = MOVE_CURSOR_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case MOVE_CURSOR_ON_DISPLAY: { - vector<long long int> row = read_memory(current_instruction().ingredients[0]); - vector<long long int> column = read_memory(current_instruction().ingredients[1]); - Display_row = row[0]; - Display_column = column[0]; - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -MOVE_CURSOR_DOWN_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["move-cursor-down-on-display"] = MOVE_CURSOR_DOWN_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case MOVE_CURSOR_DOWN_ON_DISPLAY: { - Display_row++; - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -MOVE_CURSOR_UP_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["move-cursor-up-on-display"] = MOVE_CURSOR_UP_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case MOVE_CURSOR_UP_ON_DISPLAY: { - Display_row--; - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -MOVE_CURSOR_RIGHT_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["move-cursor-right-on-display"] = MOVE_CURSOR_RIGHT_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case MOVE_CURSOR_RIGHT_ON_DISPLAY: { - Display_column++; - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -:(before "End Primitive Recipe Declarations") -MOVE_CURSOR_LEFT_ON_DISPLAY, -:(before "End Primitive Recipe Numbers") -Recipe_number["move-cursor-left-on-display"] = MOVE_CURSOR_LEFT_ON_DISPLAY; -:(before "End Primitive Recipe Implementations") -case MOVE_CURSOR_LEFT_ON_DISPLAY: { - Display_column--; - tb_set_cursor(Display_column, Display_row); - tb_present(); - break; -} - -//:: Keyboard management - -:(before "End Primitive Recipe Declarations") -WAIT_FOR_KEY_FROM_KEYBOARD, -:(before "End Primitive Recipe Numbers") -Recipe_number["wait-for-key-from-keyboard"] = WAIT_FOR_KEY_FROM_KEYBOARD; -:(before "End Primitive Recipe Implementations") -case WAIT_FOR_KEY_FROM_KEYBOARD: { -//? LOG << "AAA\n"; LOG.flush(); - struct tb_event event; - do { - tb_poll_event(&event); - } while (event.type != TB_EVENT_KEY); -//? LOG << "AAA 2\n"; LOG.flush(); - vector<long long int> result; - result.push_back(event.ch); -//? LOG << "AAA 3\n"; LOG.flush(); - if (!current_instruction().products.empty()) - write_memory(current_instruction().products[0], result); -//? LOG << "AAA 9\n"; LOG.flush(); - break; -} - -:(before "End Primitive Recipe Declarations") -READ_KEY_FROM_KEYBOARD, -:(before "End Primitive Recipe Numbers") -Recipe_number["read-key-from-keyboard"] = READ_KEY_FROM_KEYBOARD; -:(before "End Primitive Recipe Implementations") -case READ_KEY_FROM_KEYBOARD: { - struct tb_event event; - int event_type = tb_peek_event(&event, 5/*ms*/); - vector<long long int> result; - vector<long long int> found; - if (event_type != TB_EVENT_KEY) { - result.push_back(0); - found.push_back(false); - } - else { - result.push_back(event.ch); - found.push_back(true); - } - write_memory(current_instruction().products[0], result); - write_memory(current_instruction().products[1], found); - break; -} - -:(before "End Includes") -#include"termbox/termbox.h" diff --git a/cpp/071print.mu b/cpp/071print.mu deleted file mode 100644 index 2bf1df0b..00000000 --- a/cpp/071print.mu +++ /dev/null @@ -1,274 +0,0 @@ -# Wrappers around print primitives that take a 'screen' object and are thus -# easier to test. - -container screen [ - num-rows:integer - num-columns:integer - cursor-row:integer - cursor-column:integer - data:address:array:character -] - -recipe init-fake-screen [ - default-space:address:array:location <- new location:type, 30:literal/capacity - result:address:screen <- new screen:type - width:address:integer <- get-address result:address:screen/deref, num-columns:offset - width:address:integer/deref <- next-ingredient - height:address:integer <- get-address result:address:screen/deref, num-rows:offset - height:address:integer/deref <- next-ingredient - row:address:integer <- get-address result:address:screen/deref, cursor-row:offset - row:address:integer/deref <- copy 0:literal - column:address:integer <- get-address result:address:screen/deref, cursor-column:offset - column:address:integer/deref <- copy 0:literal - bufsize:integer <- multiply width:address:integer/deref, height:address:integer/deref - buf:address:address:array:character <- get-address result:address:screen/deref, data:offset - buf:address:address:array:character/deref <- new character:literal, bufsize:integer - clear-screen result:address:screen - reply result:address:screen -] - -recipe clear-screen [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists - { - break-unless x:address:screen - # clear fake screen - buf:address:array:character <- get x:address:screen/deref, data:offset - max:integer <- length buf:address:array:character/deref - i:integer <- copy 0:literal - { - done?:boolean <- greater-or-equal i:integer, max:integer - break-if done?:boolean - c:address:character <- index-address buf:address:array:character/deref, i:integer - c:address:character/deref <- copy [ ] - i:integer <- add i:integer, 1:literal - loop - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - clear-display - reply x:address:screen/same-as-ingredient:0 -] - -recipe print-character [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - c:character <- next-ingredient -#? $print x:address:character #? 1 -#? $print [ print-character #? 1 -#? ] #? 1 - { - # if x exists - break-unless x:address:screen -#? $print [print-character2 #? 1 -#? ] #? 1 - # save character in fake screen - row:address:integer <- get-address x:address:screen/deref, cursor-row:offset - column:address:integer <- get-address x:address:screen/deref, cursor-column:offset - width:integer <- get x:address:screen/deref, num-columns:offset - index:integer <- multiply row:address:integer/deref, width:integer - index:integer <- add index:integer, column:address:integer/deref - buf:address:array:character <- get x:address:screen/deref, data:offset - cursor:address:character <- index-address buf:address:array:character/deref, index:integer -#? $print cursor:address:character #? 1 -#? $print [ #? 1 -#? ] #? 1 - cursor:address:character/deref <- copy c:character # todo: newline, etc. - # increment column unless it's already all the way to the right - { - at-right?:boolean <- equal column:address:integer/deref, width:integer - break-if at-right?:boolean - column:address:integer/deref <- add column:address:integer/deref, 1:literal - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - print-character-to-display c:character - reply x:address:screen/same-as-ingredient:0 -] - -scenario print-character-at-top-left [ - run [ -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ] - memory-should-contain [ - 3 <- 6 # width*height - 4 <- 97 # 'a' - 5 <- 0 - ] -] - -recipe clear-line [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, clear line in fake screen - { - break-unless x:address:screen - n:integer <- get x:address:screen/deref, num-columns:offset - column:address:integer <- get-address x:address:screen/deref, cursor-column:offset - original-column:integer <- copy column:address:integer/deref - # space over the entire line - { - done?:boolean <- greater-or-equal column:address:integer/deref, n:integer - break-if done?:boolean - print-character x:address:screen, [ ] # implicitly updates 'column' - loop - } - # now back to where the cursor was - column:address:integer/deref <- copy original-column:integer - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - clear-line-on-display - reply x:address:screen/same-as-ingredient:0 -] - -recipe cursor-position [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, lookup cursor in fake screen - { - break-unless x:address:screen - row:integer <- get x:address:screen/deref, cursor-row:offset - column:integer <- get x:address:screen/deref, cursor-column:offset - reply row:integer, column:integer - } - row:integer, column:integer <- cursor-position-on-display - reply row:integer, column:integer -] - -recipe move-cursor [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - new-row:integer <- next-ingredient - new-column:integer <- next-ingredient - # if x exists, move cursor in fake screen - { - break-unless x:address:screen - row:address:integer <- get-address x:address:screen/deref cursor-row:offset - row:address:integer/deref <- copy new-row:integer - column:address:integer <- get-address x:address:screen/deref cursor-column:offset - column:address:integer/deref <- copy new-column:integer - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - move-cursor-on-display new-row:integer, new-column:integer - reply x:address:screen/same-as-ingredient:0 -] - -scenario clear-line-erases-printed-characters [ - run [ -#? $start-tracing #? 3 - 1:address:screen <- init-fake-screen 3:literal/width, 2:literal/height - # print a character - 1:address:screen <- print-character 1:address:screen, 97:literal # 'a' - # move cursor to start of line - 1:address:screen <- move-cursor 1:address:screen, 0:literal/row, 0:literal/column - # clear line - 1:address:screen <- clear-line 1:address:screen - 2:address:array:character <- get 1:address:screen/deref, data:offset - 3:array:character <- copy 2:address:array:character/deref - ] - # screen should be blank - memory-should-contain [ - 3 <- 6 # width*height - 4 <- 0 - 5 <- 0 - 6 <- 0 - 7 <- 0 - 8 <- 0 - 9 <- 0 - ] -] - -recipe cursor-down [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, move cursor in fake screen - { - break-unless x:address:screen - { - # if row < height - height:integer <- get x:address:screen/deref, num-rows:offset - row:address:integer <- get-address x:address:screen/deref cursor-row:offset - at-bottom?:boolean <- greater-or-equal row:address:integer/deref, height:integer - break-if at-bottom?:boolean - # row = row+1 - row:address:integer/deref <- add row:address:integer, 1:literal - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - move-cursor-down-on-display - reply x:address:screen/same-as-ingredient:0 -] - -recipe cursor-up [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, move cursor in fake screen - { - break-unless x:address:screen - { - # if row >= 0 - row:address:integer <- get-address x:address:screen/deref cursor-row:offset - at-top?:boolean <- lesser-than row:address:integer/deref, 0:literal - break-if at-top?:boolean - # row = row-1 - row:address:integer/deref <- subtract row:address:integer, 1:literal - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - move-cursor-up-on-display - reply x:address:screen/same-as-ingredient:0 -] - -recipe cursor-right [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, move cursor in fake screen - { - break-unless x:address:screen - { - # if column < width - width:integer <- get x:address:screen/deref, num-columns:offset - column:address:integer <- get-address x:address:screen/deref cursor-column:offset - at-bottom?:boolean <- greater-or-equal column:address:integer/deref, width:integer - break-if at-bottom?:boolean - # column = column+1 - column:address:integer/deref <- add column:address:integer, 1:literal - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - move-cursor-right-on-display - reply x:address:screen/same-as-ingredient:0 -] - -recipe cursor-left [ - default-space:address:array:location <- new location:type, 30:literal - x:address:screen <- next-ingredient - # if x exists, move cursor in fake screen - { - break-unless x:address:screen - { - # if column >= 0 - column:address:integer <- get-address x:address:screen/deref cursor-column:offset - at-top?:boolean <- lesser-than column:address:integer/deref, 0:literal - break-if at-top?:boolean - # column = column-1 - column:address:integer/deref <- subtract column:address:integer, 1:literal - } - reply x:address:screen/same-as-ingredient:0 - } - # otherwise, real screen - move-cursor-left-on-display - reply x:address:screen/same-as-ingredient:0 -] diff --git a/cpp/072scenario_screen.cc b/cpp/072scenario_screen.cc deleted file mode 100644 index 43266e78..00000000 --- a/cpp/072scenario_screen.cc +++ /dev/null @@ -1,128 +0,0 @@ -//: Clean syntax to manipulate and check the screen in scenarios. -//: Instructions 'assume-screen' and 'screen-should-contain' implicitly create -//: a variable called 'screen' that is accessible inside other 'run' -//: instructions in the scenario. - -:(scenarios run_mu_scenario) -:(scenario screen_in_scenario) -scenario screen-in-scenario [ -#? $start-tracing - assume-screen 5:literal/width, 3:literal/height - run [ - screen:address <- print-character screen:address, 97:literal # 'a' - ] - screen-should-contain [ - # 01234 - .a . - . . - . . - ] -#? $exit -] - -:(scenario screen_in_scenario_error) -#? % cerr << "AAA\n"; -% Hide_warnings = true; -scenario screen-in-scenario-error [ - assume-screen 5:literal/width, 3:literal/height - run [ - screen:address <- print-character screen:address, 97:literal # 'a' - ] - screen-should-contain [ - # 01234 - .b . - . . - . . - ] -] -+warn: expected screen location (0, 0) to contain 'b' instead of 'a' - -:(before "End Globals") -// Scenarios may not define default-space, so they should fit within the -// initial area of memory reserved for tests. We'll put the predefined -// variables available to them at the end of that region. -const size_t Max_variables_in_scenarios = Reserved_for_tests-100; -size_t Next_predefined_global_for_scenarios = Max_variables_in_scenarios; -:(before "End Setup") -assert(Next_predefined_global_for_scenarios < Reserved_for_tests); -:(after "transform_all()" following "case RUN:") -// There's a restriction on the number of variables 'run' can use, so that -// it can avoid colliding with the dynamic allocator in case it doesn't -// initialize a default-space. -assert(Name[tmp_recipe[0]][""] < Max_variables_in_scenarios); - -:(before "End Globals") -// Scenario Globals. -const size_t SCREEN = Next_predefined_global_for_scenarios++; -// End Scenario Globals. -:(before "End Predefined Scenario Locals In Run") -Name[tmp_recipe[0]]["screen"] = SCREEN; - -:(before "End Rewrite Instruction(curr)") -// rewrite `assume-screen width, height` to -// `screen:address <- init-fake-screen width, height` -//? cout << "before: " << curr.to_string() << '\n'; //? 1 -if (curr.name == "assume-screen") { - curr.operation = Recipe_number["init-fake-screen"]; - assert(curr.products.empty()); - curr.products.push_back(reagent("screen:address")); - curr.products[0].set_value(SCREEN); -//? cout << "after: " << curr.to_string() << '\n'; //? 1 -//? cout << "AAA " << Recipe_number["init-fake-screen"] << '\n'; //? 1 -} - -//: screen-should-contain is a regular instruction -:(before "End Primitive Recipe Declarations") -SCREEN_SHOULD_CONTAIN, -:(before "End Primitive Recipe Numbers") -Recipe_number["screen-should-contain"] = SCREEN_SHOULD_CONTAIN; -:(before "End Primitive Recipe Implementations") -case SCREEN_SHOULD_CONTAIN: { -//? cout << "AAA\n"; //? 1 - check_screen(current_instruction().ingredients[0].name); - break; -} - -:(code) -void check_screen(const string& contents) { - assert(!Current_routine->calls.top().default_space); // not supported - index_t screen_location = Memory[SCREEN]; - int data_offset = find_element_name(Type_number["screen"], "data"); - assert(data_offset >= 0); - index_t screen_data_location = screen_location+data_offset; // type: address:array:character - index_t screen_data_start = Memory[screen_data_location]; // type: array:character - int width_offset = find_element_name(Type_number["screen"], "num-columns"); - size_t screen_width = Memory[screen_location+width_offset]; - int height_offset = find_element_name(Type_number["screen"], "num-rows"); - size_t screen_height = Memory[screen_location+height_offset]; - string expected_contents; - istringstream in(contents); - in >> std::noskipws; - for (index_t row = 0; row < screen_height; ++row) { - skip_whitespace_and_comments(in); - assert(!in.eof()); - assert(in.get() == '.'); - for (index_t column = 0; column < screen_width; ++column) { - assert(!in.eof()); - expected_contents += in.get(); - } - assert(in.get() == '.'); - } - skip_whitespace_and_comments(in); -//? assert(in.get() == ']'); - trace("run") << "checking screen size at " << screen_data_start; -//? cout << expected_contents.size() << '\n'; //? 1 - if (Memory[screen_data_start] > static_cast<signed>(expected_contents.size())) - raise << "expected contents are larger than screen size " << Memory[screen_data_start] << '\n'; - ++screen_data_start; // now skip length - for (index_t i = 0; i < expected_contents.size(); ++i) { - trace("run") << "checking location " << screen_data_start+i; - if ((!Memory[screen_data_start+i] && !isspace(expected_contents[i])) // uninitialized memory => spaces - || (Memory[screen_data_start+i] && Memory[screen_data_start+i] != expected_contents[i])) { -//? cerr << "CCC " << Trace_stream << " " << Hide_warnings << '\n'; //? 1 - raise << "expected screen location (" << i/screen_width << ", " << i%screen_width << ") to contain '" << expected_contents[i] << "' instead of '" << static_cast<char>(Memory[screen_data_start+i]) << "'\n"; - Passed = false; - return; - } - } -} diff --git a/cpp/073scenario_screen_test.mu b/cpp/073scenario_screen_test.mu deleted file mode 100644 index fa1a026c..00000000 --- a/cpp/073scenario_screen_test.mu +++ /dev/null @@ -1,29 +0,0 @@ -# To check our support for screens in scenarios, rewrite tests from print.mu - -scenario print-character-at-top-left2 [ - assume-screen 3:literal/width, 2:literal/height - run [ - screen:address <- print-character screen:address, 97:literal # 'a' - ] - screen-should-contain [ - .a . - . . - ] -] - -scenario clear-line-erases-printed-characters2 [ - assume-screen 5:literal/width, 3:literal/height - run [ - # print a character - screen:address <- print-character screen:address, 97:literal # 'a' - # move cursor to start of line - screen:address <- move-cursor screen:address, 0:literal/row, 0:literal/column - # clear line - screen:address <- clear-line screen:address - ] - screen-should-contain [ - . . - . . - . . - ] -] diff --git a/cpp/074keyboard.mu b/cpp/074keyboard.mu deleted file mode 100644 index 9cea3d1f..00000000 --- a/cpp/074keyboard.mu +++ /dev/null @@ -1,53 +0,0 @@ -# Wrappers around keyboard primitives that take a 'keyboard' object and are thus -# easier to test. - -container keyboard [ # can't think of another word like screen/display, so real and fake keyboards use the same name - index:integer - data:address:array:character -] - -recipe init-fake-keyboard [ - default-space:address:array:location <- new location:type, 30:literal - result:address:keyboard <- new keyboard:type - buf:address:address:array:character <- get-address result:address:keyboard/deref data:offset -#? $start-tracing #? 1 - buf:address:address:array:character/deref <- next-ingredient -#? $stop-tracing #? 1 - idx:address:integer <- get-address result:address:keyboard/deref index:offset - idx:address:integer/deref <- copy 0:literal - reply result:address:keyboard -] - -recipe read-key [ - default-space:address:array:location <- new location:type, 30:literal - x:address:keyboard <- next-ingredient - { - break-unless x:address:keyboard - idx:address:integer <- get-address x:address:keyboard/deref, index:offset - buf:address:array:character <- get x:address:keyboard/deref, data:offset - max:integer <- length buf:address:array:character/deref - { - done?:boolean <- greater-or-equal idx:address:integer/deref, max:integer - break-unless done?:boolean - reply 0:literal, 0:literal/done, x:address:keyboard/same-as-ingredient:0 - } - c:character <- index buf:address:array:character/deref, idx:address:integer/deref - idx:address:integer/deref <- add idx:address:integer/deref, 1:literal - reply c:character, 1:literal/found, x:address:keyboard/same-as-ingredient:0 - } - c:character, found?:boolean <- read-key-from-keyboard - reply c:character, found?:boolean, x:address:keyboard/same-as-ingredient:0 -] - -recipe wait-for-key [ - default-space:address:array:location <- new location:type, 30:literal - x:address:keyboard <- next-ingredient - { - break-unless x:address:keyboard - # on fake keyboards 'wait-for-key' behaves just like 'read-key' - c:character, x:address:keyboard <- read-key x:address:keyboard - reply c:character, x:address:keyboard/same-as-ingredient:0 - } - c:character <- wait-for-key-from-keyboard - reply c:character, x:address:keyboard/same-as-ingredient:0 -] diff --git a/cpp/075scenario_keyboard.cc b/cpp/075scenario_keyboard.cc deleted file mode 100644 index d14e4de7..00000000 --- a/cpp/075scenario_keyboard.cc +++ /dev/null @@ -1,55 +0,0 @@ -//: Clean syntax to manipulate and check the keyboard in scenarios. -//: Instruction 'assume-keyboard' implicitly creates a variable called -//: 'keyboard' that is accessible inside other 'run' instructions in the -//: scenario. - -:(scenarios run_mu_scenario) -:(scenario keyboard_in_scenario) -scenario keyboard-in-scenario [ - assume-keyboard [abc] - run [ - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ] - memory-should-contain [ - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ] -] - -:(before "End Scenario Globals") -const size_t KEYBOARD = Next_predefined_global_for_scenarios++; -:(before "End Predefined Scenario Locals In Run") -Name[tmp_recipe[0]]["keyboard"] = KEYBOARD; - -:(before "End Rewrite Instruction(curr)") -// rewrite `assume-keyboard string` to -// ``` -// keyboard:address <- new string # hacky reuse of location -// keyboard:address <- init-fake-keyboard keyboard:address -// ``` -if (curr.name == "assume-keyboard") { - // insert first instruction - curr.operation = Recipe_number["new"]; - assert(curr.products.empty()); - curr.products.push_back(reagent("keyboard:address")); - curr.products[0].set_value(KEYBOARD); - Recipe[r].steps.push_back(curr); // hacky that "Rewrite Instruction" is converting to multiple instructions - // leave second instruction in curr - curr.clear(); - curr.operation = Recipe_number["init-fake-keyboard"]; - assert(curr.ingredients.empty()); - curr.ingredients.push_back(reagent("keyboard:address")); - curr.ingredients[0].set_value(KEYBOARD); - assert(curr.products.empty()); - curr.products.push_back(reagent("keyboard:address")); - curr.products[0].set_value(KEYBOARD); -} diff --git a/cpp/076scenario_keyboard_test.mu b/cpp/076scenario_keyboard_test.mu deleted file mode 100644 index 67a965b1..00000000 --- a/cpp/076scenario_keyboard_test.mu +++ /dev/null @@ -1,23 +0,0 @@ -# To check our support for keyboards in scenarios, rewrite tests from -# scenario_keyboard.mu -# Tests for keyboard interface. - -scenario read-key-in-mu [ - assume-keyboard [abc] - run [ - 1:character, 2:boolean, keyboard:address <- read-key keyboard:address - 3:character, 4:boolean, keyboard:address <- read-key keyboard:address - 5:character, 6:boolean, keyboard:address <- read-key keyboard:address - 7:character, 8:boolean, keyboard:address <- read-key keyboard:address - ] - memory-should-contain [ - 1 <- 97 # 'a' - 2 <- 1 # first read-key call found a character - 3 <- 98 # 'b' - 4 <- 1 # second read-key call found a character - 5 <- 99 # 'c' - 6 <- 1 # third read-key call found a character - 7 <- 0 - 8 <- 0 # fourth read-key call didn't find a character - ] -] diff --git a/cpp/999spaces.cc b/cpp/999spaces.cc deleted file mode 100644 index 6f348073..00000000 --- a/cpp/999spaces.cc +++ /dev/null @@ -1,21 +0,0 @@ -//: Since different layers all carve out different parts of various namespaces -//: (recipes, memory, etc.) for their own use, there's no previous place where -//: we can lay out the big picture of what uses what. So we'll do that here -//: and just have to manually remember to update it when we move boundaries -//: around. -//: -//:: Memory -//: -//: Location 0 - unused (since it can help uncover bugs) -//: Locations 1-899 - reserved for tests -//: Locations 900-999 - reserved for predefined globals in mu scenarios, like keyboard, screen, etc. -:(before "End Setup") -assert(Max_variables_in_scenarios == 900); -//: Locations 1000 ('Reserved_for_tests') onward - available to the allocator in chunks of size Initial_memory_per_routine. -assert(Reserved_for_tests == 1000); - -//:: Recipes -//: -//: 0 - unused (IDLE; do nothing) -//: 1-999 - all fixed code -//: 1000 onwards - reserved for tests, cleared between tests diff --git a/cpp/build_and_test_until b/cpp/build_and_test_until deleted file mode 100755 index 916e93e8..00000000 --- a/cpp/build_and_test_until +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Load all files sorting before the given argument. -# You can pass in a prefix, but files matching the prefix *won't* be included. - -set -e -set -v -make tangle/tangle -make enumerate/enumerate -./tangle/tangle $(./enumerate/enumerate --until $* |grep -v '.mu$') |grep -v "^\s*//:" > mu.cc -cat /dev/null $(./enumerate/enumerate --until $* |grep '.mu$') > core.mu -make valgrind diff --git a/cpp/channel.mu b/cpp/channel.mu deleted file mode 100644 index c20fa804..00000000 --- a/cpp/channel.mu +++ /dev/null @@ -1,43 +0,0 @@ -recipe producer [ - # produce numbers 1 to 5 on a channel - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - # n = 0 - n:integer <- copy 0:literal - { - done?:boolean <- lesser-than n:integer, 5:literal - break-unless done?:boolean - # other threads might get between these prints - $print [produce: ] - $print n:integer - $print [ -] - chan:address:channel <- write chan:address:channel, n:integer - n:integer <- add n:integer, 1:literal - loop - } -] - -recipe consumer [ - # consume and print integers from a channel - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- next-ingredient - { - # read an integer from the channel - n:integer, chan:address:channel <- read chan:address:channel - # other threads might get between these prints - $print [consume: ] - $print n:integer - $print [ -] - loop - } -] - -recipe main [ - default-space:address:array:location <- new location:type, 30:literal - chan:address:channel <- init-channel 3:literal - # create two background 'routines' that communicate by a channel - routine1:integer <- start-running consumer:recipe, chan:address:channel - routine2:integer <- start-running producer:recipe, chan:address:channel -] diff --git a/cpp/counters.mu b/cpp/counters.mu deleted file mode 100644 index 4662b833..00000000 --- a/cpp/counters.mu +++ /dev/null @@ -1,35 +0,0 @@ -# example program: maintain multiple counters with isolated lexical scopes -# (spaces) - -recipe init-counter [ - default-space:address:array:location <- new location:type, 30:literal - n:integer <- next-ingredient - reply default-space:address:space -] - -recipe increment-counter [ - default-space:address:array:location <- new location:type, 30:literal - 0:address:array:location/names:init-counter <- next-ingredient # setup outer space; it *must* come from 'init-counter' - x:integer <- next-ingredient - n:integer/space:1 <- add n:integer/space:1, x:integer - reply n:integer/space:1 -] - -recipe main [ - default-space:address:array:location <- new location:type, 30:literal - # counter A - a:address:space <- init-counter 34:literal - # counter B - b:address:space <- init-counter 23:literal - # increment both by 2 but in different ways - increment-counter a:address:space, 1:literal - bres:integer <- increment-counter b:address:space, 2:literal - ares:integer <- increment-counter a:address:space, 1:literal - # check results - $print [Contents of counters a: ] - $print ares:integer - $print [ b: ] - $print bres:integer - $print [ -] -] diff --git a/cpp/display.mu b/cpp/display.mu deleted file mode 100644 index 5d2cb17d..00000000 --- a/cpp/display.mu +++ /dev/null @@ -1,23 +0,0 @@ -# example of raw primitives operating on display -recipe main [ - switch-to-display - print-character-to-display 97:literal - 1:integer/raw, 2:integer/raw <- cursor-position-on-display - wait-for-key-from-keyboard - clear-display - move-cursor-on-display 0:literal, 4:literal - print-character-to-display 98:literal - wait-for-key-from-keyboard - move-cursor-on-display 0:literal, 0:literal - clear-line-on-display - wait-for-key-from-keyboard - move-cursor-down-on-display - wait-for-key-from-keyboard - move-cursor-right-on-display - wait-for-key-from-keyboard - move-cursor-left-on-display - wait-for-key-from-keyboard - move-cursor-up-on-display - wait-for-key-from-keyboard - return-to-console -] diff --git a/cpp/enumerate/enumerate.cc b/cpp/enumerate/enumerate.cc deleted file mode 100644 index 02349213..00000000 --- a/cpp/enumerate/enumerate.cc +++ /dev/null @@ -1,35 +0,0 @@ -#include<cstdlib> -#include<dirent.h> -#include<vector> -using std::vector; -#include<string> -using std::string; -#include<iostream> -using std::cout; - -int enumerate_files_in_cwd_until(string last_file); -string flag_value(const string& flag, int argc, const char* argv[]); - -int main(int argc, const char* argv[]) { - return enumerate_files_in_cwd_until(flag_value("--until", argc, argv)); -} - -int enumerate_files_in_cwd_until(string last_file) { - dirent** files; - int num_files = scandir(".", &files, NULL, alphasort); - for (int i = 0; i < num_files; ++i) { - string curr_file = files[i]->d_name; - if (!isdigit(curr_file[0])) continue; - if (!last_file.empty() && curr_file > last_file) break; - cout << curr_file << '\n'; - } - // don't bother freeing files - return 0; -} - -string flag_value(const string& flag, int argc, const char* argv[]) { - for (int i = 1; i < argc-1; ++i) - if (string(argv[i]) == flag) - return argv[i+1]; - return ""; -} diff --git a/cpp/enumerate/makefile b/cpp/enumerate/makefile deleted file mode 100644 index f2d0e460..00000000 --- a/cpp/enumerate/makefile +++ /dev/null @@ -1,5 +0,0 @@ -tangle: makefile - g++ -O3 -Wall -Wextra -fno-strict-aliasing enumerate.cc -o enumerate - -clean: - -rm enumerate diff --git a/cpp/factorial.mu b/cpp/factorial.mu deleted file mode 100644 index 0921a7e9..00000000 --- a/cpp/factorial.mu +++ /dev/null @@ -1,35 +0,0 @@ -# example program: compute the factorial of 7 - -recipe main [ - default-space:address:space <- new location:type, 30:literal - x:integer <- factorial 7:literal - $print x:integer - $print [ -] -] - -recipe factorial [ - default-space:address:array:location <- new location:type, 30:literal - n:integer <- next-ingredient - { - # if n=0 return 1 - zero?:boolean <- equal n:integer, 0:literal - break-unless zero?:boolean - reply 1:literal - } - # return n * factorial(n - 1) - x:integer <- subtract n:integer, 1:literal - subresult:integer <- factorial x:integer - result:integer <- multiply subresult:integer, n:integer - reply result:integer -] - -# unit test -scenario factorial-test [ - run [ - 1:integer <- factorial 5:literal - ] - memory should contain [ - 1 <- 120 - ] -] diff --git a/cpp/keyboard.mu b/cpp/keyboard.mu deleted file mode 100644 index d6f728f6..00000000 --- a/cpp/keyboard.mu +++ /dev/null @@ -1,14 +0,0 @@ -# example reading keys from keyboard -# -# Keeps printing 'a' until you press a key. Then prints the key you pressed -# and exits. -recipe main [ - switch-to-display - { - c:character, found?:boolean <- read-key-from-keyboard - break-if found?:boolean - print-character-to-display 97:literal - loop - } - return-to-console -] diff --git a/cpp/makefile b/cpp/makefile deleted file mode 100644 index 9ef7c92c..00000000 --- a/cpp/makefile +++ /dev/null @@ -1,52 +0,0 @@ -mu: makefile enumerate/enumerate tangle/tangle mu.cc termbox/libtermbox.a - @make autogenerated_lists >/dev/null - g++ -g -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu - -# To see what the program looks like after all layers have been applied, read -# mu.cc -mu.cc: 0* - ./tangle/tangle $$(./enumerate/enumerate --until 9999 |grep -v '.mu$$') > mu.cc - cat $$(./enumerate/enumerate --until 9999 |grep '.mu$$') > core.mu - -enumerate/enumerate: - cd enumerate && make && ./enumerate test - -tangle/tangle: - cd tangle && make && ./tangle test - -termbox/libtermbox.a: - cd termbox && make - -.PHONY: autogenerated_lists test valgrind clena - -test: mu - ./mu test - -valgrind: mu - valgrind --leak-check=yes -q --error-exitcode=1 ./mu test - -# auto-generated files; by convention they end in '_list'. -autogenerated_lists: mu.cc function_list test_list - -# autogenerated list of function declarations, so I can define them in any order -function_list: mu.cc - # functions start out unindented, have all args on the same line, and end in ') {' - # ignore methods - @grep -h "^[^[:space:]#].*) {" mu.cc |grep -v ":.*(" |perl -pwe 's/ {.*/;/' > function_list - # occasionally we need to modify a declaration in a later layer without messing with ugly unbalanced brackets - # assume such functions move the '{' to column 0 of the very next line - @grep -v "^#line" mu.cc |grep -B1 "^{" |grep -v "^{" |perl -pwe 's/$$/;/' >> function_list - # test functions - @grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/void test_$$1();/' >> function_list - -# autogenerated list of tests to run -test_list: mu.cc - @grep -h "^\s*void test_" mu.cc |perl -pwe 's/^\s*void (.*)\(\) {.*/$$1,/' > test_list - @grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/test_$$1,/' >> test_list - -clena: clean -clean: - cd enumerate && make clean - cd tangle && make clean - cd termbox && make clean - -rm mu.cc core.mu mu *_list diff --git a/cpp/relayout b/cpp/relayout deleted file mode 100755 index e5f9a164..00000000 --- a/cpp/relayout +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env zsh -# Helper to change the numerical prefixes across the repo, say if you want to -# create room between 023 and 024, and so on. -# -# Assumes there's only ever one file with any numeric prefix. If you move -# 003trace.tests you might need to do some manual patch-up. - -setopt extendedglob - -if [[ $# -eq 0 && `git diff HEAD |wc -l` -gt 0 ]] -then - echo "Uncommitted changes" - exit -fi - -if [[ $# -gt 0 ]] # dry run -then - git() { - echo $* - } -fi - -# - -index=0 -ls [0-9]* |grep -v "trace.test" |sort -n | - while read file - do - echo $file >&2 - while [[ $file != `printf "%03d" $index`* ]] - do - echo - index=$(($index+1)) - done - echo $file - index=$(($index+1)) - done > .layout - -vim -c "set nu" .layout - -# - -root() { - echo $1 |perl -pwe 's/^[0-9]*//' -} - -index=0 -cat .layout | - while read file - do - if [ ! -z $file ] - then - newfile=`printf "%03d" $index``root $file` - if [[ $newfile != $file ]] - then - git mv $file $newfile - fi - fi - index=$(($index+1)) - done - -# - -rm .layout diff --git a/cpp/screen.mu b/cpp/screen.mu deleted file mode 100644 index fc971e11..00000000 --- a/cpp/screen.mu +++ /dev/null @@ -1,23 +0,0 @@ -# example of recipes for working with screen objects -recipe main [ - switch-to-display - print-character 0:literal/screen, 97:literal - 1:integer/raw, 2:integer/raw <- cursor-position 0:literal/screen - wait-for-key 0:literal/keyboard - clear-screen 0:literal/screen - move-cursor 0:literal/screen, 0:literal/row, 4:literal/column - print-character 0:literal/screen, 98:literal - wait-for-key 0:literal/keyboard - move-cursor 0:literal/screen, 0:literal/row, 0:literal/column - clear-line 0:literal/screen - wait-for-key 0:literal/keyboard - cursor-down 0:literal/screen - wait-for-key 0:literal/keyboard - cursor-right 0:literal/screen - wait-for-key 0:literal/keyboard - cursor-left 0:literal/screen - wait-for-key 0:literal/keyboard - cursor-up 0:literal/screen - wait-for-key 0:literal/keyboard - return-to-console -] diff --git a/cpp/tangle/000test.cc b/cpp/tangle/000test.cc deleted file mode 100644 index 2754b254..00000000 --- a/cpp/tangle/000test.cc +++ /dev/null @@ -1,26 +0,0 @@ -typedef void (*test_fn)(void); - -const test_fn Tests[] = { - #include "test_list" // auto-generated; see makefile -}; - -bool Passed = true; - -long Num_failures = 0; - -#define CHECK(X) \ - if (!(X)) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \ - Passed = false; \ - return; \ - } - -#define CHECK_EQ(X, Y) \ - if ((X) != (Y)) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \ - cerr << " got " << (X) << '\n'; /* BEWARE: multiple eval */ \ - Passed = false; \ - return; \ - } diff --git a/cpp/tangle/001trace.cc b/cpp/tangle/001trace.cc deleted file mode 100644 index a02cacd4..00000000 --- a/cpp/tangle/001trace.cc +++ /dev/null @@ -1,340 +0,0 @@ -bool Hide_warnings = false; - -struct trace_stream { - vector<pair<string, pair<int, string> > > past_lines; // [(layer label, frame, line)] - map<string, int> frame; - // accumulator for current line - ostringstream* curr_stream; - string curr_layer; - string dump_layer; - trace_stream() :curr_stream(NULL) {} - ~trace_stream() { if (curr_stream) delete curr_stream; } - - ostringstream& stream(string layer) { - newline(); - curr_stream = new ostringstream; - curr_layer = layer; - return *curr_stream; - } - - // be sure to call this before messing with curr_stream or curr_layer or frame - void newline() { - if (!curr_stream) return; - string curr_contents = curr_stream->str(); - curr_contents.erase(curr_contents.find_last_not_of("\r\n")+1); - past_lines.push_back(pair<string, pair<int, string> >(curr_layer, pair<int, string>(frame[curr_layer], curr_contents))); - if (curr_layer == "dump") - cerr << with_newline(curr_stream->str()); - else if ((!dump_layer.empty() && prefix_match(dump_layer, curr_layer)) - || (!Hide_warnings && curr_layer == "warn")) - cerr << curr_layer << "/" << frame[curr_layer] << ": " << with_newline(curr_stream->str()); - delete curr_stream; - curr_stream = NULL; - } - - string readable_contents(string layer) { // missing layer = everything, frame, hierarchical layers - newline(); - ostringstream output; - string real_layer, frame; - parse_layer_and_frame(layer, &real_layer, &frame); - for (vector<pair<string, pair<int, string> > >::iterator p = past_lines.begin(); p != past_lines.end(); ++p) - if (layer.empty() || prefix_match(real_layer, p->first)) - output << p->first << "/" << p->second.first << ": " << with_newline(p->second.second); - return output.str(); - } - - void dump_browseable_contents(string layer) { - ofstream dump("dump"); - dump << "<div class='frame' frame_index='1'>start</div>\n"; - for (vector<pair<string, pair<int, string> > >::iterator p = past_lines.begin(); p != past_lines.end(); ++p) { - if (p->first != layer) continue; - dump << "<div class='frame"; - if (p->second.first > 1) dump << " hidden"; - dump << "' frame_index='" << p->second.first << "'>"; - dump << p->second.second; - dump << "</div>\n"; - } - dump.close(); - } - - string with_newline(string s) { - if (s[s.size()-1] != '\n') return s+'\n'; - return s; - } -}; - - - -trace_stream* Trace_stream = NULL; - -// Top-level helper. IMPORTANT: can't nest. -#define trace(layer) !Trace_stream ? cerr /*print nothing*/ : Trace_stream->stream(layer) -// Warnings should go straight to cerr by default since calls to trace() have -// some unfriendly constraints (they delay printing, they can't nest) -#define raise ((!Trace_stream || !Hide_warnings) ? cerr /*do print*/ : Trace_stream->stream("warn")) << __FILE__ << ":" << __LINE__ << " " -// Just debug logging without any test support. -#define dbg cerr << __FUNCTION__ << '(' << __FILE__ << ':' << __LINE__ << ") " - -// raise << die exits after printing -- unless Hide_warnings is set. -struct die {}; -ostream& operator<<(ostream& os, unused die) { - if (Hide_warnings) return os; - os << "dying"; - exit(1); -} - -#define CLEAR_TRACE delete Trace_stream, Trace_stream = new trace_stream; - -#define DUMP(layer) cerr << Trace_stream->readable_contents(layer) - -// Trace_stream is a resource, lease_tracer uses RAII to manage it. -struct lease_tracer { - lease_tracer() { Trace_stream = new trace_stream; } - ~lease_tracer() { delete Trace_stream, Trace_stream = NULL; } -}; - -#define START_TRACING_UNTIL_END_OF_SCOPE lease_tracer leased_tracer; - -void trace_all(const string& label, const list<string>& in) { - for (list<string>::const_iterator p = in.begin(); p != in.end(); ++p) - trace(label) << *p; -} - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string expected) { // missing layer == anywhere, frame, hierarchical layers - vector<string> expected_lines = split(expected, ""); - size_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - ostringstream output; - string layer, frame, contents; - parse_layer_frame_contents(expected_lines[curr_expected_line], &layer, &frame, &contents); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !prefix_match(layer, p->first)) - continue; - - if (!frame.empty() && strtol(frame.c_str(), NULL, 0) != p->second.first) - continue; - - if (contents != p->second.second) - continue; - - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - parse_layer_frame_contents(expected_lines[curr_expected_line], &layer, &frame, &contents); - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << contents << "] in trace:\n"; - DUMP(layer); - Passed = false; - return false; -} - -void parse_layer_frame_contents(const string& orig, string* layer, string* frame, string* contents) { - string layer_and_frame; - parse_contents(orig, ": ", &layer_and_frame, contents); - parse_layer_and_frame(layer_and_frame, layer, frame); -} - -void parse_contents(const string& s, const string& delim, string* prefix, string* contents) { - string::size_type pos = s.find(delim); - if (pos == NOT_FOUND) { - *prefix = ""; - *contents = s; - } - else { - *prefix = s.substr(0, pos); - *contents = s.substr(pos+delim.size()); - } -} - -void parse_layer_and_frame(const string& orig, string* layer, string* frame) { - size_t last_slash = orig.rfind('/'); - if (last_slash == NOT_FOUND - || last_slash == orig.size()-1 // trailing slash indicates hierarchical layer - || orig.find_last_not_of("0123456789") != last_slash) { - *layer = orig; - *frame = ""; - } - else { - *layer = orig.substr(0, last_slash); - *frame = orig.substr(last_slash+1); - } -} - - - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string layer, string expected) { // empty layer == everything, multiple layers, hierarchical layers - vector<string> expected_lines = split(expected, ""); - size_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - ostringstream output; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !any_prefix_match(layers, p->first)) - continue; - if (p->second.second != expected_lines[curr_expected_line]) - continue; - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << expected_lines[curr_expected_line] << "] in trace:\n"; - DUMP(layer); - Passed = false; - return false; -} - -#define CHECK_TRACE_CONTENTS(...) check_trace_contents(__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) - -int trace_count(string layer) { - return trace_count(layer, ""); -} - -int trace_count(string layer, string line) { - Trace_stream->newline(); - long result = 0; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (any_prefix_match(layers, p->first)) - if (line == "" || p->second.second == line) - ++result; - } - return result; -} - -int trace_count(string layer, int frame, string line) { - Trace_stream->newline(); - long result = 0; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (any_prefix_match(layers, p->first) && p->second.first == frame) - if (line == "" || p->second.second == line) - ++result; - } - return result; -} - -#define CHECK_TRACE_WARNS() CHECK(trace_count("warn") > 0) -#define CHECK_TRACE_DOESNT_WARN() \ - if (trace_count("warn") > 0) { \ - ++Num_failures; \ - cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): unexpected warnings\n"; \ - DUMP("warn"); \ - Passed = false; \ - return; \ - } - -bool trace_doesnt_contain(string layer, string line) { - return trace_count(layer, line) == 0; -} - -bool trace_doesnt_contain(string expected) { - vector<string> tmp = split(expected, ": "); - return trace_doesnt_contain(tmp[0], tmp[1]); -} - -bool trace_doesnt_contain(string layer, int frame, string line) { - return trace_count(layer, frame, line) == 0; -} - -#define CHECK_TRACE_DOESNT_CONTAIN(...) CHECK(trace_doesnt_contain(__VA_ARGS__)) - - - -// manage layer counts in Trace_stream using RAII -struct lease_trace_frame { - string layer; - lease_trace_frame(string l) :layer(l) { - if (!Trace_stream) return; - Trace_stream->newline(); - ++Trace_stream->frame[layer]; - } - ~lease_trace_frame() { - if (!Trace_stream) return; - Trace_stream->newline(); - --Trace_stream->frame[layer]; - } -}; -#define new_trace_frame(layer) lease_trace_frame leased_frame(layer); - -bool check_trace_contents(string FUNCTION, string FILE, int LINE, string layer, int frame, string expected) { // multiple layers, hierarchical layers - vector<string> expected_lines = split(expected, ""); // hack: doesn't handle newlines in embedded in lines - size_t curr_expected_line = 0; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - Trace_stream->newline(); - ostringstream output; - vector<string> layers = split(layer, ","); - for (vector<pair<string, pair<int, string> > >::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) { - if (!layer.empty() && !any_prefix_match(layers, p->first)) - continue; - if (p->second.first != frame) - continue; - if (p->second.second != expected_lines[curr_expected_line]) - continue; - ++curr_expected_line; - while (curr_expected_line < expected_lines.size() && expected_lines[curr_expected_line].empty()) - ++curr_expected_line; - if (curr_expected_line == expected_lines.size()) return true; - } - - ++Num_failures; - cerr << "\nF " << FUNCTION << "(" << FILE << ":" << LINE << "): missing [" << expected_lines[curr_expected_line] << "] in trace/" << frame << ":\n"; - DUMP(layer); - Passed = false; - return false; -} - -#define CHECK_TRACE_TOP(layer, expected) CHECK_TRACE_CONTENTS(layer, 1, expected) - - - -vector<string> split(string s, string delim) { - vector<string> result; - string::size_type begin=0, end=s.find(delim); - while (true) { - if (end == NOT_FOUND) { - result.push_back(string(s, begin, NOT_FOUND)); - break; - } - result.push_back(string(s, begin, end-begin)); - begin = end+delim.size(); - end = s.find(delim, begin); - } - return result; -} - -bool any_prefix_match(const vector<string>& pats, const string& needle) { - if (pats.empty()) return false; - if (*pats[0].rbegin() != '/') - // prefix match not requested - return find(pats.begin(), pats.end(), needle) != pats.end(); - // first pat ends in a '/'; assume all pats do. - for (vector<string>::const_iterator p = pats.begin(); p != pats.end(); ++p) - if (headmatch(needle, *p)) return true; - return false; -} - -bool prefix_match(const string& pat, const string& needle) { - if (*pat.rbegin() != '/') - // prefix match not requested - return pat == needle; - return headmatch(needle, pat); -} - -bool headmatch(const string& s, const string& pat) { - if (pat.size() > s.size()) return false; - return std::mismatch(pat.begin(), pat.end(), s.begin()).first == pat.end(); -} diff --git a/cpp/tangle/001trace.test.cc b/cpp/tangle/001trace.test.cc deleted file mode 100644 index e0db457c..00000000 --- a/cpp/tangle/001trace.test.cc +++ /dev/null @@ -1,164 +0,0 @@ -void test_trace_check_compares() { - CHECK_TRACE_CONTENTS("test layer", ""); - trace("test layer") << "foo"; - CHECK_TRACE_CONTENTS("test layer", "foo"); -} - -void test_trace_check_filters_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - CHECK_TRACE_CONTENTS("test layer 1", "foo"); -} - -void test_trace_check_ignores_other_lines() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "bar"; - CHECK_TRACE_CONTENTS("test layer 1", "foo"); -} - -void test_trace_check_always_finds_empty_lines() { - CHECK_TRACE_CONTENTS("test layer 1", ""); -} - -void test_trace_check_treats_empty_layers_as_wildcards() { - trace("test layer 1") << "foo"; - CHECK_TRACE_CONTENTS("", "foo"); -} - -void test_trace_check_multiple_lines_at_once() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - CHECK_TRACE_CONTENTS("", "foobar"); -} - -void test_trace_check_always_finds_empty_lines2() { - CHECK_TRACE_CONTENTS("test layer 1", ""); -} - -void test_trace_orders_across_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("", "foobarqux"); -} - -void test_trace_orders_across_layers2() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("foobarqux"); -} - -void test_trace_checks_ordering_spanning_multiple_layers() { - trace("layer1") << "foo"; - trace("layer2") << "bar"; - trace("layer1") << "qux"; - CHECK_TRACE_CONTENTS("layer1: foolayer2: barlayer1: qux"); -} - -void test_trace_segments_within_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - new_trace_frame("test layer 1"); - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1", "fooqux"); - CHECK_TRACE_CONTENTS("test layer 1", 0, "foo"); - CHECK_TRACE_DOESNT_CONTAIN("test layer 1", 1, "foo"); -} - -void test_trace_checks_ordering_across_layers_and_frames() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - new_trace_frame("test layer 1"); - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1/0: footest layer 2: bartest layer 1: qux"); - CHECK_TRACE_CONTENTS("test layer 1: footest layer 2: bartest layer 1/1: qux"); -} - -void trace_test_fn(int n) { - if (n == 0) return; - new_trace_frame("foo"); - trace("foo") << "before: " << n; - trace_test_fn(n-1); - trace("foo") << "after: " << n; -} - -void test_trace_keeps_level_together() { - CHECK_TRACE_CONTENTS("foo", ""); - trace_test_fn(4); - CHECK_TRACE_CONTENTS("foo", 2, "before: 3after: 3"); -} - -void test_trace_supports_multiple_layers() { - trace("test layer 1") << "foo"; - trace("test layer 2") << "bar"; - trace("test layer 1") << "qux"; - CHECK_TRACE_CONTENTS("test layer 1,test layer 2", "foobarqux"); -} - -void test_trace_supports_hierarchical_layers() { - trace("test layer/a") << "foo"; - trace("different layer/c") << "foo 2"; - trace("test layer/b") << "bar"; - CHECK_TRACE_CONTENTS("test layer/", "foobar"); -} - -void test_trace_supports_count() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "foo"; - CHECK_EQ(trace_count("test layer 1", "foo"), 2); -} - -void test_trace_supports_count2() { - trace("test layer 1") << "foo"; - trace("test layer 1") << "bar"; - CHECK_EQ(trace_count("test layer 1"), 2); -} - -// pending: DUMP tests -// pending: readable_contents() adds newline if necessary. -// pending: RAISE also prints to stderr. -// pending: RAISE doesn't print to stderr if Hide_warnings is set. -// pending: RAISE doesn't have to be saved if Hide_warnings is set, just printed. -// pending: RAISE prints to stderr if Trace_stream is NULL. -// pending: RAISE prints to stderr if Trace_stream is NULL even if Hide_warnings is set. -// pending: RAISE << ... die() doesn't die if Hide_warnings is set. - - - -// can't check trace because trace methods call 'split' - -void test_split_returns_at_least_one_elem() { - vector<string> result = split("", ","); - CHECK_EQ(result.size(), 1); - CHECK_EQ(result[0], ""); -} - -void test_split_returns_entire_input_when_no_delim() { - vector<string> result = split("abc", ","); - CHECK_EQ(result.size(), 1); - CHECK_EQ(result[0], "abc"); -} - -void test_split_works() { - vector<string> result = split("abc,def", ","); - CHECK_EQ(result.size(), 2); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); -} - -void test_split_works2() { - vector<string> result = split("abc,def,ghi", ","); - CHECK_EQ(result.size(), 3); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); - CHECK_EQ(result[2], "ghi"); -} - -void test_split_handles_multichar_delim() { - vector<string> result = split("abc,,def,,ghi", ",,"); - CHECK_EQ(result.size(), 3); - CHECK_EQ(result[0], "abc"); - CHECK_EQ(result[1], "def"); - CHECK_EQ(result[2], "ghi"); -} diff --git a/cpp/tangle/002main.cc b/cpp/tangle/002main.cc deleted file mode 100644 index aaa91e6f..00000000 --- a/cpp/tangle/002main.cc +++ /dev/null @@ -1,52 +0,0 @@ -int main(int argc, const char* argv[]) { - if (flag("test", argc, argv)) - return run_tests(); - return tangle(argc, argv); -} - -bool flag(const string& flag, int argc, const char* argv[]) { - for (int i = 1; i < argc; ++i) - if (string(argv[i]) == flag) - return true; - return false; -} - -string flag_value(const string& flag, int argc, const char* argv[]) { - for (int i = 1; i < argc-1; ++i) - if (string(argv[i]) == flag) - return argv[i+1]; - return ""; -} - - - -//// test harness - -int run_tests() { - for (unsigned long i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { - START_TRACING_UNTIL_END_OF_SCOPE; - setup(); - (*Tests[i])(); - verify(); - } - - cerr << '\n'; - if (Num_failures > 0) - cerr << Num_failures << " failure" - << (Num_failures > 1 ? "s" : "") - << '\n'; - return Num_failures; -} - -void verify() { - Hide_warnings = false; - if (!Passed) - ; - else - cerr << "."; -} - -void setup() { - Hide_warnings = false; - Passed = true; -} diff --git a/cpp/tangle/030tangle.cc b/cpp/tangle/030tangle.cc deleted file mode 100644 index 5e25c742..00000000 --- a/cpp/tangle/030tangle.cc +++ /dev/null @@ -1,466 +0,0 @@ -// Reorder a file based on directives starting with ':(' (tangle directives). -// Insert #line directives to preserve line numbers in the original. -// Clear lines starting with '//:' (tangle comments). - -//// Preliminaries regarding line number management - -struct Line { - string filename; - size_t line_number; - string contents; - Line() :line_number(0) {} - Line(const string& text) :line_number(0) { - contents = text; - } - Line(const string& text, const string& f, const size_t& l) { - contents = text; - filename = f; - line_number = l; - } - Line(const string& text, const Line& origin) { - contents = text; - filename = origin.filename; - line_number = origin.line_number; - } -}; - -// Emit a list of line contents, inserting directives just at discontinuities. -// Needs to be a macro because 'out' can have the side effect of creating a -// new trace in Trace_stream. -#define EMIT(lines, out) if (!lines.empty()) { \ - string last_file = lines.begin()->filename; \ - size_t last_line = lines.begin()->line_number-1; \ - out << line_directive(lines.begin()->line_number, lines.begin()->filename) << '\n'; \ - for (list<Line>::const_iterator p = lines.begin(); p != lines.end(); ++p) { \ - if (last_file != p->filename || last_line != p->line_number-1) \ - out << line_directive(p->line_number, p->filename) << '\n'; \ - out << p->contents << '\n'; \ - last_file = p->filename; \ - last_line = p->line_number; \ - } \ -} - -string line_directive(size_t line_number, string filename) { - ostringstream result; - if (filename.empty()) - result << "#line " << line_number; - else - result << "#line " << line_number << " \"" << filename << '"'; - return result.str(); -} - -//// Tangle - -string Toplevel = "run"; - -int tangle(int argc, const char* argv[]) { - list<Line> result; - for (int i = 1; i < argc; ++i) { -//? cerr << "new file " << argv[i] << '\n'; //? 1 - Toplevel = "run"; - ifstream in(argv[i]); - tangle(in, argv[i], result); - } - - EMIT(result, cout); - return 0; -} - -void tangle(istream& in, const string& filename, list<Line>& out) { - string curr_line; - size_t line_number = 1; - while (!in.eof()) { - getline(in, curr_line); - if (starts_with(curr_line, ":(")) { - ++line_number; - process_next_hunk(in, trim(curr_line), filename, line_number, out); - continue; - } - if (starts_with(curr_line, "//:")) { - ++line_number; - continue; - } - out.push_back(Line(curr_line, filename, line_number)); - ++line_number; - } - - // Trace all line contents, inserting directives just at discontinuities. - if (!Trace_stream) return; - EMIT(out, Trace_stream->stream("tangle")); -} - -// just for tests -void tangle(istream& in, list<Line>& out) { - tangle(in, "", out); -} - -void process_next_hunk(istream& in, const string& directive, const string& filename, size_t& line_number, list<Line>& out) { - istringstream directive_stream(directive.substr(2)); // length of ":(" - string cmd = next_tangle_token(directive_stream); - - // first slurp all lines until next directive - list<Line> hunk; - bool end_of_scenario_input = false; - { - string curr_line; - while (!in.eof()) { - std::streampos old = in.tellg(); - getline(in, curr_line); - if (starts_with(curr_line, ":(")) { - in.seekg(old); - break; - } - if (starts_with(curr_line, "//:")) { - // tangle comments - ++line_number; - continue; - } - if (cmd == "scenario") { - // ignore mu comments in scenarios, but only after the end of input - if (!starts_with(curr_line, "#") && !is_input(curr_line)) { - // remaining lines are checks - end_of_scenario_input = true; - } - else if (end_of_scenario_input && starts_with(curr_line, "#")) { - ++line_number; - continue; - } - if (trim(curr_line).empty()) { - // ignore empty lines in scenarios, whether in input of after - ++line_number; - continue; - } - } - hunk.push_back(Line(curr_line, filename, line_number)); - ++line_number; - } - } - - if (cmd == "code") { - out.insert(out.end(), hunk.begin(), hunk.end()); - return; - } - - if (cmd == "scenarios") { - Toplevel = next_tangle_token(directive_stream); - return; - } - - if (cmd == "scenario") { - list<Line> result; - string name = next_tangle_token(directive_stream); - emit_test(name, hunk, result); -//? cerr << out.size() << " " << result.size() << '\n'; //? 1 - out.insert(out.end(), result.begin(), result.end()); -//? cerr << out.size() << " " << result.size() << '\n'; //? 1 - return; - } - - if (cmd == "before" || cmd == "after" || cmd == "replace" || cmd == "replace{}" || cmd == "delete" || cmd == "delete{}") { - list<Line>::iterator target = locate_target(out, directive_stream); - if (target == out.end()) { - raise << "Couldn't find target " << directive << '\n' << die(); - return; - } - - indent_all(hunk, target); - - if (cmd == "before") { - out.splice(target, hunk); - } - else if (cmd == "after") { - ++target; - out.splice(target, hunk); - } - else if (cmd == "replace" || cmd == "delete") { - out.splice(target, hunk); - out.erase(target); - } - else if (cmd == "replace{}" || cmd == "delete{}") { - if (find_trim(hunk, ":OLD_CONTENTS") == hunk.end()) { - out.splice(target, hunk); - out.erase(target, balancing_curly(target)); - } - else { - list<Line>::iterator next = balancing_curly(target); - list<Line> old_version; - old_version.splice(old_version.begin(), out, target, next); - old_version.pop_back(); old_version.pop_front(); // contents only please, not surrounding curlies - - list<Line>::iterator new_pos = find_trim(hunk, ":OLD_CONTENTS"); - indent_all(old_version, new_pos); - hunk.splice(new_pos, old_version); - hunk.erase(new_pos); - out.splice(next, hunk); - } - } - return; - } - - raise << "unknown directive " << cmd << '\n'; -} - -list<Line>::iterator locate_target(list<Line>& out, istream& directive_stream) { - string pat = next_tangle_token(directive_stream); - if (pat == "") return out.end(); - - string next_token = next_tangle_token(directive_stream); - if (next_token == "") { - return find_substr(out, pat); - } - // first way to do nested pattern: pattern 'following' intermediate - else if (next_token == "following") { - string pat2 = next_tangle_token(directive_stream); - if (pat2 == "") return out.end(); - list<Line>::iterator intermediate = find_substr(out, pat2); - if (intermediate == out.end()) return out.end(); - return find_substr(out, intermediate, pat); - } - // second way to do nested pattern: intermediate 'then' pattern - else if (next_token == "then") { - list<Line>::iterator intermediate = find_substr(out, pat); - if (intermediate == out.end()) return out.end(); - string pat2 = next_tangle_token(directive_stream); - if (pat2 == "") return out.end(); - return find_substr(out, intermediate, pat2); - } - raise << "unknown keyword in directive: " << next_token << '\n'; - return out.end(); -} - -// indent all lines in l like indentation at exemplar -void indent_all(list<Line>& l, list<Line>::iterator exemplar) { - string curr_indent = indent(exemplar->contents); - for (list<Line>::iterator p = l.begin(); p != l.end(); ++p) - if (!p->contents.empty()) - p->contents.insert(p->contents.begin(), curr_indent.begin(), curr_indent.end()); -} - -string next_tangle_token(istream& in) { - in >> std::noskipws; - ostringstream out; - skip_whitespace(in); - if (in.peek() == '"') - slurp_tangle_string(in, out); - else - slurp_word(in, out); - return out.str(); -} - -void slurp_tangle_string(istream& in, ostream& out) { - in.get(); - char c; - while (in >> c) { - if (c == '\\') // only works for double-quotes - continue; - if (c == '"') - break; - out << c; - } -} - -void slurp_word(istream& in, ostream& out) { - char c; - while (in >> c) { - if (isspace(c) || c == ')') { - in.putback(c); - break; - } - out << c; - } -} - -void skip_whitespace(istream& in) { - while (isspace(in.peek())) - in.get(); -} - -list<Line>::iterator balancing_curly(list<Line>::iterator curr) { - long open_curlies = 0; - do { - for (string::iterator p = curr->contents.begin(); p != curr->contents.end(); ++p) { - if (*p == '{') ++open_curlies; - if (*p == '}') --open_curlies; - } - ++curr; - // no guard so far against unbalanced curly, including inside comments or strings - } while (open_curlies != 0); - return curr; -} - -// A scenario is one or more sessions separated by calls to CLEAR_TRACE ('===') -// A session is: -// one or more lines of escaped setup in C/C++ ('%') -// followed by one or more lines of input, -// followed optionally by (in order): -// one or more lines expected in trace in order ('+') -// one or more lines trace shouldn't include ('-') -// one or more lines expressing counts of specific layers emitted in trace ('$') -// a directive to print the trace just for debugging ('?') -// Remember to update is_input below if you add to this format. -void emit_test(const string& name, list<Line>& lines, list<Line>& result) { - result.push_back(Line("TEST("+name+")", front(lines).filename, front(lines).line_number-1)); // use line number of directive - while (!lines.empty()) { - // hack: drop mu comments at the start, just in case there's a '%' line after them - // So the tangler only passes through mu comments inside scenarios between - // the first input line and the last input line. - while (!lines.empty() && starts_with(front(lines).contents, "#")) - lines.pop_front(); - while (!lines.empty() && starts_with(front(lines).contents, "% ")) { - result.push_back(Line(" "+front(lines).contents.substr(strlen("% ")), front(lines))); - lines.pop_front(); - } - result.push_back(input_lines(lines)); - if (!lines.empty() && !front(lines).contents.empty() && front(lines).contents[0] == '+') - result.push_back(expected_in_trace(lines)); - while (!lines.empty() && !front(lines).contents.empty() && front(lines).contents[0] == '-') { - result.push_back(expected_not_in_trace(front(lines))); - lines.pop_front(); - } - if (!lines.empty() && front(lines).contents[0] == '$') { - const string& in = front(lines).contents; - size_t pos = in.find(": "); - string layer = in.substr(1, pos-1); - string count = in.substr(pos+2); - result.push_back(Line(" CHECK_EQ(trace_count(\""+layer+"\"), "+count+");", front(lines))); - lines.pop_front(); - } - if (!lines.empty() && front(lines).contents == "===") { - result.push_back(Line(" CLEAR_TRACE;", front(lines))); - lines.pop_front(); - } - if (!lines.empty() && front(lines).contents == "?") { - result.push_back(Line(" DUMP(\"\");", front(lines))); - lines.pop_front(); - } - } - result.push_back(Line("}")); -} - -bool is_input(const string& line) { - if (line.empty()) return true; - return line != "===" && line[0] != '+' && line[0] != '-' && line[0] != '$' && line[0] != '?'; -} - -Line input_lines(list<Line>& hunk) { - Line result; - result.line_number = hunk.front().line_number; - result.filename = hunk.front().filename; - while (!hunk.empty() && is_input(hunk.front().contents)) { - result.contents += hunk.front().contents+""; // temporary delimiter; replace with escaped newline after escaping other backslashes - hunk.pop_front(); - } - result.contents = " "+Toplevel+"(\""+escape(result.contents)+"\");"; - return result; -} - -Line expected_in_trace(list<Line>& hunk) { - Line result; - result.line_number = hunk.front().line_number; - result.filename = hunk.front().filename; - while (!hunk.empty() && !front(hunk).contents.empty() && front(hunk).contents[0] == '+') { - hunk.front().contents.erase(0, 1); - result.contents += hunk.front().contents+""; - hunk.pop_front(); - } - result.contents = " CHECK_TRACE_CONTENTS(\""+escape(result.contents)+"\");"; - return result; -} - -Line expected_not_in_trace(const Line& line) { - Line result; - result.line_number = line.line_number; - result.filename = line.filename; - result.contents = " CHECK_TRACE_DOESNT_CONTAIN(\""+escape(line.contents.substr(1))+"\");"; - return result; -} - -list<Line>::iterator find_substr(list<Line>& in, const string& pat) { - for (list<Line>::iterator p = in.begin(); p != in.end(); ++p) - if (p->contents.find(pat) != NOT_FOUND) - return p; - return in.end(); -} - -list<Line>::iterator find_substr(list<Line>& in, list<Line>::iterator p, const string& pat) { - for (; p != in.end(); ++p) - if (p->contents.find(pat) != NOT_FOUND) - return p; - return in.end(); -} - -list<Line>::iterator find_trim(list<Line>& in, const string& pat) { - for (list<Line>::iterator p = in.begin(); p != in.end(); ++p) - if (trim(p->contents) == pat) - return p; - return in.end(); -} - -string escape(string s) { - s = replace_all(s, "\\", "\\\\"); - s = replace_all(s, "\"", "\\\""); - s = replace_all(s, "", "\\n"); - return s; -} - -string replace_all(string s, const string& a, const string& b) { - for (size_t pos = s.find(a); pos != NOT_FOUND; pos = s.find(a, pos+b.size())) - s = s.replace(pos, a.size(), b); - return s; -} - -bool any_line_starts_with(const list<Line>& lines, const string& pat) { - for (list<Line>::const_iterator p = lines.begin(); p != lines.end(); ++p) - if (starts_with(p->contents, pat)) return true; - return false; -} - -bool any_non_input_line(const list<Line>& lines) { - for (list<Line>::const_iterator p = lines.begin(); p != lines.end(); ++p) - if (!is_input(p->contents)) return true; - return false; -} - -// does s start with pat, after skipping whitespace? -// pat can't start with whitespace -bool starts_with(const string& s, const string& pat) { - for (size_t pos = 0; pos < s.size(); ++pos) - if (!isspace(s[pos])) - return s.compare(pos, pat.size(), pat) == 0; - return false; -} - -string indent(const string& s) { - for (size_t pos = 0; pos < s.size(); ++pos) - if (!isspace(s[pos])) - return s.substr(0, pos); - return ""; -} - -string strip_indent(const string& s, size_t n) { - if (s.empty()) return ""; - string::const_iterator curr = s.begin(); - while (curr != s.end() && n > 0 && isspace(*curr)) { - ++curr; - --n; - } - return string(curr, s.end()); -} - -string trim(const string& s) { - string::const_iterator first = s.begin(); - while (first != s.end() && isspace(*first)) - ++first; - if (first == s.end()) return ""; - - string::const_iterator last = --s.end(); - while (last != s.begin() && isspace(*last)) - --last; - ++last; - return string(first, last); -} - -const Line& front(const list<Line>& l) { - assert(!l.empty()); - return l.front(); -} diff --git a/cpp/tangle/030tangle.test.cc b/cpp/tangle/030tangle.test.cc deleted file mode 100644 index 0d4da899..00000000 --- a/cpp/tangle/030tangle.test.cc +++ /dev/null @@ -1,366 +0,0 @@ -void test_tangle() { - istringstream in("a\nb\nc\n:(before b)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "adbc"); -} - -void test_tangle_with_linenumber() { - istringstream in("a\nb\nc\n:(before b)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "#line 1a#line 5d#line 2bc"); - // no other #line directives - CHECK_TRACE_DOESNT_CONTAIN("tangle", "#line 3"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "#line 4"); -} - -void test_tangle_linenumbers_with_filename() { - istringstream in("a\nb\nc\n:(before b)\nd\n"); - list<Line> dummy; - tangle(in, "foo", dummy); - CHECK_TRACE_CONTENTS("tangle", "a#line 5 \"foo\"dbc"); -} - -void test_tangle_linenumbers_with_multiple_filenames() { - istringstream in1("a\nb\nc"); - list<Line> dummy; - tangle(in1, "foo", dummy); - CLEAR_TRACE; - istringstream in2(":(before b)\nd\n"); - tangle(in2, "bar", dummy); - CHECK_TRACE_CONTENTS("tangle", "a#line 2 \"bar\"d#line 2 \"foo\"bc"); -} - -void test_tangle_linenumbers_with_multiple_directives() { - istringstream in1("a\nb\nc"); - list<Line> dummy; - tangle(in1, "foo", dummy); - CLEAR_TRACE; - istringstream in2(":(before b)\nd\n:(before c)\ne"); - tangle(in2, "bar", dummy); - CHECK_TRACE_CONTENTS("tangle", "a#line 2 \"bar\"d#line 2 \"foo\"b#line 4 \"bar\"e#line 3 \"foo\"c"); -} - -void test_tangle_with_multiple_filenames_after() { - istringstream in1("a\nb\nc"); - list<Line> dummy; - tangle(in1, "foo", dummy); - CLEAR_TRACE; - istringstream in2(":(after b)\nd\n"); - tangle(in2, "bar", dummy); - CHECK_TRACE_CONTENTS("tangle", "ab#line 2 \"bar\"d#line 3 \"foo\"c"); -//? exit(0); //? 1 -} - -void test_tangle_skip_tanglecomments() { - istringstream in("a\nb\nc\n//: 1\n//: 2\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "abcd"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "//: 1"); -} - -void test_tangle_with_tanglecomments_and_directive() { - istringstream in("a\n//: 1\nb\nc\n:(before b)\nd\n:(code)\ne\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "a#line 6d#line 3bc#line 8e"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "//: 1"); -} - -void test_tangle_with_tanglecomments_inside_directive() { - istringstream in("a\n//: 1\nb\nc\n:(before b)\n//: abc\nd\n:(code)\ne\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "a#line 7d#line 3bc#line 9e"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "//: 1"); -} - -void test_tangle2() { - istringstream in("a\nb\nc\n:(after b)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "abdc"); -} - -void test_tangle_at_end() { - istringstream in("a\nb\nc\n:(after c)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "abcd"); -} - -void test_tangle_indents_hunks_correctly() { - istringstream in("a\n b\nc\n:(after b)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "a b dc"); -} - -void test_tangle_warns_on_missing_target() { - Hide_warnings = true; - istringstream in(":(before)\nabc def\n"); - list<Line> lines; - tangle(in, lines); - CHECK_TRACE_WARNS(); -} - -void test_tangle_warns_on_unknown_target() { - Hide_warnings = true; - istringstream in(":(before \"foo\")\nabc def\n"); - list<Line> lines; - tangle(in, lines); - CHECK_TRACE_WARNS(); -} - -void test_tangle_delete_range_of_lines() { - istringstream in("a\nb {\nc\n}\n:(delete{} \"b\")\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "a"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "b"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "c"); -} - -void test_tangle_replace() { - istringstream in("a\nb\nc\n:(replace b)\nd\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "adc"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "b"); -} - -void test_tangle_replace_range_of_lines() { - istringstream in("a\nb {\nc\n}\n:(replace{} \"b\")\nd\ne\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "ade"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "b {"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "c"); -} - -void test_tangle_replace_tracks_old_lines() { - istringstream in("a\nb {\nc\n}\n:(replace{} \"b\")\nd\n:OLD_CONTENTS\ne\n"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "adce"); - CHECK_TRACE_DOESNT_CONTAIN("tangle", "b {"); -} - -void test_tangle_nested_patterns() { - istringstream in("a\nc\nb\nc\nd\n:(after \"b\" then \"c\")\ne"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "acbced"); -} - -void test_tangle_nested_patterns2() { - istringstream in("a\nc\nb\nc\nd\n:(after \"c\" following \"b\")\ne"); - list<Line> dummy; - tangle(in, dummy); - CHECK_TRACE_CONTENTS("tangle", "acbced"); -} - -// todo: include line numbers in tangle errors - - - -void test_tangle_supports_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n+layer1: pqr\n+layer2: xyz"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_ignores_empty_lines_in_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n+layer1: pqr\n \n+layer2: xyz"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_handles_empty_lines_in_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n\n+layer1: pqr\n+layer2: xyz"); - list<Line> lines; - tangle(in, lines); - // no infinite loop -} - -void test_tangle_supports_configurable_toplevel() { - istringstream in(":(scenarios foo)\n:(scenario does_bar)\nabc def\n+layer1: pqr"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " foo(\"abc def\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqr\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); - - istringstream cleanup(":(scenarios run)\n"); - tangle(cleanup, lines); -} - -void test_tangle_can_hide_warnings_in_scenarios() { - istringstream in(":(scenario does_bar)\n% Hide_warnings = true;\nabc def\n+layer1: pqr\n+layer2: xyz"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " Hide_warnings = true;"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_supports_strings_in_scenarios() { - istringstream in(":(scenario does_bar)\nabc \"def\"\n+layer1: pqr\n+layer2: \"xyz\""); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc \\\"def\\\"\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: \\\"xyz\\\"\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_supports_strings_in_scenarios2() { - istringstream in(":(scenario does_bar)\nabc \"\"\n+layer1: pqr\n+layer2: \"\""); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc \\\"\\\"\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: \\\"\\\"\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_supports_multiline_input_in_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n efg\n+layer1: pqr\n+layer2: \"\""); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n efg\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: \\\"\\\"\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_supports_reset_in_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n===\nefg\n+layer1: pqr\n+layer2: \"\""); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CLEAR_TRACE;"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"efg\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: \\\"\\\"\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_can_check_for_absence_at_end_of_scenarios() { - istringstream in(":(scenario does_bar)\nabc def\n efg\n+layer1: pqr\n-layer1: xyz"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n efg\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqr\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_DOESNT_CONTAIN(\"layer1: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_can_check_for_absence_at_end_of_scenarios2() { - istringstream in(":(scenario does_bar)\nabc def\n efg\n-layer1: pqr\n-layer1: xyz"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n efg\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_DOESNT_CONTAIN(\"layer1: pqr\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_DOESNT_CONTAIN(\"layer1: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_can_check_for_count_in_scenario() { - istringstream in(":(scenario does_bar)\nabc def\n efg\n$layer1: 2"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n efg\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_EQ(trace_count(\"layer1\"), 2);"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_can_handle_mu_comments_in_scenario() { - istringstream in(":(scenario does_bar)\nabc def\n# comment1\n efg\n # indented comment 2\n+layer1: pqr\n# comment inside expected_trace\n+layer1: xyz\n# comment after expected trace\n-layer1: z\n# comment before trace count\n$layer1: 2\n# comment at end\n\n"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc def\\n# comment1\\n efg\\n # indented comment 2\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqrlayer1: xyz\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_DOESNT_CONTAIN(\"layer1: z\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_EQ(trace_count(\"layer1\"), 2);"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - -void test_tangle_can_handle_escaped_setup_after_mu_comments() { - istringstream in(":(scenario does_bar)\n# comment\n% int x = 1;\nabc\n+layer1: pqr\n"); - list<Line> lines; - tangle(in, lines); - CHECK_EQ(lines.front().contents, "TEST(does_bar)"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " int x = 1;"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " run(\"abc\\n\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, " CHECK_TRACE_CONTENTS(\"layer1: pqr\");"); lines.pop_front(); - CHECK_EQ(lines.front().contents, "}"); lines.pop_front(); - CHECK(lines.empty()); -} - - - -void test_trim() { - CHECK_EQ(trim(""), ""); - CHECK_EQ(trim(" "), ""); - CHECK_EQ(trim(" "), ""); - CHECK_EQ(trim("a"), "a"); - CHECK_EQ(trim(" a"), "a"); - CHECK_EQ(trim(" a"), "a"); - CHECK_EQ(trim(" ab"), "ab"); - CHECK_EQ(trim("a "), "a"); - CHECK_EQ(trim("a "), "a"); - CHECK_EQ(trim("ab "), "ab"); - CHECK_EQ(trim(" a "), "a"); - CHECK_EQ(trim(" a "), "a"); - CHECK_EQ(trim(" ab "), "ab"); -} - -void test_strip_indent() { - CHECK_EQ(strip_indent("", 0), ""); - CHECK_EQ(strip_indent("", 1), ""); - CHECK_EQ(strip_indent("", 3), ""); - CHECK_EQ(strip_indent(" ", 0), " "); - CHECK_EQ(strip_indent(" a", 0), " a"); - CHECK_EQ(strip_indent(" ", 1), ""); - CHECK_EQ(strip_indent(" a", 1), "a"); - CHECK_EQ(strip_indent(" ", 2), ""); - CHECK_EQ(strip_indent(" a", 2), "a"); - CHECK_EQ(strip_indent(" ", 0), " "); - CHECK_EQ(strip_indent(" a", 0), " a"); - CHECK_EQ(strip_indent(" ", 1), " "); - CHECK_EQ(strip_indent(" a", 1), " a"); - CHECK_EQ(strip_indent(" ", 2), ""); - CHECK_EQ(strip_indent(" a", 2), "a"); - CHECK_EQ(strip_indent(" ", 3), ""); - CHECK_EQ(strip_indent(" a", 3), "a"); -} diff --git a/cpp/tangle/boot.cc b/cpp/tangle/boot.cc deleted file mode 100644 index 86385965..00000000 --- a/cpp/tangle/boot.cc +++ /dev/null @@ -1,51 +0,0 @@ -#define unused __attribute__((unused)) - -#include<assert.h> -#include<cstdio> -#include<cstring> -#include<cstdlib> - -#include<vector> -using std::vector; -#include<list> -using std::list; -#include<stack> -using std::stack; -#include<utility> -using std::pair; -#include<map> -using std::map; -#include<algorithm> - -#include<string> -using std::string; -const size_t NOT_FOUND = string::npos; - -#include<iostream> -using std::istream; -using std::ostream; -using std::iostream; -using std::cin; -using std::cout; -using std::cerr; - -#include<sstream> -using std::istringstream; -using std::ostringstream; - -#include<fstream> -using std::ifstream; -using std::ofstream; - -#include <locale> -using std::isspace; // unicode-aware - - - -#include "type_list" - -#include "function_list" - -#include "file_list" - -#include "test_file_list" diff --git a/cpp/tangle/makefile b/cpp/tangle/makefile deleted file mode 100644 index cf4c3a88..00000000 --- a/cpp/tangle/makefile +++ /dev/null @@ -1,23 +0,0 @@ -tangle: makefile type_list function_list file_list test_file_list test_list - g++ -g -O3 -Wall -Wextra -fno-strict-aliasing boot.cc -o tangle - -type_list: boot.cc [0-9]*.cc - @# assumes struct decl has space before '{' - @grep -h "^struct .* {" [0-9]*.cc |perl -pwe 's/(struct *[^ ]*).*/$$1;/' > type_list - @grep -h typedef [0-9]*.cc >> type_list - -function_list: boot.cc [0-9]*.cc - @# assumes function decl has space before '{' - @grep -h "^[^ #].*) {" [0-9]*.cc |perl -pwe 's/ {.*/;/' > function_list - -file_list: boot.cc [0-9]*.cc - @ls [0-9]*.cc |grep -v "\.test\.cc$$" |perl -pwe 's/.*/#include "$$&"/' > file_list - -test_file_list: [0-9]*.test.cc - @ls [0-9]*.test.cc |perl -pwe 's/.*/#include "$$&"/' > test_file_list - -test_list: [0-9]*.cc - @grep -h "^[[:space:]]*void test_" [0-9]*.cc |perl -pwe 's/^\s*void (.*)\(\) {$$/$$1,/' > test_list - -clean: - -rm tangle *_list diff --git a/cpp/termbox/COPYING b/cpp/termbox/COPYING deleted file mode 100644 index e9bb4eac..00000000 --- a/cpp/termbox/COPYING +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2010-2013 nsf <no.smile.face@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/cpp/termbox/README b/cpp/termbox/README deleted file mode 100644 index eccbee72..00000000 --- a/cpp/termbox/README +++ /dev/null @@ -1,2 +0,0 @@ -Fork of https://github.com/nsf/termbox as of 2015-04-22 -git hash 7c154d98a7d9207d768ee0a8e519ede74c0105cf diff --git a/cpp/termbox/bytebuffer.inl b/cpp/termbox/bytebuffer.inl deleted file mode 100644 index aae8f073..00000000 --- a/cpp/termbox/bytebuffer.inl +++ /dev/null @@ -1,79 +0,0 @@ -struct bytebuffer { - char *buf; - int len; - int cap; -}; - -static void bytebuffer_reserve(struct bytebuffer *b, int cap) { - if (b->cap >= cap) { - return; - } - - // prefer doubling capacity - if (b->cap * 2 >= cap) { - cap = b->cap * 2; - } - - char *newbuf = malloc(cap); - if (b->len > 0) { - // copy what was there, b->len > 0 assumes b->buf != null - memcpy(newbuf, b->buf, b->len); - } - if (b->buf) { - // in case there was an allocated buffer, free it - free(b->buf); - } - b->buf = newbuf; - b->cap = cap; -} - -static void bytebuffer_init(struct bytebuffer *b, int cap) { - b->cap = 0; - b->len = 0; - b->buf = 0; - - if (cap > 0) { - b->cap = cap; - b->buf = malloc(cap); // just assume malloc works always - } -} - -static void bytebuffer_free(struct bytebuffer *b) { - if (b->buf) - free(b->buf); -} - -static void bytebuffer_clear(struct bytebuffer *b) { - b->len = 0; -} - -static void bytebuffer_append(struct bytebuffer *b, const char *data, int len) { - bytebuffer_reserve(b, b->len + len); - memcpy(b->buf + b->len, data, len); - b->len += len; -} - -static void bytebuffer_puts(struct bytebuffer *b, const char *str) { - bytebuffer_append(b, str, strlen(str)); -} - -static void bytebuffer_resize(struct bytebuffer *b, int len) { - bytebuffer_reserve(b, len); - b->len = len; -} - -static void bytebuffer_flush(struct bytebuffer *b, int fd) { - int yyy = write(fd, b->buf, b->len); - (void) yyy; - bytebuffer_clear(b); -} - -static void bytebuffer_truncate(struct bytebuffer *b, int n) { - if (n <= 0) - return; - if (n > b->len) - n = b->len; - const int nmove = b->len - n; - memmove(b->buf, b->buf+n, nmove); - b->len -= n; -} diff --git a/cpp/termbox/input.inl b/cpp/termbox/input.inl deleted file mode 100644 index 6493273c..00000000 --- a/cpp/termbox/input.inl +++ /dev/null @@ -1,118 +0,0 @@ -// if s1 starts with s2 returns true, else false -// len is the length of s1 -// s2 should be null-terminated -static bool starts_with(const char *s1, int len, const char *s2) -{ - int n = 0; - while (*s2 && n < len) { - if (*s1++ != *s2++) - return false; - n++; - } - return *s2 == 0; -} - -// convert escape sequence to event, and return consumed bytes on success (failure == 0) -static int parse_escape_seq(struct tb_event *event, const char *buf, int len) -{ - if (len >= 6 && starts_with(buf, len, "\033[M")) { - - switch (buf[3] & 3) { - case 0: - if (buf[3] == 0x60) - event->key = TB_KEY_MOUSE_WHEEL_UP; - else - event->key = TB_KEY_MOUSE_LEFT; - break; - case 1: - if (buf[3] == 0x61) - event->key = TB_KEY_MOUSE_WHEEL_DOWN; - else - event->key = TB_KEY_MOUSE_MIDDLE; - break; - case 2: - event->key = TB_KEY_MOUSE_RIGHT; - break; - case 3: - event->key = TB_KEY_MOUSE_RELEASE; - break; - default: - return -6; - } - event->type = TB_EVENT_MOUSE; // TB_EVENT_KEY by default - - // the coord is 1,1 for upper left - event->x = buf[4] - 1 - 32; - event->y = buf[5] - 1 - 32; - - return 6; - } - - // it's pretty simple here, find 'starts_with' match and return - // success, else return failure - int i; - for (i = 0; keys[i]; i++) { - if (starts_with(buf, len, keys[i])) { - event->ch = 0; - event->key = 0xFFFF-i; - return strlen(keys[i]); - } - } - return 0; -} - -static bool extract_event(struct tb_event *event, struct bytebuffer *inbuf) -{ - const char *buf = inbuf->buf; - const int len = inbuf->len; - if (len == 0) - return false; - - if (buf[0] == '\033') { - int n = parse_escape_seq(event, buf, len); - if (n != 0) { - bool success = true; - if (n < 0) { - success = false; - n = -n; - } - bytebuffer_truncate(inbuf, n); - return success; - } else { - // it's not escape sequence; assume it's esc - event->ch = 0; - event->key = TB_KEY_ESC; - bytebuffer_truncate(inbuf, 1); - return true; - } - } - - // if we're here, this is not an escape sequence and not an alt sequence - // so, it's a FUNCTIONAL KEY or a UNICODE character - - // first of all check if it's a functional key - if ((unsigned char)buf[0] <= TB_KEY_SPACE || - (unsigned char)buf[0] == TB_KEY_BACKSPACE2) - { - // fill event, pop buffer, return success */ - event->ch = 0; - event->key = (uint16_t)buf[0]; - bytebuffer_truncate(inbuf, 1); - return true; - } - - // feh... we got utf8 here - - // check if there is all bytes - if (len >= tb_utf8_char_length(buf[0])) { - /* everything ok, fill event, pop buffer, return success */ - tb_utf8_char_to_unicode(&event->ch, buf); - event->key = 0; - bytebuffer_truncate(inbuf, tb_utf8_char_length(buf[0])); - return true; - } - - // event isn't recognized, perhaps there is not enough bytes in utf8 - // sequence - return false; -} diff --git a/cpp/termbox/makefile b/cpp/termbox/makefile deleted file mode 100644 index 8bdd2704..00000000 --- a/cpp/termbox/makefile +++ /dev/null @@ -1,9 +0,0 @@ -CFLAGS=-O3 -Wall -Wextra -D_XOPEN_SOURCE - -libtermbox.a: utf8.o termbox.o - ar rcs libtermbox.a *.o - -termbox.o: termbox.c input.inl output.inl bytebuffer.inl - -clean: - -rm *.o libtermbox.a diff --git a/cpp/termbox/output.inl b/cpp/termbox/output.inl deleted file mode 100644 index 7c66ce2d..00000000 --- a/cpp/termbox/output.inl +++ /dev/null @@ -1,306 +0,0 @@ -enum { - T_ENTER_CA, - T_EXIT_CA, - T_SHOW_CURSOR, - T_HIDE_CURSOR, - T_CLEAR_SCREEN, - T_SGR0, - T_UNDERLINE, - T_BOLD, - T_BLINK, - T_REVERSE, - T_ENTER_KEYPAD, - T_EXIT_KEYPAD, - T_ENTER_MOUSE, - T_EXIT_MOUSE, - T_FUNCS_NUM, -}; - -#define EUNSUPPORTED_TERM -1 - -// rxvt-256color -static const char *rxvt_256color_keys[] = { - "\033[11~","\033[12~","\033[13~","\033[14~","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[7~","\033[8~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0 -}; -static const char *rxvt_256color_funcs[] = { - "\0337\033[?47h", "\033[2J\033[?47l\0338", "\033[?25h", "\033[?25l", "\033[H\033[2J", "\033[m", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "\033=", "\033>", "\033[?1000h", "\033[?1000l", -}; - -// Eterm -static const char *eterm_keys[] = { - "\033[11~","\033[12~","\033[13~","\033[14~","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[7~","\033[8~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0 -}; -static const char *eterm_funcs[] = { - "\0337\033[?47h", "\033[2J\033[?47l\0338", "\033[?25h", "\033[?25l", "\033[H\033[2J", "\033[m", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "", "", "", "", -}; - -// screen -static const char *screen_keys[] = { - "\033OP","\033OQ","\033OR","\033OS","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[1~","\033[4~","\033[5~","\033[6~","\033OA","\033OB","\033OD","\033OC", 0 -}; -static const char *screen_funcs[] = { - "\033[?1049h", "\033[?1049l", "\033[34h\033[?25h", "\033[?25l", "\033[H\033[J", "\033[m", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "\033[?1h\033=", "\033[?1l\033>", "\033[?1000h", "\033[?1000l", -}; - -// rxvt-unicode -static const char *rxvt_unicode_keys[] = { - "\033[11~","\033[12~","\033[13~","\033[14~","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[7~","\033[8~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0 -}; -static const char *rxvt_unicode_funcs[] = { - "\033[?1049h", "\033[r\033[?1049l", "\033[?25h", "\033[?25l", "\033[H\033[2J", "\033[m\033(B", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "\033=", "\033>", "\033[?1000h", "\033[?1000l", -}; - -// linux -static const char *linux_keys[] = { - "\033[[A","\033[[B","\033[[C","\033[[D","\033[[E","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[1~","\033[4~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0 -}; -static const char *linux_funcs[] = { - "", "", "\033[?25h\033[?0c", "\033[?25l\033[?1c", "\033[H\033[J", "\033[0;10m", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "", "", "", "", -}; - -// xterm -static const char *xterm_keys[] = { - "\033OP","\033OQ","\033OR","\033OS","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033OH","\033OF","\033[5~","\033[6~","\033OA","\033OB","\033OD","\033OC", 0 -}; -static const char *xterm_funcs[] = { - "\033[?1049h", "\033[?1049l", "\033[?12l\033[?25h", "\033[?25l", "\033[H\033[2J", "\033(B\033[m", "\033[4m", "\033[1m", "\033[5m", "\033[7m", "\033[?1h\033=", "\033[?1l\033>", "\033[?1000h", "\033[?1000l", -}; - -static struct term { - const char *name; - const char **keys; - const char **funcs; -} terms[] = { - {"rxvt-256color", rxvt_256color_keys, rxvt_256color_funcs}, - {"Eterm", eterm_keys, eterm_funcs}, - {"screen", screen_keys, screen_funcs}, - {"rxvt-unicode", rxvt_unicode_keys, rxvt_unicode_funcs}, - {"linux", linux_keys, linux_funcs}, - {"xterm", xterm_keys, xterm_funcs}, - {0, 0, 0}, -}; - -static bool init_from_terminfo = false; -static const char **keys; -static const char **funcs; - -static int try_compatible(const char *term, const char *name, - const char **tkeys, const char **tfuncs) -{ - if (strstr(term, name)) { - keys = tkeys; - funcs = tfuncs; - return 0; - } - - return EUNSUPPORTED_TERM; -} - -static int init_term_builtin(void) -{ - int i; - const char *term = getenv("TERM"); - - if (term) { - for (i = 0; terms[i].name; i++) { - if (!strcmp(terms[i].name, term)) { - keys = terms[i].keys; - funcs = terms[i].funcs; - return 0; - } - } - - /* let's do some heuristic, maybe it's a compatible terminal */ - if (try_compatible(term, "xterm", xterm_keys, xterm_funcs) == 0) - return 0; - if (try_compatible(term, "rxvt", rxvt_unicode_keys, rxvt_unicode_funcs) == 0) - return 0; - if (try_compatible(term, "linux", linux_keys, linux_funcs) == 0) - return 0; - if (try_compatible(term, "Eterm", eterm_keys, eterm_funcs) == 0) - return 0; - if (try_compatible(term, "screen", screen_keys, screen_funcs) == 0) - return 0; - /* let's assume that 'cygwin' is xterm compatible */ - if (try_compatible(term, "cygwin", xterm_keys, xterm_funcs) == 0) - return 0; - } - - return EUNSUPPORTED_TERM; -} - -//---------------------------------------------------------------------- -// terminfo -//---------------------------------------------------------------------- - -static char *read_file(const char *file) { - FILE *f = fopen(file, "rb"); - if (!f) - return 0; - - struct stat st; - if (fstat(fileno(f), &st) != 0) { - fclose(f); - return 0; - } - - char *data = malloc(st.st_size); - if (!data) { - fclose(f); - return 0; - } - - if (fread(data, 1, st.st_size, f) != (size_t)st.st_size) { - fclose(f); - free(data); - return 0; - } - - fclose(f); - return data; -} - -static char *terminfo_try_path(const char *path, const char *term) { - char tmp[4096]; - // snprintf guarantee for older compilers - assert(sizeof(tmp) > sizeof(path)+sizeof("/x/")+sizeof(term)+1); - sprintf(tmp, "%s/%c/%s", path, term[0], term); - char *data = read_file(tmp); - if (data) { - return data; - } - - // fallback to darwin specific dirs structure - // snprintf guarantee above still applies - sprintf(tmp, "%s/%x/%s", path, term[0], term); - return read_file(tmp); -} - -static char *load_terminfo(void) { - char tmp[4096]; - const char *term = getenv("TERM"); - if (!term) { - return 0; - } - - // if TERMINFO is set, no other directory should be searched - const char *terminfo = getenv("TERMINFO"); - if (terminfo) { - return terminfo_try_path(terminfo, term); - } - - // next, consider ~/.terminfo - const char *home = getenv("HOME"); - if (home) { - // snprintf guarantee for older compilers - assert(sizeof(tmp) > sizeof(home)+sizeof("/.terminfo")+1); - strncpy(tmp, home, sizeof(tmp)); - strcat(tmp, "/.terminfo"); - char *data = terminfo_try_path(tmp, term); - if (data) - return data; - } - - // next, TERMINFO_DIRS - const char *dirs = getenv("TERMINFO_DIRS"); - if (dirs) { - // snprintf guarantee for older compilers - assert(sizeof(tmp) > sizeof(dirs)); - strncpy(tmp, dirs, sizeof(tmp)); - char *dir = strtok(tmp, ":"); - while (dir) { - const char *cdir = dir; - if (strcmp(cdir, "") == 0) { - cdir = "/usr/share/terminfo"; - } - char *data = terminfo_try_path(cdir, term); - if (data) - return data; - dir = strtok(0, ":"); - } - } - - // fallback to /usr/share/terminfo - return terminfo_try_path("/usr/share/terminfo", term); -} - -#define TI_MAGIC 0432 -#define TI_HEADER_LENGTH 12 -#define TB_KEYS_NUM 22 - -static const char *terminfo_copy_string(char *data, int str, int table) { - const int16_t off = *(int16_t*)(data + str); - const char *src = data + table + off; - int len = strlen(src); - char *dst = malloc(len+1); - strcpy(dst, src); - return dst; -} - -static const int16_t ti_funcs[] = { - 28, 40, 16, 13, 5, 39, 36, 27, 26, 34, 89, 88, -}; - -static const int16_t ti_keys[] = { - 66, 68 /* apparently not a typo; 67 is F10 for whatever reason */, 69, - 70, 71, 72, 73, 74, 75, 67, 216, 217, 77, 59, 76, 164, 82, 81, 87, 61, - 79, 83, -}; - -static int init_term(void) { - int i; - char *data = load_terminfo(); - if (!data) { - init_from_terminfo = false; - return init_term_builtin(); - } - - int16_t *header = (int16_t*)data; - if ((header[1] + header[2]) % 2) { - // old quirk to align everything on word boundaries - header[2] += 1; - } - - const int str_offset = TI_HEADER_LENGTH + - header[1] + header[2] + 2 * header[3]; - const int table_offset = str_offset + 2 * header[4]; - - keys = malloc(sizeof(const char*) * (TB_KEYS_NUM+1)); - for (i = 0; i < TB_KEYS_NUM; i++) { - keys[i] = terminfo_copy_string(data, - str_offset + 2 * ti_keys[i], table_offset); - } - keys[TB_KEYS_NUM] = 0; - - funcs = malloc(sizeof(const char*) * T_FUNCS_NUM); - // the last two entries are reserved for mouse. because the table offset is - // not there, the two entries have to fill in manually - for (i = 0; i < T_FUNCS_NUM-2; i++) { - funcs[i] = terminfo_copy_string(data, - str_offset + 2 * ti_funcs[i], table_offset); - } - - funcs[T_FUNCS_NUM-2] = "\033[?1000h"; - funcs[T_FUNCS_NUM-1] = "\033[?1000l"; - - init_from_terminfo = true; - free(data); - return 0; -} - -static void shutdown_term(void) { - if (init_from_terminfo) { - int i; - for (i = 0; i < TB_KEYS_NUM; i++) { - free((void*)keys[i]); - } - // the last two entries are reserved for mouse. because the table offset - // is not there, the two entries have to fill in manually and do not - // need to be freed. - for (i = 0; i < T_FUNCS_NUM-2; i++) { - free((void*)funcs[i]); - } - free(keys); - free(funcs); - } -} diff --git a/cpp/termbox/termbox.c b/cpp/termbox/termbox.c deleted file mode 100644 index 13ef1359..00000000 --- a/cpp/termbox/termbox.c +++ /dev/null @@ -1,562 +0,0 @@ -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <signal.h> -#include <stdio.h> -#include <stdbool.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <termios.h> -#include <unistd.h> -#include <wchar.h> - -#include "termbox.h" - -#include "bytebuffer.inl" -#include "output.inl" -#include "input.inl" - -struct cellbuf { - int width; - int height; - struct tb_cell *cells; -}; - -#define CELL(buf, x, y) (buf)->cells[(y) * (buf)->width + (x)] -#define IS_CURSOR_HIDDEN(cx, cy) (cx == -1 || cy == -1) -#define LAST_COORD_INIT -1 - -static struct termios orig_tios; - -static struct cellbuf back_buffer; -static struct cellbuf front_buffer; -static struct bytebuffer output_buffer; -static struct bytebuffer input_buffer; - -static int termw = -1; -static int termh = -1; - -static int inout; -static int winch_fds[2]; - -static int lastx = LAST_COORD_INIT; -static int lasty = LAST_COORD_INIT; -static int cursor_x = -1; -static int cursor_y = -1; - -static uint16_t background = TB_DEFAULT; -static uint16_t foreground = TB_DEFAULT; - -static void write_cursor(int x, int y); -static void write_sgr_fg(uint16_t fg); -static void write_sgr_bg(uint16_t bg); -static void write_sgr(uint16_t fg, uint16_t bg); - -static void cellbuf_init(struct cellbuf *buf, int width, int height); -static void cellbuf_resize(struct cellbuf *buf, int width, int height); -static void cellbuf_clear(struct cellbuf *buf); -static void cellbuf_free(struct cellbuf *buf); - -static void update_size(void); -static void update_term_size(void); -static void send_attr(uint16_t fg, uint16_t bg); -static void send_char(int x, int y, uint32_t c); -static void send_clear(void); -static void sigwinch_handler(int xxx); -static int wait_fill_event(struct tb_event *event, struct timeval *timeout); - -/* may happen in a different thread */ -static volatile int buffer_size_change_request; - -/* -------------------------------------------------------- */ - -int tb_init(void) -{ - inout = open("/dev/tty", O_RDWR); - if (inout == -1) { - return TB_EFAILED_TO_OPEN_TTY; - } - - if (init_term() < 0) { - close(inout); - return TB_EUNSUPPORTED_TERMINAL; - } - - if (pipe(winch_fds) < 0) { - close(inout); - return TB_EPIPE_TRAP_ERROR; - } - - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - sa.sa_handler = sigwinch_handler; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, 0); - - tcgetattr(inout, &orig_tios); - - struct termios tios; - memcpy(&tios, &orig_tios, sizeof(tios)); - - tios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP - | INLCR | IGNCR | ICRNL | IXON); - tios.c_oflag &= ~OPOST; - tios.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - tios.c_cflag &= ~(CSIZE | PARENB); - tios.c_cflag |= CS8; - tios.c_cc[VMIN] = 0; - tios.c_cc[VTIME] = 0; - tcsetattr(inout, TCSAFLUSH, &tios); - - bytebuffer_init(&input_buffer, 128); - bytebuffer_init(&output_buffer, 32 * 1024); - - bytebuffer_puts(&output_buffer, funcs[T_ENTER_CA]); - bytebuffer_puts(&output_buffer, funcs[T_ENTER_KEYPAD]); - bytebuffer_puts(&output_buffer, funcs[T_HIDE_CURSOR]); - send_clear(); - - update_term_size(); - cellbuf_init(&back_buffer, termw, termh); - cellbuf_init(&front_buffer, termw, termh); - cellbuf_clear(&back_buffer); - cellbuf_clear(&front_buffer); - - return 0; -} - -void tb_shutdown(void) -{ - if (termw == -1) { - fputs("tb_shutdown() should not be called twice.", stderr); - abort(); - } - - bytebuffer_puts(&output_buffer, funcs[T_SHOW_CURSOR]); - bytebuffer_puts(&output_buffer, funcs[T_SGR0]); - bytebuffer_puts(&output_buffer, funcs[T_CLEAR_SCREEN]); - bytebuffer_puts(&output_buffer, funcs[T_EXIT_CA]); - bytebuffer_puts(&output_buffer, funcs[T_EXIT_KEYPAD]); - bytebuffer_puts(&output_buffer, funcs[T_EXIT_MOUSE]); - bytebuffer_flush(&output_buffer, inout); - tcsetattr(inout, TCSAFLUSH, &orig_tios); - - shutdown_term(); - close(inout); - close(winch_fds[0]); - close(winch_fds[1]); - - cellbuf_free(&back_buffer); - cellbuf_free(&front_buffer); - bytebuffer_free(&output_buffer); - bytebuffer_free(&input_buffer); - termw = termh = -1; -} - -void tb_present(void) -{ - int x,y,w,i; - struct tb_cell *back, *front; - - /* invalidate cursor position */ - lastx = LAST_COORD_INIT; - lasty = LAST_COORD_INIT; - - if (buffer_size_change_request) { - update_size(); - buffer_size_change_request = 0; - } - - for (y = 0; y < front_buffer.height; ++y) { - for (x = 0; x < front_buffer.width; ) { - back = &CELL(&back_buffer, x, y); - front = &CELL(&front_buffer, x, y); - w = wcwidth(back->ch); - if (w < 1) w = 1; - if (memcmp(back, front, sizeof(struct tb_cell)) == 0) { - x += w; - continue; - } - memcpy(front, back, sizeof(struct tb_cell)); - send_attr(back->fg, back->bg); - if (w > 1 && x >= front_buffer.width - (w - 1)) { - // Not enough room for wide ch, so send spaces - for (i = x; i < front_buffer.width; ++i) { - send_char(i, y, ' '); - } - } else { - send_char(x, y, back->ch); - for (i = 1; i < w; ++i) { - front = &CELL(&front_buffer, x + i, y); - front->ch = 0; - front->fg = back->fg; - front->bg = back->bg; - } - } - x += w; - } - } - if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y)) - write_cursor(cursor_x, cursor_y); - bytebuffer_flush(&output_buffer, inout); -} - -void tb_set_cursor(int cx, int cy) -{ - if (IS_CURSOR_HIDDEN(cursor_x, cursor_y) && !IS_CURSOR_HIDDEN(cx, cy)) - bytebuffer_puts(&output_buffer, funcs[T_SHOW_CURSOR]); - - if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y) && IS_CURSOR_HIDDEN(cx, cy)) - bytebuffer_puts(&output_buffer, funcs[T_HIDE_CURSOR]); - - cursor_x = cx; - cursor_y = cy; - if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y)) - write_cursor(cursor_x, cursor_y); -} - -void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg) -{ - if ((unsigned)x >= (unsigned)back_buffer.width) - return; - if ((unsigned)y >= (unsigned)back_buffer.height) - return; - struct tb_cell c = {ch, fg, bg}; - CELL(&back_buffer, x, y) = c; -} - -struct tb_cell *tb_cell_buffer() -{ - return back_buffer.cells; -} - -int tb_poll_event(struct tb_event *event) -{ - return wait_fill_event(event, 0); -} - -int tb_peek_event(struct tb_event *event, int timeout) -{ - struct timeval tv; - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000; - return wait_fill_event(event, &tv); -} - -int tb_width(void) -{ - return termw; -} - -int tb_height(void) -{ - return termh; -} - -void tb_clear(void) -{ - if (buffer_size_change_request) { - update_size(); - buffer_size_change_request = 0; - } - cellbuf_clear(&back_buffer); -} - -void tb_set_clear_attributes(uint16_t fg, uint16_t bg) -{ - foreground = fg; - background = bg; -} - -/* -------------------------------------------------------- */ - -static int convertnum(uint32_t num, char* buf) { - int i, l = 0; - int ch; - do { - buf[l++] = '0' + (num % 10); - num /= 10; - } while (num); - for(i = 0; i < l / 2; i++) { - ch = buf[i]; - buf[i] = buf[l - 1 - i]; - buf[l - 1 - i] = ch; - } - return l; -} - -#define WRITE_LITERAL(X) bytebuffer_append(&output_buffer, (X), sizeof(X)-1) -#define WRITE_INT(X) bytebuffer_append(&output_buffer, buf, convertnum((X), buf)) - -static void write_cursor(int x, int y) { - char buf[32]; - WRITE_LITERAL("\033["); - WRITE_INT(y+1); - WRITE_LITERAL(";"); - WRITE_INT(x+1); - WRITE_LITERAL("H"); -} - -static void write_sgr_fg(uint16_t fg) { - char buf[32]; - WRITE_LITERAL("\033[3"); - WRITE_INT(fg-1); - WRITE_LITERAL("m"); -} - -static void write_sgr_bg(uint16_t bg) { - char buf[32]; - WRITE_LITERAL("\033[4"); - WRITE_INT(bg-1); - WRITE_LITERAL("m"); -} - -static void write_sgr(uint16_t fg, uint16_t bg) { - char buf[32]; - WRITE_LITERAL("\033[3"); - WRITE_INT(fg-1); - WRITE_LITERAL(";4"); - WRITE_INT(bg-1); - WRITE_LITERAL("m"); -} - -static void cellbuf_init(struct cellbuf *buf, int width, int height) -{ - buf->cells = (struct tb_cell*)malloc(sizeof(struct tb_cell) * width * height); - assert(buf->cells); - buf->width = width; - buf->height = height; -} - -static void cellbuf_resize(struct cellbuf *buf, int width, int height) -{ - if (buf->width == width && buf->height == height) - return; - - int oldw = buf->width; - int oldh = buf->height; - struct tb_cell *oldcells = buf->cells; - - cellbuf_init(buf, width, height); - cellbuf_clear(buf); - - int minw = (width < oldw) ? width : oldw; - int minh = (height < oldh) ? height : oldh; - int i; - - for (i = 0; i < minh; ++i) { - struct tb_cell *csrc = oldcells + (i * oldw); - struct tb_cell *cdst = buf->cells + (i * width); - memcpy(cdst, csrc, sizeof(struct tb_cell) * minw); - } - - free(oldcells); -} - -static void cellbuf_clear(struct cellbuf *buf) -{ - int i; - int ncells = buf->width * buf->height; - - for (i = 0; i < ncells; ++i) { - buf->cells[i].ch = ' '; - buf->cells[i].fg = foreground; - buf->cells[i].bg = background; - } -} - -static void cellbuf_free(struct cellbuf *buf) -{ - free(buf->cells); -} - -static void get_term_size(int *w, int *h) -{ - struct winsize sz; - memset(&sz, 0, sizeof(sz)); - - ioctl(inout, TIOCGWINSZ, &sz); - - if (w) *w = sz.ws_col; - if (h) *h = sz.ws_row; -} - -static void update_term_size(void) -{ - struct winsize sz; - memset(&sz, 0, sizeof(sz)); - - ioctl(inout, TIOCGWINSZ, &sz); - - termw = sz.ws_col; - termh = sz.ws_row; -} - -static void send_attr(uint16_t fg, uint16_t bg) -{ -#define LAST_ATTR_INIT 0xFFFF - static uint16_t lastfg = LAST_ATTR_INIT, lastbg = LAST_ATTR_INIT; - if (fg != lastfg || bg != lastbg) { - bytebuffer_puts(&output_buffer, funcs[T_SGR0]); - - uint16_t fgcol = fg & 0x0F; - uint16_t bgcol = bg & 0x0F; - - if (fg & TB_BOLD) - bytebuffer_puts(&output_buffer, funcs[T_BOLD]); - if (bg & TB_BOLD) - bytebuffer_puts(&output_buffer, funcs[T_BLINK]); - if (fg & TB_UNDERLINE) - bytebuffer_puts(&output_buffer, funcs[T_UNDERLINE]); - if ((fg & TB_REVERSE) || (bg & TB_REVERSE)) - bytebuffer_puts(&output_buffer, funcs[T_REVERSE]); - - if (fgcol != TB_DEFAULT) { - if (bgcol != TB_DEFAULT) - write_sgr(fgcol, bgcol); - else - write_sgr_fg(fgcol); - } else if (bgcol != TB_DEFAULT) { - write_sgr_bg(bgcol); - } - - lastfg = fg; - lastbg = bg; - } -} - -static void send_char(int x, int y, uint32_t c) -{ - char buf[7]; - int bw = tb_utf8_unicode_to_char(buf, c); - buf[bw] = '\0'; - if (x-1 != lastx || y != lasty) - write_cursor(x, y); - lastx = x; lasty = y; - if(!c) buf[0] = ' '; // replace 0 with whitespace - bytebuffer_puts(&output_buffer, buf); -} - -static void send_clear(void) -{ - send_attr(foreground, background); - bytebuffer_puts(&output_buffer, funcs[T_CLEAR_SCREEN]); - if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y)) - write_cursor(cursor_x, cursor_y); - bytebuffer_flush(&output_buffer, inout); - - /* we need to invalidate cursor position too and these two vars are - * used only for simple cursor positioning optimization, cursor - * actually may be in the correct place, but we simply discard - * optimization once and it gives us simple solution for the case when - * cursor moved */ - lastx = LAST_COORD_INIT; - lasty = LAST_COORD_INIT; -} - -static void sigwinch_handler(int xxx) -{ - (void) xxx; - const int zzz = 1; - int yyy = write(winch_fds[1], &zzz, sizeof(int)); - (void) yyy; -} - -static void update_size(void) -{ - update_term_size(); - cellbuf_resize(&back_buffer, termw, termh); - cellbuf_resize(&front_buffer, termw, termh); - cellbuf_clear(&front_buffer); - send_clear(); -} - -static int read_up_to(int n) { - assert(n > 0); - const int prevlen = input_buffer.len; - bytebuffer_resize(&input_buffer, prevlen + n); - - int read_n = 0; - while (read_n <= n) { - ssize_t r = 0; - if (read_n < n) { - r = read(inout, input_buffer.buf + prevlen + read_n, n - read_n); - } -#ifdef __CYGWIN__ - // While linux man for tty says when VMIN == 0 && VTIME == 0, read - // should return 0 when there is nothing to read, cygwin's read returns - // -1. Not sure why and if it's correct to ignore it, but let's pretend - // it's zero. - if (r < 0) r = 0; -#endif - if (r < 0) { - // EAGAIN / EWOULDBLOCK shouldn't occur here - assert(errno != EAGAIN && errno != EWOULDBLOCK); - return -1; - } else if (r > 0) { - read_n += r; - } else { - bytebuffer_resize(&input_buffer, prevlen + read_n); - return read_n; - } - } - assert(!"unreachable"); - return 0; -} - -static int wait_fill_event(struct tb_event *event, struct timeval *timeout) -{ - // ;-) -#define ENOUGH_DATA_FOR_PARSING 64 - fd_set events; - memset(event, 0, sizeof(struct tb_event)); - - // try to extract event from input buffer, return on success - event->type = TB_EVENT_KEY; - if (extract_event(event, &input_buffer)) - return event->type; - - // it looks like input buffer is incomplete, let's try the short path, - // but first make sure there is enough space - int n = read_up_to(ENOUGH_DATA_FOR_PARSING); - if (n < 0) - return -1; - if (n > 0 && extract_event(event, &input_buffer)) - return event->type; - - // n == 0, or not enough data, let's go to select - while (1) { - FD_ZERO(&events); - FD_SET(inout, &events); - FD_SET(winch_fds[0], &events); - int maxfd = (winch_fds[0] > inout) ? winch_fds[0] : inout; - int result = select(maxfd+1, &events, 0, 0, timeout); - if (!result) - return 0; - - if (FD_ISSET(inout, &events)) { - event->type = TB_EVENT_KEY; - n = read_up_to(ENOUGH_DATA_FOR_PARSING); - if (n < 0) - return -1; - - if (n == 0) - continue; - - if (extract_event(event, &input_buffer)) - return event->type; - } - if (FD_ISSET(winch_fds[0], &events)) { - event->type = TB_EVENT_RESIZE; - int zzz = 0; - int yyy = read(winch_fds[0], &zzz, sizeof(int)); - (void) yyy; - buffer_size_change_request = 1; - get_term_size(&event->w, &event->h); - return TB_EVENT_RESIZE; - } - } -} diff --git a/cpp/termbox/termbox.h b/cpp/termbox/termbox.h deleted file mode 100644 index 3e2228de..00000000 --- a/cpp/termbox/termbox.h +++ /dev/null @@ -1,210 +0,0 @@ -#pragma once - -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/*** 1. Controlling the screen. */ - -/* The screen is a 2D array of cells. */ -struct tb_cell { - uint32_t ch; /* unicode character */ - uint16_t fg; /* foreground color and attributes */ - uint16_t bg; /* background color and attributes */ -}; - -/* Possible colors in tb_cell.fg and tb_cell.bg. */ -#define TB_DEFAULT 0x00 -#define TB_BLACK 0x01 -#define TB_RED 0x02 -#define TB_GREEN 0x03 -#define TB_YELLOW 0x04 -#define TB_BLUE 0x05 -#define TB_MAGENTA 0x06 -#define TB_CYAN 0x07 -#define TB_WHITE 0x08 - -/* Colors in tb_cell can be combined using bitwise-OR with multiple - * of the following attributes. */ -#define TB_BOLD 0x0100 -#define TB_UNDERLINE 0x0200 -#define TB_REVERSE 0x0400 - -/* Initialize screen and keyboard. */ -int tb_init(void); -/* Possible error codes returned by tb_init() */ -#define TB_EUNSUPPORTED_TERMINAL -1 -#define TB_EFAILED_TO_OPEN_TTY -2 -/* Termbox uses unix pipes in order to deliver a message from a signal handler - * (SIGWINCH) to the main event reading loop. */ -#define TB_EPIPE_TRAP_ERROR -3 - -/* Restore terminal mode. */ -void tb_shutdown(void); - -/* Size of the screen. Return negative values before tb_init() or after - * tb_shutdown() */ -int tb_width(void); -int tb_height(void); - -/* Update the screen with internal state. Most methods below modify just the - * internal state of the screen. Changes won't be visible until you call - * tb_present(). */ -void tb_present(void); - -/* Returns a pointer to the internal screen state: a 1D array of cells in - * raster order. You'll need to call tb_width() and tb_height() for the - * array's dimensions. The array stays valid until tb_clear() or tb_present() - * are called. */ -struct tb_cell *tb_cell_buffer(); - -/* Clear the internal screen state using either TB_DEFAULT or the - * color/attributes set by tb_set_clear_attributes(). */ -void tb_clear(void); -void tb_set_clear_attributes(uint16_t fg, uint16_t bg); - -/* Move the cursor. Upper-left character is (0, 0). - */ -void tb_set_cursor(int cx, int cy); -/* To hide the cursor, call tb_set_cursor(TB_HIDE_CURSOR, TB_HIDE_CURSOR). - * Cursor starts out hidden. */ -#define TB_HIDE_CURSOR -1 - -/* Modify a specific cell of the screen. Don't forget to call tb_present() to - * commit your changes. */ -void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg); - - - -/*** 2. Controlling keyboard events. */ - -struct tb_event { - uint8_t type; - /* fields for type TB_EVENT_KEY */ - uint16_t key; - uint32_t ch; - /* fields for type TB_EVENT_RESIZE */ - int32_t w; - int32_t h; - /* fields for type TB_EVENT_MOUSE */ - int32_t x; - int32_t y; -}; - -/* Possible values for tb_event.type. */ -#define TB_EVENT_KEY 1 -#define TB_EVENT_RESIZE 2 -#define TB_EVENT_MOUSE 3 - -/* Possible values for tb_event.key. - * - * These are a safe subset of terminfo keys, which exist on all popular - * terminals. Termbox uses only them to stay truly portable. - */ -#define TB_KEY_F1 (0xFFFF-0) -#define TB_KEY_F2 (0xFFFF-1) -#define TB_KEY_F3 (0xFFFF-2) -#define TB_KEY_F4 (0xFFFF-3) -#define TB_KEY_F5 (0xFFFF-4) -#define TB_KEY_F6 (0xFFFF-5) -#define TB_KEY_F7 (0xFFFF-6) -#define TB_KEY_F8 (0xFFFF-7) -#define TB_KEY_F9 (0xFFFF-8) -#define TB_KEY_F10 (0xFFFF-9) -#define TB_KEY_F11 (0xFFFF-10) -#define TB_KEY_F12 (0xFFFF-11) -#define TB_KEY_INSERT (0xFFFF-12) -#define TB_KEY_DELETE (0xFFFF-13) -#define TB_KEY_HOME (0xFFFF-14) -#define TB_KEY_END (0xFFFF-15) -#define TB_KEY_PGUP (0xFFFF-16) -#define TB_KEY_PGDN (0xFFFF-17) -#define TB_KEY_ARROW_UP (0xFFFF-18) -#define TB_KEY_ARROW_DOWN (0xFFFF-19) -#define TB_KEY_ARROW_LEFT (0xFFFF-20) -#define TB_KEY_ARROW_RIGHT (0xFFFF-21) -#define TB_KEY_MOUSE_LEFT (0xFFFF-22) -#define TB_KEY_MOUSE_RIGHT (0xFFFF-23) -#define TB_KEY_MOUSE_MIDDLE (0xFFFF-24) -#define TB_KEY_MOUSE_RELEASE (0xFFFF-25) -#define TB_KEY_MOUSE_WHEEL_UP (0xFFFF-26) -#define TB_KEY_MOUSE_WHEEL_DOWN (0xFFFF-27) -/* These are all ASCII code points below SPACE character and a BACKSPACE key. */ -#define TB_KEY_CTRL_TILDE 0x00 -#define TB_KEY_CTRL_2 0x00 /* clash with 'CTRL_TILDE' */ -#define TB_KEY_CTRL_A 0x01 -#define TB_KEY_CTRL_B 0x02 -#define TB_KEY_CTRL_C 0x03 -#define TB_KEY_CTRL_D 0x04 -#define TB_KEY_CTRL_E 0x05 -#define TB_KEY_CTRL_F 0x06 -#define TB_KEY_CTRL_G 0x07 -#define TB_KEY_BACKSPACE 0x08 -#define TB_KEY_CTRL_H 0x08 /* clash with 'CTRL_BACKSPACE' */ -#define TB_KEY_TAB 0x09 -#define TB_KEY_CTRL_I 0x09 /* clash with 'TAB' */ -#define TB_KEY_CTRL_J 0x0A -#define TB_KEY_CTRL_K 0x0B -#define TB_KEY_CTRL_L 0x0C -#define TB_KEY_ENTER 0x0D -#define TB_KEY_CTRL_M 0x0D /* clash with 'ENTER' */ -#define TB_KEY_CTRL_N 0x0E -#define TB_KEY_CTRL_O 0x0F -#define TB_KEY_CTRL_P 0x10 -#define TB_KEY_CTRL_Q 0x11 -#define TB_KEY_CTRL_R 0x12 -#define TB_KEY_CTRL_S 0x13 -#define TB_KEY_CTRL_T 0x14 -#define TB_KEY_CTRL_U 0x15 -#define TB_KEY_CTRL_V 0x16 -#define TB_KEY_CTRL_W 0x17 -#define TB_KEY_CTRL_X 0x18 -#define TB_KEY_CTRL_Y 0x19 -#define TB_KEY_CTRL_Z 0x1A -#define TB_KEY_ESC 0x1B -#define TB_KEY_CTRL_LSQ_BRACKET 0x1B /* clash with 'ESC' */ -#define TB_KEY_CTRL_3 0x1B /* clash with 'ESC' */ -#define TB_KEY_CTRL_4 0x1C -#define TB_KEY_CTRL_BACKSLASH 0x1C /* clash with 'CTRL_4' */ -#define TB_KEY_CTRL_5 0x1D -#define TB_KEY_CTRL_RSQ_BRACKET 0x1D /* clash with 'CTRL_5' */ -#define TB_KEY_CTRL_6 0x1E -#define TB_KEY_CTRL_7 0x1F -#define TB_KEY_CTRL_SLASH 0x1F /* clash with 'CTRL_7' */ -#define TB_KEY_CTRL_UNDERSCORE 0x1F /* clash with 'CTRL_7' */ -#define TB_KEY_SPACE 0x20 -#define TB_KEY_BACKSPACE2 0x7F -#define TB_KEY_CTRL_8 0x7F /* clash with 'DELETE' */ -/* These are non-existing ones. - * - * #define TB_KEY_CTRL_1 clash with '1' - * #define TB_KEY_CTRL_9 clash with '9' - * #define TB_KEY_CTRL_0 clash with '0' - */ - -/* Wait for an event up to 'timeout' milliseconds and fill the 'event' - * structure with it, when the event is available. Returns the type of the - * event (one of TB_EVENT_* constants) or -1 if there was an error or 0 in case - * there were no event during 'timeout' period. - */ -int tb_peek_event(struct tb_event *event, int timeout); - -/* Wait for an event forever and fill the 'event' structure with it, when the - * event is available. Returns the type of the event (one of TB_EVENT_* - * constants) or -1 if there was an error. - */ -int tb_poll_event(struct tb_event *event); - - - -/*** 3. Utility utf8 functions. */ -#define TB_EOF -1 -int tb_utf8_char_length(char c); -int tb_utf8_char_to_unicode(uint32_t *out, const char *c); -int tb_utf8_unicode_to_char(char *out, uint32_t c); - -#ifdef __cplusplus -} -#endif diff --git a/cpp/termbox/utf8.c b/cpp/termbox/utf8.c deleted file mode 100644 index 26c0c27b..00000000 --- a/cpp/termbox/utf8.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "termbox.h" - -static const unsigned char utf8_length[256] = { - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1 -}; - -static const unsigned char utf8_mask[6] = { - 0x7F, - 0x1F, - 0x0F, - 0x07, - 0x03, - 0x01 -}; - -int tb_utf8_char_length(char c) -{ - return utf8_length[(unsigned char)c]; -} - -int tb_utf8_char_to_unicode(uint32_t *out, const char *c) -{ - if (*c == 0) - return TB_EOF; - - int i; - unsigned char len = tb_utf8_char_length(*c); - unsigned char mask = utf8_mask[len-1]; - uint32_t result = c[0] & mask; - for (i = 1; i < len; ++i) { - result <<= 6; - result |= c[i] & 0x3f; - } - - *out = result; - return (int)len; -} - -int tb_utf8_unicode_to_char(char *out, uint32_t c) -{ - int len = 0; - int first; - int i; - - if (c < 0x80) { - first = 0; - len = 1; - } else if (c < 0x800) { - first = 0xc0; - len = 2; - } else if (c < 0x10000) { - first = 0xe0; - len = 3; - } else if (c < 0x200000) { - first = 0xf0; - len = 4; - } else if (c < 0x4000000) { - first = 0xf8; - len = 5; - } else { - first = 0xfc; - len = 6; - } - - for (i = len - 1; i > 0; --i) { - out[i] = (c & 0x3f) | 0x80; - c >>= 6; - } - out[0] = c | first; - - return len; -} diff --git a/cpp/test_all_layers b/cpp/test_all_layers deleted file mode 100755 index 4117dde0..00000000 --- a/cpp/test_all_layers +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -for f in [0-9]* -do - echo "=== $f" - ./build_and_test_until $f || exit 0 -done diff --git a/cpp/vimrc.vim b/cpp/vimrc.vim deleted file mode 100644 index 42d17fc0..00000000 --- a/cpp/vimrc.vim +++ /dev/null @@ -1,36 +0,0 @@ -" Highlighting literate directives in C++ sources. -function! HighlightTangledFile() - set comments-=:// - set comments-=n:// - set comments+=n://:,n:// - - syntax region tangleDirective start=+:(+ skip=+".*"+ end=+)+ - highlight link tangleDirective Delimiter - syntax match traceContains /^+.*/ - highlight traceContains ctermfg=darkgreen - syntax match traceAbsent /^-.*/ - highlight traceAbsent ctermfg=darkred - syntax match tangleScenarioSetup /^\s*% .*/ | highlight link tangleScenarioSetup SpecialChar - " Our C++ files can have mu code in scenarios, so highlight mu comments like - " regular comments. - syntax match muComment /# .*$/ | highlight link muComment Comment - syntax match muSalientComment /##.*$/ | highlight link muSalientComment SalientComment - syntax match muCommentedCode /#? .*$/ | highlight link muCommentedCode CommentedCode - " Tangled comments only make sense in the sources and are stripped out of - " the generated .cc file. They're highlighted same as regular comments. - syntax match tangledComment /\/\/:.*/ | highlight link tangledComment Comment - syntax match tangledSalientComment /\/\/::.*/ | highlight link tangledSalientComment SalientComment - " Include some bare-bones mu highlighting even in the C++ sources. - syntax match muAssign " <- " | highlight link muAssign SpecialChar - syntax match muAssign "\<raw\>" -endfunction -call HighlightTangledFile() -autocmd BufRead,BufNewFile *.mu set ft=mu -autocmd BufRead,BufNewFile [0-9]* call HighlightTangledFile() - -" Scenarios considered: -" opening or starting vim with a new or existing file without an extension (should interpret as C++) -" opening or starting vim with a new or existing file with a .mu extension -" starting vim or opening a buffer without a file name (ok to do nothing) -" opening a second file in a new or existing window (shouldn't mess up existing highlighting) -" reloading an existing file (shouldn't mess up existing highlighting) diff --git a/cpp/x.mu b/cpp/x.mu deleted file mode 100644 index 0d40a4a7..00000000 --- a/cpp/x.mu +++ /dev/null @@ -1,5 +0,0 @@ -recipe main [ - 12:integer <- copy 1:literal - 13:integer <- copy 3:literal - 11:integer <- add 12:integer, 13:integer -] |