-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from tnelson/dev
[minor] test messages, Sterling menu filtering, fix
- Loading branch information
Showing
18 changed files
with
204 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Forge models for end-to-end testing | ||
|
||
These models aren't meant to illustrate any particular concept, but rather are used for | ||
end-to-end testing of the Sterling<->Forge<->Solver workflow. They may use unusual syntax, | ||
unsafe features, etc. |
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 @@ | ||
#lang forge | ||
|
||
option no_overflow true // disallow integer overflow | ||
|
||
sig Pigeon {location: one Pigeonhole} | ||
sig Pigeonhole {} | ||
|
||
pred some_roommates { | ||
some disj p1, p2: Pigeon | p1.location = p2.location | ||
} | ||
-- This should pass; we don't expect Sterling to open at all. | ||
assert {#Pigeon > #Pigeonhole} is sufficient for some_roommates | ||
-- This should fail; we expect Sterling to open with **only one command**, | ||
-- and for the instance to auto-load. **The evaluator should be usable**. | ||
assert {#Pigeon >= #Pigeonhole} is sufficient for some_roommates | ||
|
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,21 @@ | ||
#lang forge | ||
|
||
option no_overflow true // disallow integer overflow | ||
|
||
sig Pigeon {location: one Pigeonhole} | ||
sig Pigeonhole {} | ||
|
||
pred some_roommates { | ||
some disj p1, p2: Pigeon | p1.location = p2.location | ||
} | ||
|
||
// This fails because the instance given violates the type definitions | ||
// The solver yields unsat, so Sterling should not open. | ||
example threePigeons is {some_roommates} for { | ||
Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 | ||
Pigeonhole = `Pigeonhole0 + `Pigeonhole1 | ||
// This violates the type declarations: | ||
location = `Pigeon0 -> (`Pigeonhole0 + `Pigeonhole1) + | ||
`Pigeon1 -> `Pigeonhole0 + | ||
`Pigeon2 -> `Pigeonhole0 | ||
} |
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,19 @@ | ||
#lang forge | ||
|
||
option no_overflow true // disallow integer overflow | ||
|
||
sig Pigeon {location: one Pigeonhole} | ||
sig Pigeonhole {} | ||
|
||
pred some_roommates { | ||
some disj p1, p2: Pigeon | p1.location = p2.location | ||
} | ||
|
||
// This fails. Since the solver has yielded unsat, Sterling shouldn't open. | ||
example threePigeons is {not some_roommates} for { | ||
Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 | ||
Pigeonhole = `Pigeonhole0 + `Pigeonhole1 | ||
location = `Pigeon0 -> `Pigeonhole0 + | ||
`Pigeon1 -> `Pigeonhole0 + | ||
`Pigeon2 -> `Pigeonhole1 | ||
} |
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,18 @@ | ||
#lang forge | ||
|
||
option no_overflow true // disallow integer overflow | ||
|
||
sig Pigeon {location: one Pigeonhole} | ||
sig Pigeonhole {} | ||
|
||
pred some_roommates { | ||
some disj p1, p2: Pigeon | p1.location = p2.location | ||
} | ||
|
||
example threePigeons is some_roommates for { | ||
Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 | ||
Pigeonhole = `Pigeonhole0 + `Pigeonhole1 | ||
location = `Pigeon0 -> `Pigeonhole0 + | ||
`Pigeon1 -> `Pigeonhole0 + | ||
`Pigeon2 -> `Pigeonhole1 | ||
} |
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,19 @@ | ||
#lang forge | ||
|
||
option no_overflow true // disallow integer overflow | ||
|
||
sig Pigeon {location: one Pigeonhole} | ||
sig Pigeonhole {} | ||
|
||
pred some_roommates { | ||
some disj p1, p2: Pigeon | p1.location = p2.location | ||
} | ||
test expect { | ||
-- This is satisfiable, and so should appear in the run menu. | ||
not_vacuous: {#Pigeon > #Pigeonhole} is sat | ||
-- This is unsatisfiable, and so wouldn't be useful to visualize. | ||
should_be_unsat: {Pigeon != Pigeon} is unsat | ||
} | ||
|
||
see_principle_1: run {} for exactly 5 Pigeon, exactly 4 Pigeonhole | ||
see_principle_2: run {} for exactly 4 Pigeon, exactly 3 Pigeonhole |
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
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
Oops, something went wrong.