Skip to content

Remove duplicates when generating a kore term from a substitution #3936

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

Merged
merged 2 commits into from
Jun 13, 2024
Merged
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
3 changes: 3 additions & 0 deletions kore/src/Kore/Syntax/Json.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Data.Aeson as Json
import Data.Aeson.Encode.Pretty as Json
import Data.ByteString.Lazy (ByteString)
import Data.Either.Extra hiding (Left, Right)
import Data.Set qualified as Set
import Kore.Attribute.Attributes (ParsedPattern)
import Kore.Internal.Predicate (Predicate)
import Kore.Internal.Predicate qualified as Predicate
Expand Down Expand Up @@ -124,6 +125,8 @@ fromSubstitution sort subst
. fromTermLike
. foldl1 TermLike.mkAnd
. map toEquals
. Set.toList
. Set.fromList
Comment on lines +128 to +129
Copy link
Member

Choose a reason for hiding this comment

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

Of course this only addresses cases where the same Assignment is duplicated in the substitution.
In booster there is code (in the pattern internalisation) which vets sets of assignments to decide what is a true substitution and what isn't.
If we continue to have problem reports we should find out whether and where kore generates invalid substitutions

. Substitution.unwrap
$ subst
where
Expand Down
Loading