3.1.1. cnfformula.families.counting module¶
Implementation of counting/matching formulas
-
class
CountingCmdHelper
¶ Command line helper for Counting Principle formulas
Methods
build_cnf
(args)Build an Counting Principle formula according to the arguments setup_command_line
(parser)Setup the command line options for Counting Principle formula -
static
build_cnf
(args)¶ Build an Counting Principle formula according to the arguments
Arguments: - args: command line options
-
description
= 'counting principle'¶
-
name
= 'count'¶
-
static
setup_command_line
(parser)¶ Setup the command line options for Counting Principle formula
Arguments: - parser: parser to load with options.
-
static
-
CountingPrinciple
(M, p)¶ Generates the clauses for the counting matching principle.
The principle claims that there is a way to partition M in sets of size p each.
Arguments: - M : size of the domain - p : size of each class
-
class
PMatchingCmdHelper
¶ Bases:
object
Command line helper for Perfect Matching Principle formulas
Methods
setup_command_line
(parser)Setup the command line options for Perfect Matching Principle formula build_cnf -
static
build_cnf
(args)¶
-
description
= 'perfect matching principle'¶
-
name
= 'matching'¶
-
static
setup_command_line
(parser)¶ Setup the command line options for Perfect Matching Principle formula
Arguments: - parser: parser to load with options.
-
static
-
class
ParityCmdHelper
¶ Bases:
object
Command line helper for Parity Principle formulas
Methods
setup_command_line
(parser)Setup the command line options for Parity Principle formula build_cnf -
static
build_cnf
(args)¶
-
description
= 'parity principle'¶
-
name
= 'parity'¶
-
static
setup_command_line
(parser)¶ Setup the command line options for Parity Principle formula
Arguments: - parser: parser to load with options.
-
static
-
PerfectMatchingPrinciple
(G)¶ Generates the clauses for the graph perfect matching principle.
The principle claims that there is a way to select edges to such that all vertices have exactly one incident edge set to 1.
Parameters: - G : undirected graph