Boolean combinations of restrictions.

This module provides classes that can be used to combine arbitrary collections of restrictions in AND, NAND, OR, NOR, XOR, XNOR style operations.

class pkgcore.restrictions.boolean.AndRestriction(location, config_name=None, syncer=None, profiles_base='profiles')[source]

Bases: base

Boolean AND grouping of restrictions. negation is a NAND

cnf_solutions(full_solution_expansion=False)[source]

returns solutions in CNF (conjunctive normalized form) of this instance

Parameters:

full_solution_expansion – controls whether to expand everything (break apart atoms for example); this isn’t likely what you want

dnf_solutions(*args, **kwds)[source]

list form of iter_dnf_solutions, see iter_dnf_solutions for args

force_False(pkg, *vals)[source]
force_True(pkg, *vals)[source]
iter_cnf_solutions(full_solution_expansion=False)[source]

returns solutions in CNF (conjunctive normalized form) of this instance

Parameters:

full_solution_expansion – controls whether to expand everything (break apart atoms for example); this isn’t likely what you want

iter_dnf_solutions(full_solution_expansion=False)[source]

generater yielding DNF (disjunctive normalized form) of this instance.

Parameters:

full_solution_expansion – controls whether to expand everything (break apart atoms for example); this isn’t likely what you want

match(vals)[source]
class pkgcore.restrictions.boolean.OrRestriction(location, config_name=None, syncer=None, profiles_base='profiles')[source]

Bases: base

Boolean OR grouping of restrictions.

cnf_solutions(full_solution_expansion=False)[source]

Returns a list in CNF (conjunctive normalized form) of this instance.

Parameters:

full_solution_expansion – controls whether to expand everything (break apart atoms for example); this isn’t likely what you want

dnf_solutions(*args, **kwds)[source]

see dnf_solutions, iterates yielding DNF solutions

force_False(pkg, *vals)[source]
force_True(pkg, *vals)[source]
iter_dnf_solutions(full_solution_expansion=False)[source]

Returns a list in DNF (disjunctive normalized form) of this instance.

Parameters:

full_solution_expansion – controls whether to expand everything (break apart atoms for example); this isn’t likely what you want

match(vals)[source]