Skip to content

Commit

Permalink
Reshuffle SimplifyImplicationResult
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Aug 9, 2023
1 parent 27c81b4 commit 3f22ee1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions kore-rpc-types/src/Kore/JsonRpc/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ data GetModelResult = GetModelResult

data SimplifyImplicationResult = SimplifyImplicationResult
{ validity :: ImplicationValidityResult
, substitution :: Maybe KoreJson
, logs :: Maybe [LogEntry]
}
deriving stock (Generic, Show, Eq)
Expand All @@ -187,8 +188,8 @@ data SimplifyImplicationResult = SimplifyImplicationResult
via CustomJSON '[OmitNothingFields, FieldLabelModifier '[CamelToKebab]] SimplifyImplicationResult

data ImplicationValidityResult
= -- | implication is valid, constrained substitution returned
ImplicationValid KoreJson
= -- | implication is valid
ImplicationValid
| -- | implication is invalid, explains why
ImplicationInvalid ImplicationInvalidReason
| -- | implication is unknown, explains why
Expand All @@ -199,16 +200,20 @@ data ImplicationValidityResult
via CustomJSON '[] ImplicationValidityResult

data ImplicationInvalidReason
= MatchingFailed KoreJson
| ConstraintSubsumptionFailed KoreJson
= -- | antecedent and consequent do not match
MatchingFailed Text
| -- | matching was successful, but constraints don't agree: return unsatisfiable core of constraints
ConstraintSubsumptionFailed KoreJson
deriving stock (Generic, Show, Eq)
deriving
(FromJSON, ToJSON)
via CustomJSON '[] ImplicationInvalidReason

data ImplicationUnknownReason
= MatchingUnknown KoreJson
| ConstraintSubsumptionUnknown KoreJson
= -- | matching between antecedent and consequent is indeterminate, return the subterms that caused this
MatchingUnknown KoreJson KoreJson
| -- | matching was successful, but constraint subsumption is indeterminate: return unknown constraints
ConstraintSubsumptionUnknown KoreJson
deriving stock (Generic, Show, Eq)
deriving
(FromJSON, ToJSON)
Expand Down

0 comments on commit 3f22ee1

Please sign in to comment.