Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement custom parser #31

Merged
merged 27 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c9e6d39
[WIP] implement custom dsl
bsuehling Mar 9, 2024
6cf127f
implement formula parser
bsuehling Mar 9, 2024
6c583f7
fix some bugs
bsuehling Mar 10, 2024
29c6a76
feat: parse all .pg files in dir and sub-dirs
bsuehling Mar 12, 2024
513556b
feat: allow for error graphs
bsuehling Mar 12, 2024
afb9ab5
[WIP] implement json transformation
bsuehling Mar 12, 2024
982dcad
feat: implement LTL and CTL parser
bsuehling Mar 16, 2024
0e81a2f
feat: add hazards
bsuehling Mar 16, 2024
ff0f132
feat: add specifications
bsuehling Mar 16, 2024
084556a
feat: add initializations to json
bsuehling Mar 16, 2024
6b24e7d
Merge branch 'master' into feat/pg-dsl
bsuehling Mar 16, 2024
5f3f4d6
fix a bug in formula parsers
bsuehling Mar 16, 2024
1a27759
fix order of subformulas
bsuehling Mar 16, 2024
5b31551
conform to new json scheme
bsuehling Mar 16, 2024
5d368f1
fix more bugs
bsuehling Mar 16, 2024
89d8899
feat: implement type checking
bsuehling Mar 17, 2024
bc20a2f
feat: implement simple range checks
bsuehling Mar 18, 2024
a6a2364
feat: implement automatic precons
bsuehling Mar 18, 2024
69348f2
Merge branch 'master' into feat/pg-dsl
bsuehling Mar 18, 2024
ea7b9ad
fix bugs in json encoder
bsuehling Mar 18, 2024
0c61d97
Merge branch 'master' into feat/pg-dsl
bsuehling Mar 19, 2024
d0c85ae
fix: specifications use tl, not pl
bsuehling Mar 19, 2024
b1f2ba6
feat: add nofaults keyword
bsuehling Mar 20, 2024
0485c27
Merge branch 'master' into feat/pg-dsl
bsuehling Mar 20, 2024
5e64685
feat: add cli stuff
bsuehling Mar 21, 2024
392972c
fix: add missing field 'represents_fault' to json output
bsuehling Mar 21, 2024
71d64a1
chore: add pgdsl linux build
bsuehling Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
conform to new json scheme
bsuehling committed Mar 16, 2024
commit 5b31551ec29de6f03b6414b80206e4dfef315315
6 changes: 4 additions & 2 deletions pg-dsl/Jsonable.hs
Original file line number Diff line number Diff line change
@@ -84,7 +84,8 @@ instance Jsonable Trans where
[ (preState t ++ " -> " ++ postState t) .=
JsonObject
[ "precon" .= JsonNull
, "guard" .= toJson (guard t)
, "guard" .=
JsonObject ["string" .= toJson (guard t), "type" .= JsonString "pl"]
, "action" .= toJson (action t)
]
]
@@ -95,7 +96,8 @@ instance Jsonable Action where
let s = show a
in if s == ""
then JsonNull
else JsonString s
else JsonObject
["string" .= JsonString s, "type" .= JsonString "action"]

instance Jsonable Formula where
toJson :: Formula -> Json
75 changes: 60 additions & 15 deletions pg-dsl/output.json
Original file line number Diff line number Diff line change
@@ -16,14 +16,20 @@
{
"No -> No": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"No -> Yes": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
}
@@ -45,28 +51,40 @@
{
"No -> No": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"No -> Yes": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Yes -> No": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Yes -> Yes": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
}
@@ -88,28 +106,40 @@
{
"Signal -> Signal": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Signal -> Idle": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Idle -> Signal": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Idle -> Idle": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
}
@@ -139,29 +169,44 @@
{
"Busy -> Inactive": {
"precon": null,
"guard": "num == 3",
"guard": {
"string": "num == 3",
"type": "pl"
},
"action": null
}
},
{
"Busy -> Busy": {
"precon": null,
"guard": null,
"guard": {
"string": null,
"type": "pl"
},
"action": null
}
},
{
"Busy -> Idle": {
"precon": null,
"guard": "num < 3",
"guard": {
"string": "num < 3",
"type": "pl"
},
"action": null
}
},
{
"Idle -> Busy": {
"precon": null,
"guard": "LightBarrier == Signal",
"action": "num := (1 + num)"
"guard": {
"string": "LightBarrier == Signal",
"type": "pl"
},
"action": {
"string": "num := (1 + num)",
"type": "action"
}
}
}
]