anchor.diff:  
       let rec improveModel (filteredVersions:Map<PackageName, (SemVerInfo list * bool)>,packages:ResolvedPackage list,closed:Set<PackageRequirement>,stillOpen:Set<PackageRequirement>) =
           if Set.isEmpty stillOpen then
  +            // we're done. check if we have a valid resolution and return it
               let isOk =
                   filteredVersions
                   |> Map.forall (fun _ v ->
  
positive.code:             failwith !errorText
  
  
  let calcOpenRequirements (exploredPackage:ResolvedPackage,versionToExplore,dependency,closed:Set<PackageRequirement>,stillOpen:Set<PackageRequirement>,rest:Set<PackageRequirement>) =
      let dependenciesByName =
          // there are packages which define multiple dependencies to the same package
          // we just take the latest one - see #567
          let hashSet = new HashSet<_>()
          exploredPackage.Dependencies
          |> Set.filter (fun (name,_,_) -> hashSet.Add name)
                          
      dependenciesByName
      |> Set.map (fun (n,v,r) -> {dependency with Name = n; VersionRequirement = v; Parent = Package(dependency.Name,versionToExplore); FrameworkRestrictions = r })
  
negative.code:                             List.filter (fun v -> dependency.VersionRequirement.IsInRange(v,dependency.Parent.IsRootRequirement() |> not)) versions
                          versions,filtered,false
  
              if compatibleVersions = [] && dependency.Parent.IsRootRequirement() then    
                  let versionText = String.Join(Environment.NewLine + "     - ",List.sort allVersions)
                  failwithf "Could not find compatible versions for top level dependency:%s     %A%s   Available versions:%s     - %s%s   Try to relax the dependency or allow prereleases." 
                      Environment.NewLine (dependency.ToString()) Environment.NewLine Environment.NewLine versionText Environment.NewLine
                  
              let sorted =                
                  if dependency.Parent.IsRootRequirement() then
                      List.sort compatibleVersions |> List.rev
                  else
                      match dependency.ResolverStrategy with
                      | ResolverStrategy.Max -> List.sort compatibleVersions |> List.rev
                      | ResolverStrategy.Min -> List.sort compatibleVersions
  