-
Notifications
You must be signed in to change notification settings - Fork 43
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
4059 ensures substitution #4060
Changes from 31 commits
5481f26
1e7ce61
b491b85
f98f4b5
b4502f9
aee79b7
0f6ccf5
7c7a4ba
82f0955
20c10ef
8b6fbfd
ac825e6
a6c7808
ffc4035
32a8418
7da0911
9f11343
9e47e06
ef7ea92
2f3017f
b72baf9
a6f2dd9
a08f937
900e13d
b4a3599
3b2b7d5
598c8a4
bc72188
b2ea0f8
f8f956f
c73a2c9
cc808a2
f9f0d51
c974346
9bcdc52
58f6402
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ import Booster.Pattern.Base ( | |
pattern AndTerm, | ||
) | ||
import Booster.Pattern.Pretty | ||
import Booster.Pattern.Substitution (asEquations) | ||
import Booster.Prettyprinter (renderOneLineText) | ||
import Booster.Syntax.Json (KorePattern, addHeader, prettyPattern) | ||
import Booster.Syntax.Json.Externalise (externaliseTerm) | ||
|
@@ -185,8 +186,8 @@ withTermContext t@(Term attrs _) m = | |
m | ||
|
||
withPatternContext :: LoggerMIO m => Pattern -> m a -> m a | ||
withPatternContext Pattern{term, constraints} m = | ||
let t' = foldl' AndTerm term $ Set.toList $ Set.map coerce constraints -- FIXME | ||
withPatternContext Pattern{term, constraints, substitution} m = | ||
let t' = foldl' AndTerm term . map coerce $ Set.toList constraints <> asEquations substitution | ||
Comment on lines
-188
to
+190
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we make it well-sorted? Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah no, there's a term there... |
||
in withTermContext t' m | ||
|
||
instance ToLogFormat KorePattern where | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While reading through here, I thought that
internaliseTermOrPredicates
, and any internalisation that may return aPattern
as a whole, should maybe already apply the substitution before returning the result (somewhat "normalising" the pattern before it is returned).The
internalisePattern
, in contrast, returns the parts separately and leaves it to the caller to piece them back together. This is because we use it a lot in the definition internalisation where we need the parts separately.This is more of a stylistic preference, and IDK how much fall-out it will have, so it is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very good point. I'll try putting this change in.