apt 3.0.3
commandline package manager
Classes | Public Types | Public Member Functions | Friends | List of all members
Solver Class Reference

Classes

struct  Clause
 A single clause. More...
 
struct  CompareProviders3
 
struct  Solved
 A solved item. More...
 
struct  State
 The solver state. More...
 
struct  Var
 Tagged union holding either a package, version, or nothing; representing the reason for installing something. More...
 
struct  Work
 A single work item. More...
 

Public Types

enum class  Decision : uint16_t { NONE , MUST , MUSTNOT }
 

Public Member Functions

void Push (Work work)
 
bool Pop ()
 
void UndoOne ()
 
bool AddWork (Work &&work)
 
 Solver (pkgCache &Cache, pkgDepCache::Policy &Policy, EDSP::Request::Flags requestFlags)
 
bool Assume (Var var, bool decision, const Clause *reason=nullptr)
 
bool Enqueue (Var var, bool decision, const Clause *reason=nullptr)
 
bool FromDepCache (pkgDepCache &depcache)
 
bool ToDepCache (pkgDepCache &depcache) const
 
bool Solve ()
 
std::string WhyStr (Var reason) const
 
std::string LongWhyStr (Var var, bool decision, const Clause *rclause, std::string prefix, std::unordered_set< Var > &seen) const
 Print a long reason string.
 

Friends

struct std::hash< APT::Solver::Var >
 

Constructor & Destructor Documentation

◆ Solver()

Solver ( pkgCache cache,
pkgDepCache::Policy policy,
EDSP::Request::Flags  requestFlags 
)
Todo:
DEDUP with pkgDepCache.

Member Function Documentation

◆ LongWhyStr()

std::string LongWhyStr ( Var  var,
bool  decision,
const Clause rclause,
std::string  prefix,
std::unordered_set< Var > &  seen 
) const

Print a long reason string.

Print a reason as to why rclause implies decision for the variable var.

Parameters
varThe variable to print the reason for
decisionThe assumed decision to print the reason for (may be different from actual decision if rclause is specified)
rclauseThe clause that caused this variable to be marked (or would be marked)
prefixA prefix, for indentation purposes, as this is recursive
seenA set of seen objects such that the output does not repeat itself (not for safety, it is acyclic)

◆ Pop()

bool Pop ( )
Todo:
We should just mark the entries as erased and only do a compaction
Todo:
There should be a reason!

◆ UndoOne()

void UndoOne ( )
Todo:
Add the undo handling here once we have watchers.

The documentation for this class was generated from the following files: