-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test that old singletons behavior is preserved when command is …
…used to disable new singletons-by-default behavior Note that it's a matter of "if these two branches of logic didn't necessarily have to test the same WME from the perspective of the backtracing, it's just by happenstance that they did" where the new behavior is "and so because they did ultimately test the same superstate wme, we won't generalize to say that potentially this logic would have happened had they tested different wmes". The old behavior was basically "and so we'll generalize that if different wmes lead to those same logic traces in the future, we'll already have the chunk"
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...ng/expected/ChunkingTests_Superstate_Identity_Opaque_Old_Singleton_Behavior_expected.soar
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,7 @@ | ||
sp {answer*make*t2-1 | ||
(state <s1> ^superstate nil ^foo2 { <f1> <> homer } ^foo { <f2> <> bart } | ||
^foo { <f3> <> simpson }) | ||
--> | ||
(<s1> ^test-done true) | ||
} | ||
|
76 changes: 76 additions & 0 deletions
76
...gents/Chunking/tests/ChunkingTests_Superstate_Identity_Opaque_Old_Singleton_Behavior.soar
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,76 @@ | ||
# Tests: | ||
# - Two conditions in two tests backtraced through that test the same constant in the same wme in the top state | ||
# - Should not appear as same condition or variable in chunk | ||
# - Two conditions in two tests backtraced through, one that tests a constant in the top state and one | ||
# that tests a copy of it made on the top state | ||
|
||
srand 23 | ||
chunk always | ||
chunk automatically-create-singletons off | ||
|
||
sp {init-superstate | ||
(state <s> ^superstate nil) | ||
--> | ||
(<s> ^foo bar) | ||
(write (crlf) |Starting chunking unit test.|) | ||
} | ||
|
||
sp {elab-superstate | ||
(state <s> ^{ << foo foot >> <a> } <v>) | ||
--> | ||
(<s> ^foo2 <v>) | ||
(write (crlf) |Starting chunking unit test.|) | ||
} | ||
|
||
sp {apply*test-done | ||
(state <s> ^superstate nil ^test-done) | ||
--> | ||
(write (crlf) |Chunk produced. Test completed.|) | ||
(succeeded) | ||
(interrupt) | ||
} | ||
|
||
sp {apply*test-failed | ||
(state <s> ^superstate.superstate.superstate.superstate nil) | ||
--> | ||
(write (crlf) |Chunk not produced. Test failed.|) | ||
(interrupt) | ||
} | ||
|
||
sp {propose*test | ||
(state <s> ^superstate.superstate nil) | ||
--> | ||
(<s> ^operator <o> +)} | ||
|
||
sp {apply-bt1 | ||
(state <s> ^operator | ||
^superstate <ss>) | ||
(<ss> ^foo {<> bart <x>} | ||
^foo2 {<> homer <z>}) | ||
--> | ||
(<s> ^continue1 true) | ||
} | ||
|
||
sp {apply-bt2 | ||
(state <s> ^operator | ||
^superstate <ss>) | ||
(<ss> ^foo {<> simpson <y>}) | ||
--> | ||
(<s> ^continue2 true) | ||
} | ||
|
||
sp {apply-bt3 | ||
(state <s> ^operator | ||
^superstate <ss>) | ||
--> | ||
(<s> ^continue3 true) | ||
} | ||
|
||
sp {make | ||
(state <s> ^operator | ||
^continue1 | ||
^continue2 | ||
^superstate <ss>) | ||
--> | ||
(<ss> ^test-done true +) | ||
} |
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