summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-12-28 16:56:28 +0100
committerJulian Andres Klode <jak@debian.org>2026-01-05 21:20:24 +0000
commit21d099878ed8c34f3b13747bcec380e0402e57a3 (patch)
treeb71ebb3a6101098729f75088d5c3fc5ce6432de8 /apt-pkg/solver3.h
parentbd0738fdd9aff3016230b3b5466e9498c58e4fb8 (diff)
solver3: Rename decision to assignment
The previous use of decision here conflicted with the use of decision level and the general notion of having made a decision, because the assignment might have been propagated as a matter of fact.
Diffstat (limited to 'apt-pkg/solver3.h')
-rw-r--r--apt-pkg/solver3.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index 23ae49297..94f70fb56 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -250,9 +250,9 @@ constexpr Lit Solver::Var::operator~() const
return ~Lit(*this);
}
-inline LiftedBool operator~(LiftedBool decision)
+inline LiftedBool operator~(LiftedBool value)
{
- switch (decision)
+ switch (value)
{
case LiftedBool::Undefined:
return LiftedBool::Undefined;
@@ -385,7 +385,7 @@ class Solver
// Assume a literal
[[nodiscard]] bool Assume(Lit lit, const Clause *reason = nullptr);
- // Enqueue a decision fact
+ // Enqueue a fact
[[nodiscard]] bool Enqueue(Lit lit, const Clause *reason = nullptr);
// \brief Solve the dependencies
@@ -397,15 +397,15 @@ class Solver
/**
* \brief Print a long reason string
*
- * Print a reason as to why `rclause` implies `decision` for the variable `var`.
+ * Print a reason as to why `rclause` implies `assignment` for the variable `var`.
*
* \param var The variable to print the reason for
- * \param decision The assumed decision to print the reason for (may be different from actual decision if rclause is specified)
+ * \param assignment The assumed assignment to print the reason for (may be different from actual assignment if rclause is specified)
* \param rclause The clause that caused this variable to be marked (or would be marked)
* \param prefix A prefix, for indentation purposes, as this is recursive
* \param seen A set of seen objects such that the output does not repeat itself (not for safety, it is acyclic)
*/
- virtual std::string LongWhyStr(Var var, bool decision, const Clause *rclause, std::string prefix, std::unordered_set<Var> &seen) const;
+ virtual std::string LongWhyStr(Var var, bool assignment, const Clause *rclause, std::string prefix, std::unordered_set<Var> &seen) const;
};
/*
@@ -484,7 +484,7 @@ class DependencySolver : public Solver
/// \brief Apply the solver result to the depCache
[[nodiscard]] bool ToDepCache(pkgDepCache &depcache) const;
/// \brief Temporary internal API with external linkage for the `apt why` and `apt why-not` commands.
- APT_PUBLIC static std::string InternalCliWhy(pkgDepCache &depcache, pkgCache::PkgIterator Pkg, bool decision);
+ APT_PUBLIC static std::string InternalCliWhy(pkgDepCache &depcache, pkgCache::PkgIterator Pkg, bool assignment);
};
}; // namespace APT::Solver
/**
@@ -518,7 +518,7 @@ struct APT::Solver::Solver::Work
/**
* \brief The solver state
*
- * For each version, the solver records a decision at a certain level. It
+ * For each version, the solver records a assignment at a certain level. It
* maintains an array mapping from version ID to state.
*/
struct APT::Solver::Solver::State
@@ -538,11 +538,10 @@ struct APT::Solver::Solver::State
const char *reasonStr{};
- // \brief The depth at which the decision has been taken
+ // \brief The depth at which the value has been assigned
depth_type depth{0};
- // \brief This essentially describes the install state in RFC2119 terms.
- LiftedBool decision{LiftedBool::Undefined};
+ LiftedBool assignment{LiftedBool::Undefined};
// \brief Flags.
struct