[commit: Cabal] master: make conflict sets slightly larger (7f0e52e)
Ian Lynagh
igloo at earth.li
Fri Nov 4 18:06:32 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/7f0e52eba0bda007baff9b5184b52dd7315f56bd
>---------------------------------------------------------------
commit 7f0e52eba0bda007baff9b5184b52dd7315f56bd
Author: Andres Loeh <andres at well-typed.com>
Date: Tue Jun 21 14:06:18 2011 +0000
make conflict sets slightly larger
This is slower, however seems more correct. Larger conflict sets
typically mean fewer possibilities to cut the search space. On the
other hand, cutting too much risks incompleteness. At some later
stage, we might want to try hard to think about how/if conflict sets
could be reduced in size.
>---------------------------------------------------------------
.../Client/Dependency/Modular/Validate.hs | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Validate.hs b/cabal-install/Distribution/Client/Dependency/Modular/Validate.hs
index 3af9869..3f8b952 100644
--- a/cabal-install/Distribution/Client/Dependency/Modular/Validate.hs
+++ b/cabal-install/Distribution/Client/Dependency/Modular/Validate.hs
@@ -86,8 +86,8 @@ validate = cata go
where
go :: TreeF (GoalReasons, Scope) (Validate (Tree GoalReasons)) -> Validate (Tree GoalReasons)
- go (PChoiceF qpn (gr, sc) ts) = PChoice qpn gr <$> sequence (P.mapWithKey (goP qpn sc) ts)
- go (FChoiceF qfn (gr, _sc) b ts) = FChoice qfn gr b <$> sequence (P.mapWithKey (goF qfn gr) ts)
+ go (PChoiceF qpn (gr, sc) ts) = PChoice qpn gr <$> sequence (P.mapWithKey (goP qpn gr sc) ts)
+ go (FChoiceF qfn (gr, _sc) b ts) = FChoice qfn gr b <$> sequence (P.mapWithKey (goF qfn gr ) ts)
-- We don't need to do anything for goal choices or failure nodes.
go (GoalChoiceF ts) = GoalChoice <$> sequence ts
@@ -95,8 +95,8 @@ validate = cata go
go (FailF c fr ) = pure (Fail c fr)
-- What to do for package nodes ...
- goP :: QPN -> Scope -> I -> Validate (Tree GoalReasons) -> Validate (Tree GoalReasons)
- goP qpn@(Q _pp pn) sc i r = do
+ goP :: QPN -> GoalReasons -> Scope -> I -> Validate (Tree GoalReasons) -> Validate (Tree GoalReasons)
+ goP qpn@(Q _pp pn) gr sc i r = do
PA ppa pfa <- asks pa -- obtain current preassignment
idx <- asks index -- obtain the index
svd <- asks saved -- obtain saved dependencies
@@ -111,7 +111,7 @@ validate = cata go
let nsvd = M.insert qpn qdeps svd
case mnppa of
Left (c, d) -> -- We have an inconsistency. We can stop.
- return (Fail c (Conflicting d))
+ return (Fail (c `S.union` goalReasonsToVars gr) (Conflicting d))
Right nppa -> -- We have an updated partial assignment for the recursive validation.
local (\ s -> s { pa = PA nppa pfa, saved = nsvd }) r
More information about the Cvs-libraries
mailing list