diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-05 21:31:53 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:04:56 +0100 |
| commit | b8918cb89ada945d92c720446177f1ef5185b5a5 (patch) | |
| tree | 4184c110c85e04d55dd71a6f5b0b440624e671a7 /apt-pkg/solver3.h | |
| parent | a9587b39ea6776b1d1324288786176102f65cee5 (diff) | |
solver3: Reject reverse dependencies natively
Instead of utilizing the reverse depends functionality of the cache
and marking all possible reverse dependencies for removal, mark them
ourselves by keeping track of reverse-implication-clauses.
Notably, this improves the reverse dependency rejection substantially:
The previous RejectReverseDependencies() function did not handle
Provides.
For this to work correctly right now, we need to discover optional
clauses too when queuing them. This is somewhat suboptimal as we
technically we don't care if they become unsat, we just waste time
tracking them.
The tests get a bit awkward, but oh well, we use what we can
use.
Diffstat (limited to 'apt-pkg/solver3.h')
| -rw-r--r-- | apt-pkg/solver3.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index da75179d5..91b852c98 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -248,14 +248,10 @@ class Solver // \brief Enqueue dependencies shared by all versions of the package. void RegisterCommonDependencies(pkgCache::PkgIterator Pkg); - // \brief Reject reverse dependencies. Must call std::make_heap() after. - [[nodiscard]] bool RejectReverseDependencies(pkgCache::VerIterator Ver); // \brief Translate an or group into a clause object [[nodiscard]] Clause TranslateOrGroup(pkgCache::DepIterator start, pkgCache::DepIterator end, Var reason); // \brief Propagate all pending propagations [[nodiscard]] bool Propagate(); - // \brief Propagate a rejection of a variable - [[nodiscard]] bool PropagateReject(Var var); // \brief Return the current depth (choices.size() with casting) depth_type depth() @@ -470,6 +466,8 @@ struct APT::Solver::State // \brief Clauses owned by this package/version std::vector<std::unique_ptr<Clause>> clauses; + // \brief Reverse clauses, that is dependencies (or conflicts) from other packages on this one + std::vector<const Clause *> rclauses; }; /** |
