Skip to content

Commit 7860c96

Browse files
checkSubstitutionCoverage: check for constructor-like configuration (#2015)
* First attempt * Check for constructor-like configuration * Update golden * Addressed comments * Add integration test
1 parent b46f0c6 commit 7860c96

File tree

7 files changed

+22
-48
lines changed

7 files changed

+22
-48
lines changed

kore/src/Kore/Log/ErrorRewritesInstantiation.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import Control.Exception
1515
( Exception (..)
1616
, throw
1717
)
18-
import qualified Data.Foldable as Foldable
19-
import qualified Data.Map.Strict as Map
2018
import Data.Set
2119
( Set
2220
)
@@ -40,7 +38,9 @@ import Kore.Internal.Conditional
4038
import Kore.Internal.Pattern
4139
( Pattern
4240
)
43-
import qualified Kore.Internal.Substitution as Substitution
41+
import Kore.Internal.TermLike
42+
( isConstructorLike
43+
)
4444
import Kore.Internal.Variable
4545
( SomeVariableName
4646
)
@@ -158,8 +158,6 @@ checkSubstitutionCoverage configuration solution
158158
substitutionCoverageError =
159159
SubstitutionCoverageError { solution, missingVariables }
160160

161-
Conditional { substitution } = solution
162-
substitutionVariables = Map.keysSet (Substitution.toMap substitution)
163161
missingVariables = wouldNarrowWith solution
164162
isCoveringSubstitution = Set.null missingVariables
165-
isSymbolic = Foldable.any isSomeConfigVariableName substitutionVariables
163+
isSymbolic = (not . isConstructorLike) (term configuration)

test/imp/disjunction-in-simplification-spec.k

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/imp/disjunction-in-simplification-spec.k.out.golden

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/issue-2010/1.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f()

test/issue-2010/1.test.out.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<k>
2+
I:Int ~> .
3+
</k>

test/issue-2010/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(CURDIR)/../include.mk

test/issue-2010/test.k

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module TEST
2+
imports BOOL
3+
imports INT
4+
5+
syntax MaybeInt ::= "Some" Int
6+
| "None"
7+
syntax MaybeInt ::= f() [function, functional, no-evaluators]
8+
9+
configuration <k> f() </k>
10+
11+
rule <k> None => true ... </k>
12+
rule <k> Some I => I ... </k>
13+
endmodule

0 commit comments

Comments
 (0)