@@ -32,6 +32,8 @@ data SolverState =
32 , domainStore :: M.Map Var ( Domain
32 , domainStore :: M.Map Var ( Domain
33 , S.Set ConstraintFC -- constraints that effected this variable
33 , S.Set ConstraintFC -- constraints that effected this variable
35+ , cons_lhs :: M.Map Var (S.Set ConstraintFC)
36+ , cons_rhs :: M.Map Var (S.Set ConstraintFC)
37data Queue = Queue [ConstraintFC] (S.Set UConstraint)
39data Queue = Queue [ConstraintFC] (S.Set UConstraint)
@@ -60,6 +62,8 @@ solve maxUniverseLevel ucs =
60 , v <- varsIn c
62 , v <- varsIn c
65+ , cons_lhs = constraintsLHS
66+ , cons_rhs = constraintsRHS
65 lhs (ULT (UVar x) _) = Just (Var x)
69 lhs (ULT (UVar x) _) = Just (Var x)
@@ -175,8 +179,9 @@ solve maxUniverseLevel ucs =
176 -- | add all constraints (with the given var on the lhs) to the queue
180 -- | add all constraints (with the given var on the lhs) to the queue
177 addToQueueLHS :: MonadState SolverState m => UConstraint -> Var -> m ()
181 addToQueueLHS :: MonadState SolverState m => UConstraint -> Var -> m ()
178− addToQueueLHS thisCons var =
182+ addToQueueLHS thisCons var = do
183+ clhs <- gets cons_lhs
179− case M.lookup var constraintsLHS of
184+ case M.lookup var clhs of
180 Nothing -> return ()
185 Nothing -> return ()
181 Just cs -> do
186 Just cs -> do
182 Queue list set <- gets queue
187 Queue list set <- gets queue
@@ -189,8 +194,9 @@ solve maxUniverseLevel ucs =
190 -- | add all constraints (with the given var on the rhs) to the queue
195 -- | add all constraints (with the given var on the rhs) to the queue
191 addToQueueRHS :: MonadState SolverState m => UConstraint -> Var -> m ()
196 addToQueueRHS :: MonadState SolverState m => UConstraint -> Var -> m ()
192− addToQueueRHS thisCons var =
197+ addToQueueRHS thisCons var = do
198+ crhs <- gets cons_rhs
193− case M.lookup var constraintsRHS of
199+ case M.lookup var crhs of
194 Nothing -> return ()
200 Nothing -> return ()
195 Just cs -> do
201 Just cs -> do
196 Queue list set <- gets queue
202 Queue list set <- gets queue