-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(dataflow): Turnt the manually verified programs for reaching def…
…initions
- Loading branch information
1 parent
d70c1a1
commit 8c5c14c
Showing
13 changed files
with
236 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@main(cond: bool) { | ||
a: int = const 47; | ||
b: int = const 42; | ||
br cond .left .right; | ||
.left: | ||
b: int = const 1; | ||
c: int = const 5; | ||
jmp .end; | ||
.right: | ||
a: int = const 2; | ||
c: int = const 10; | ||
jmp .end; | ||
.end: | ||
d: int = sub a c; | ||
print d; | ||
} |
24 changes: 24 additions & 0 deletions
24
lesson4/dataflow/turnt/df_copied_from_bril/cond-args.def.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@main { | ||
a = Constant("47", false) | ||
b = Constant("42", false) | ||
cond = Argument | ||
.left | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
c = Constant("5", false) | ||
cond = Argument | ||
.right | ||
a = Constant("2", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
cond = Argument | ||
.end | ||
a = Constant("2", false) | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
c = Constant("5", false) | ||
cond = Argument | ||
d = Op("sub", ["a", "c"], [], []) | ||
} |
24 changes: 24 additions & 0 deletions
24
lesson4/dataflow/turnt/df_copied_from_bril/cond-args.defined.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@main { | ||
a = Constant("47", false) | ||
b = Constant("42", false) | ||
cond = Argument | ||
.left | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
c = Constant("5", false) | ||
cond = Argument | ||
.right | ||
a = Constant("2", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
cond = Argument | ||
.end | ||
a = Constant("2", false) | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
c = Constant("5", false) | ||
cond = Argument | ||
d = Op("sub", ["a", "c"], [], []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@main { | ||
a: int = const 47; | ||
b: int = const 42; | ||
cond: bool = const true; | ||
br cond .left .right; | ||
.left: | ||
b: int = const 1; | ||
c: int = const 5; | ||
jmp .end; | ||
.right: | ||
a: int = const 2; | ||
c: int = const 10; | ||
jmp .end; | ||
.end: | ||
d: int = sub a c; | ||
print d; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@main { | ||
a = Constant("47", false) | ||
b = Constant("42", false) | ||
cond = Constant("true", false) | ||
.left | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
c = Constant("5", false) | ||
cond = Constant("true", false) | ||
.right | ||
a = Constant("2", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
cond = Constant("true", false) | ||
.end | ||
a = Constant("2", false) | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
c = Constant("5", false) | ||
cond = Constant("true", false) | ||
d = Op("sub", ["a", "c"], [], []) | ||
} |
24 changes: 24 additions & 0 deletions
24
lesson4/dataflow/turnt/df_copied_from_bril/cond.defined.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@main { | ||
a = Constant("47", false) | ||
b = Constant("42", false) | ||
cond = Constant("true", false) | ||
.left | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
c = Constant("5", false) | ||
cond = Constant("true", false) | ||
.right | ||
a = Constant("2", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
cond = Constant("true", false) | ||
.end | ||
a = Constant("2", false) | ||
a = Constant("47", false) | ||
b = Constant("1", false) | ||
b = Constant("42", false) | ||
c = Constant("10", false) | ||
c = Constant("5", false) | ||
cond = Constant("true", false) | ||
d = Op("sub", ["a", "c"], [], []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@main { | ||
result: int = const 1; | ||
i: int = const 8; | ||
|
||
.header: | ||
# Enter body if i >= 0. | ||
zero: int = const 0; | ||
cond: bool = gt i zero; | ||
br cond .body .end; | ||
|
||
.body: | ||
result: int = mul result i; | ||
|
||
# i-- | ||
one: int = const 1; | ||
i: int = sub i one; | ||
|
||
jmp .header; | ||
|
||
.end: | ||
print result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@main { | ||
i = Constant("8", false) | ||
result = Constant("1", false) | ||
.header | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Constant("8", false) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
.body | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
.end | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Constant("8", false) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
} |
26 changes: 26 additions & 0 deletions
26
lesson4/dataflow/turnt/df_copied_from_bril/fact.defined.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@main { | ||
i = Constant("8", false) | ||
result = Constant("1", false) | ||
.header | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Constant("8", false) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
.body | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
.end | ||
cond = Op("gt", ["i", "zero"], [], []) | ||
i = Constant("8", false) | ||
i = Op("sub", ["i", "one"], [], []) | ||
one = Constant("1", false) | ||
result = Constant("1", false) | ||
result = Op("mul", ["result", "i"], [], []) | ||
zero = Constant("0", false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[envs.def] | ||
command = "bril2json < {filename} | cargo run --quiet -- --analysis def" | ||
output."def.out" = "-" | ||
|
||
# [envs.live] | ||
# command = "bril2json < {filename} | python3 ../../df.py live" | ||
# output."live.out" = "-" | ||
# | ||
# [envs.cprop] | ||
# command = "bril2json < {filename} | python3 ../../df.py cprop" | ||
# output."cprop.out" = "-" |