From a1d703b3c86c6842899acf0d5c6c0fe3536fa36f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 24 Apr 2015 10:20:47 -0700 Subject: 1163 --- cpp/.traces/less_than | 27 --------------------------- cpp/.traces/less_than2 | 27 --------------------------- cpp/.traces/lesser_than | 27 +++++++++++++++++++++++++++ cpp/.traces/lesser_than2 | 27 +++++++++++++++++++++++++++ cpp/024compare | 14 +++++++------- cpp/060string.mu | 4 ++-- 6 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 cpp/.traces/less_than delete mode 100644 cpp/.traces/less_than2 create mode 100644 cpp/.traces/lesser_than create mode 100644 cpp/.traces/lesser_than2 (limited to 'cpp') diff --git a/cpp/.traces/less_than b/cpp/.traces/less_than deleted file mode 100644 index 0d6b4b80..00000000 --- a/cpp/.traces/less_than +++ /dev/null @@ -1,27 +0,0 @@ -parse/0: instruction: 1 -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: 1 -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: 15 -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: less-than ... -run/0: instruction main/0 -run/0: ingredient 0 is 32 -mem/0: storing 32 in location 1 -run/0: instruction main/1 -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -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/less_than2 b/cpp/.traces/less_than2 deleted file mode 100644 index d747f82f..00000000 --- a/cpp/.traces/less_than2 +++ /dev/null @@ -1,27 +0,0 @@ -parse/0: instruction: 1 -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: 1 -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: 15 -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: less-than ... -run/0: instruction main/0 -run/0: ingredient 0 is 34 -mem/0: storing 34 in location 1 -run/0: instruction main/1 -run/0: ingredient 0 is 33 -mem/0: storing 33 in location 2 -run/0: instruction main/2 -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 new file mode 100644 index 00000000..9628c081 --- /dev/null +++ b/cpp/.traces/lesser_than @@ -0,0 +1,27 @@ +parse/0: instruction: 1 +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: 1 +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: 15 +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 ... +run/0: instruction main/0 +run/0: ingredient 0 is 32 +mem/0: storing 32 in location 1 +run/0: instruction main/1 +run/0: ingredient 0 is 33 +mem/0: storing 33 in location 2 +run/0: instruction main/2 +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 new file mode 100644 index 00000000..dc373a53 --- /dev/null +++ b/cpp/.traces/lesser_than2 @@ -0,0 +1,27 @@ +parse/0: instruction: 1 +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: 1 +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: 15 +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 ... +run/0: instruction main/0 +run/0: ingredient 0 is 34 +mem/0: storing 34 in location 1 +run/0: instruction main/1 +run/0: ingredient 0 is 33 +mem/0: storing 33 in location 2 +run/0: instruction main/2 +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/024compare b/cpp/024compare index c1e961f9..c536b23e 100644 --- a/cpp/024compare +++ b/cpp/024compare @@ -93,11 +93,11 @@ recipe main [ +mem: storing 0 in location 3 :(before "End Primitive Recipe Declarations") -LESS_THAN, +LESSER_THAN, :(before "End Primitive Recipe Numbers") -Recipe_number["less-than"] = LESS_THAN; +Recipe_number["lesser-than"] = LESSER_THAN; :(before "End Primitive Recipe Implementations") -case LESS_THAN: { +case LESSER_THAN: { trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name; vector arg0 = read_memory(instructions[pc].ingredients[0]); assert(arg0.size() == 1); @@ -111,11 +111,11 @@ case LESS_THAN: { break; } -:(scenario less_than) +:(scenario lesser_than) recipe main [ 1:integer <- copy 32:literal 2:integer <- copy 33:literal - 3:integer <- less-than 1:integer, 2:integer + 3:integer <- lesser-than 1:integer, 2:integer ] +run: instruction main/2 +run: ingredient 0 is 1 @@ -125,11 +125,11 @@ recipe main [ +run: product 0 is 1 +mem: storing 1 in location 3 -:(scenario less_than2) +:(scenario lesser_than2) recipe main [ 1:integer <- copy 34:literal 2:integer <- copy 33:literal - 3:integer <- less-than 1:integer, 2:integer + 3:integer <- lesser-than 1:integer, 2:integer ] +run: instruction main/2 +run: ingredient 0 is 1 diff --git a/cpp/060string.mu b/cpp/060string.mu index 5c17f91f..6f0929f1 100644 --- a/cpp/060string.mu +++ b/cpp/060string.mu @@ -244,7 +244,7 @@ recipe integer-to-decimal-string [ # save sign negate-result:boolean <- copy 0:literal { - negative?:boolean <- less-than n:integer, 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 @@ -273,7 +273,7 @@ recipe integer-to-decimal-string [ j:integer <- copy 0:literal { # while i >= 0 - done?:boolean <- less-than i:integer, 0:literal + 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 -- cgit 1.4.1-2-gfad0