You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chr-core/src/CHR/Solve/MonoBacktrackPrio.hs
+19-32Lines changed: 19 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -155,25 +155,16 @@ type WorkInx = WorkTime
155
155
156
156
typeWorkInxSet=IntSet.IntSet
157
157
158
-
dataWorkOrFreeListcnstr
159
-
=WorkWork
160
-
{_worfWork::!(Workcnstr)
161
-
}
162
-
| WorkFreeList
163
-
{_worfNext:: {-# UNPACK #-} !WorkTime
164
-
}
165
-
166
158
dataWorkStorecnstr
167
159
=WorkStore
168
160
{_wkstoreTrie::!(TT.TreeTrie (TT.TrTrKeycnstr) [WorkInx]) --^ map from the search key of a constraint to index in table
169
-
, _wkstoreTable::!(IntMap.IntMap (WorkOrFreeListcnstr)) --^ all the work ever entered. FIXME: do GC. Infra in place but need to ensure it can be safely done because trace/etc gathers work via inx instead of directly
161
+
, _wkstoreTable::!(IntMap.IntMap (Workcnstr)) --^ all the work ever entered. FIXME: do GC
170
162
, _wkstoreNextFreeWorkInx:: {-# UNPACK #-} !WorkTime--^ Next free work/constraint identification, used by solving to identify whether a rule has been used for a constraint.
171
-
, _wkstoreNextFreeListInx:: {-# UNPACK #-} !WorkTime--^ Next free work/constraint identification, used by solving to identify whether a rule has been used for a constraint.
@@ -257,7 +248,7 @@ data CHRGlobState cnstr guard bprio prio subst env m
257
248
{_chrgstStore::!(CHRStorecnstrguardbprioprio) --^ Actual database of rules, to be searched
258
249
, _chrgstNextFreeRuleInx:: {-# UNPACK #-} !CHRInx--^ Next free rule identification, used by solving to identify whether a rule has been used for a constraint.
259
250
-- The numbering is applied to constraints inside a rule which can be matched.
260
-
, _chrgstWorkStore::!(WorkStorecnstr) --^ Actual database of solvable constraints
251
+
--, _chrgstWorkStore :: !(WorkStore cnstr) -- ^ Actual database of solvable constraints
261
252
-- , _chrgstNextFreeWorkInx :: {-# UNPACK #-} !WorkTime -- ^ Next free work/constraint identification, used by solving to identify whether a rule has been used for a constraint.
@@ -277,6 +268,7 @@ data CHRBackState cnstr bprio subst env
277
268
, _chrbstRuleWorkQueue::!WorkQueue--^ work queue for rule matching
278
269
, _chrbstSolveQueue::!WorkQueue--^ solve queue, constraints which are not solved by rule matching but with some domain specific solver, yielding variable subst constributing to backtrackable bindings
279
270
, _chrbstResidualQueue:: [WorkInx] --^ residual queue, constraints which are residual, no need to solve, etc
271
+
, _chrbstWorkStore::!(WorkStorecnstr) --^ Actual database of solvable constraints
280
272
281
273
, _chrbstMatchedCombis::!(Set.SetMatchedCombi) --^ all combis of chr + work which were reduced, to prevent this from happening a second time (when propagating)
282
274
@@ -288,8 +280,8 @@ data CHRBackState cnstr bprio subst env
-- each match expressed as the list of constraints (in the form of Work + Key) found in the workList wlTrie, thus giving all combis with constraints as part of a CHR,
1079
1063
-- partititioned on before or after last query time (to avoid work duplication later)
1080
1064
slvCandidate
1081
-
:: ( MonoBacktrackPriocgbppsem
1065
+
::forallcgbppsem
1066
+
. ( MonoBacktrackPriocgbppsem
1082
1067
-- , Ord (TTKey c), PP (TTKey c)
1068
+
-- , ExtrValVarKey (VarLookupVal s) ~ VarLookupKey s
0 commit comments