Skip to content
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
3 changes: 1 addition & 2 deletions kore/src/Kore/Rewrite/Axiom/Matcher.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import Data.PQueue.Min (
MinQueue,
)
import Data.PQueue.Min qualified as MinQueue
import Data.Sequence (Seq ((:|>)))
import Data.Sequence qualified as Seq
import Data.Set (
Set,
Expand Down Expand Up @@ -445,7 +444,7 @@ patternMatch' sideCondition ((MatchItem pat subject boundVars boundSet) : rest)
then
let (start, l2') = Seq.splitAt (length l1) l2
in decomposeList $
(var1, List.asInternal tools sort (l2' :|> var2))
(var1, mkApplySymbol symbol1 [List.asInternal tools sort l2', var2])
: zip (toList l1) (toList start)
else failMatch "subject list is too short"
(App_ symbol1 children1, App_ symbol2 children2) ->
Expand Down
10 changes: 10 additions & 0 deletions kore/test/Test/Kore/Rewrite/Axiom/Matcher.hs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,16 @@ test_matching_List =
[ (inject xInt, two)
, (yList, mkList [one])
]
, matches
"framed-list pattern preserves nonempty subject prefix"
(prefixList [one] xList)
(prefixList [one, two] yList)
[(xList, prefixList [two] yList)]
, matches
"framed-list pattern preserves empty subject prefix"
(prefixList [one] xList)
(prefixList [one] yList)
[(xList, prefixList [] yList)]
]
where
xList = inject $ configElementVariableFromId (testId "xList") Mock.listSort
Expand Down
Loading