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

Emit KoreJson \right-assoc for collections #3651

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ hie.yaml
.hie/
.direnv
*~
.DS_Store
1 change: 1 addition & 0 deletions kore/src/Kore/Builtin/Endianness/Endianness.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ License : BSD-3-Clause
module Kore.Builtin.Endianness.Endianness (
Endianness (..),
toApplication,
toSymbol,
) where

import Data.Functor.Const
Expand Down
1 change: 1 addition & 0 deletions kore/src/Kore/Builtin/Signedness/Signedness.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ License : BSD-3-Clause
module Kore.Builtin.Signedness.Signedness (
Signedness (..),
toApplication,
toSymbol,
) where

import Data.Functor.Const
Expand Down
8 changes: 4 additions & 4 deletions kore/src/Kore/Syntax/Json.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import Kore.Internal.Substitution qualified as Substitution
import Kore.Internal.TermLike qualified as TermLike
import Kore.Internal.TermLike.TermLike (TermLike)
import Kore.Syntax qualified as Kore
import Kore.Syntax.Json.Internal
import Kore.Syntax.Json.Internal hiding (fromTermLike)
import Kore.Syntax.Json.Internal qualified
import Kore.Syntax.Variable (VariableName (..))
import Prelude.Kore

Expand Down Expand Up @@ -100,15 +101,14 @@ prettyJsonOpts =
fromTermLike :: TermLike VariableName -> KoreJson
fromTermLike =
addHeader
. fromPattern
. from @_ @(Kore.Pattern _ (TermLike.TermAttributes VariableName))
. Kore.Syntax.Json.Internal.fromTermLike
Comment on lines -103 to +104
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should completely delete Internal.fromPattern and rewrite the unit tests to use the new fromTermLike to retain the test coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the best way to go about this is tbh. fromPattern is basically unused, but we use the inverse toParsedPattern in a lot of places. The problem is we go from KorePattern to ParsedPattern which at some point gets turned into a TermLike which we then turn back into a KorePattern. Perhaps that path should be added and we keep the other unit tests??


fromPredicate :: Kore.Sort -> Predicate VariableName -> KoreJson
fromPredicate s = fromTermLike . Predicate.fromPredicate s

{- | represent a @'Substitution'@ as a conjunction of equalities, so

'[t1 / X1][t2 / X2]..[tn / Xn'
'[t1 / X1][t2 / X2]..[tn / Xn]'

becomes

Expand Down
Loading
Loading