-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90b1cc5
commit cfff7a5
Showing
2 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import Copilot.Compile.C99 | ||
import Copilot.Language hiding (prop) | ||
import Copilot.Language.Prelude | ||
import Copilot.Library.LTL (next) | ||
import Copilot.Library.MTL hiding (since, alwaysBeen, trigger) | ||
import Copilot.Library.PTLTL (since, previous, alwaysBeen) | ||
import qualified Copilot.Library.PTLTL as PTLTL | ||
import qualified Copilot.Library.MTL as MTL | ||
import Language.Copilot (reify) | ||
import Prelude hiding ((&&), (||), (++), (<=), (>=), (<), (>), (==), (/=), not) | ||
|
||
a :: Stream (Bool) | ||
a = extern "a" Nothing | ||
|
||
-- | testCopilot | ||
-- @ | ||
-- unimportant | ||
-- @ | ||
propTestCopilot :: Stream Bool | ||
propTestCopilot = a | ||
|
||
|
||
-- | Clock that increases in one-unit steps. | ||
clock :: Stream Int64 | ||
clock = [0] ++ (clock + 1) | ||
|
||
|
||
-- | First Time Point | ||
ftp :: Stream Bool | ||
ftp = [True] ++ false | ||
|
||
|
||
pre :: Stream Bool -> Stream Bool | ||
pre = ([False] ++) | ||
|
||
tpre :: Stream Bool -> Stream Bool | ||
tpre = ([True] ++) | ||
|
||
-- | Complete specification. Calls the C function void handler(); when | ||
-- the property is violated. | ||
spec :: Spec | ||
spec = do | ||
trigger "handlerTestCopilot" (not propTestCopilot) [] | ||
|
||
|
||
main :: IO () | ||
main = reify spec >>= compile "monitor" | ||
|