anchor.diff:  %% make sure a given name/vsn meets all current constraints
   -spec valid_version(pkg_name(),vsn(),constraints()) -> boolean().
   valid_version(PkgName, Vsn, PkgConstraints) ->
  -    lists:all(fun (L) ->
  +    lists:all(fun ({L, _ConstraintSrc}) ->
                         is_version_within_constraint(Vsn, L)
                 end,
                 get_constraints(PkgConstraints, PkgName)).
  
positive.code: pkgs(DepGraph, Visited, Pkg, Constraints, OtherPkgs) ->
      F = fun (Vsn) ->
                  Deps = get_dep_constraints(DepGraph, Pkg, Vsn),
                  UConstraints = extend_constraints(Constraints, [{Pkg, Vsn} | Deps]),
                  DepPkgs =[dep_pkg(Dep) || Dep <- Deps],
                  NewVisited = [Pkg | Visited],
                  all_pkgs(DepGraph, NewVisited, DepPkgs ++ OtherPkgs, UConstraints)
          end,
      lists_some(F, constrained_package_versions(DepGraph, Pkg, Constraints)).
  
  
  %% @doc This gathers the dependency constraints for a given package vsn from the
  
negative.code:             {value, {PkgName, Constraints0}} ->
                  Constraints0
          end,
      [{PkgName, [{PkgConstraint, {SrcPkg, SrcVsn}} | Constraints1]} |
       lists:keydelete(PkgName, 1, PkgsConstraints)].
  
  %% @doc
  %% Extend the currently active constraints correctly for the given constraints.
  -spec extend_constraints(pkg_name(), vsn(), constraints(),constraints()) -> [{pkg_name(), constraints()}].
  extend_constraints(SrcPkg, SrcVsn, ExistingConstraints0, NewConstraints) ->
      lists:foldl(fun (Constraint, ExistingConstraints1) ->
                          add_constraint(SrcPkg, SrcVsn, ExistingConstraints1, Constraint)
                  end,
                  ExistingConstraints0, [{SrcPkg, SrcVsn} | NewConstraints]).
  
  -spec normalize_version(vsn()) -> vsn().
  normalize_version({M}) ->
  