#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "../cnflib/formula.h"
#include "../cnflib/clause.h"
#include "../cnflib/variableset.h"
#include "../graphlib/bipartitegraph.h"
#include "../graphlib/vertex.h"
Go to the source code of this file.
Functions |
unsigned int | string2uint (std::string str) |
| Transforms a C++ string into an unsigned int using stream buffers.
|
void | pigeonAxiom (unsigned int i, BipartiteGraph G, Formula *form, VariableSet *vars) |
| Adds the clause corresponding to the pigeon axiom for the ith pigeon.
|
void | holeAxiom (unsigned int j, BipartiteGraph G, Formula *form, VariableSet *vars) |
| Adds the clauses corresponding to the hole axiom for hole number j.
|
void | pigeonHolePrinciple (BipartiteGraph G) |
| Prints the dimacs formatted CNF formula corresponding to the pigeon hole principle on graph G to the standard output.
|
void | randomNeighbours (unsigned int leftOrder, unsigned int n) |
| Prints on standard output the graph file corresponding to a graph with n+1 left vertives, n right vertices and such that all the left vertices have leftOrder neighbours picked uniformly randomly among the right ones.
|
int | main (int argc, char **argv) |
| Main method to manipulate PHP formulas.
|
Detailed Description
- Author:
- Léo Perrin
- Date:
- 2011/11/23
Definition in file php.cpp.
Function Documentation
void holeAxiom |
( |
unsigned int |
j, |
|
|
BipartiteGraph |
G, |
|
|
Formula * |
form, |
|
|
VariableSet * |
vars |
|
) |
| |
Adds the clauses corresponding to the hole axiom for hole number j.
- Parameters:
-
j | The hole to consider. |
G | The BipartiteGraph instance from which to build the formula. |
form | A pointer to the Formula instance we will append the clause to. |
vars | The variable set to use. |
Definition at line 76 of file php.cpp.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Main method to manipulate PHP formulas.
If not given any argument, parses stdin to read a graph and outputs the corresponding DIMACS file on standard output. Else, if given 3, outputs on stdout a "graph formatted" text able to generate a complete bipartite graph with m left vertices and n right ones.
Definition at line 165 of file php.cpp.
void pigeonAxiom |
( |
unsigned int |
i, |
|
|
BipartiteGraph |
G, |
|
|
Formula * |
form, |
|
|
VariableSet * |
vars |
|
) |
| |
Adds the clause corresponding to the pigeon axiom for the ith pigeon.
- Parameters:
-
i | The index of the pigeon we consider. |
G | The BipartiteGraph instance from which to build the formula. |
form | A pointer to the Formula instance we will append the clause to. |
vars | The variable set to use. |
Definition at line 50 of file php.cpp.
Prints the dimacs formatted CNF formula corresponding to the pigeon hole principle on graph G to the standard output.
- Parameters:
-
G | The BipartiteGraph instance from which to create formula. |
Definition at line 102 of file php.cpp.
Prints on standard output the graph file corresponding to a graph with n+1 left vertives, n right vertices and such that all the left vertices have leftOrder neighbours picked uniformly randomly among the right ones.
- Parameters:
-
leftOrder | The number of random distinct neighbours each left vertex must have. |
n | The number of left vertices (and the number of right ones minus one). |
Definition at line 127 of file php.cpp.
Transforms a C++ string into an unsigned int using stream buffers.
- Parameters:
-
str | The string to turn into a number. |
- Returns:
- The corresponding integer.
Definition at line 30 of file php.cpp.