Example #1
0
    def setup_command_line(parser):
        """Setup the command line options for stone formulas

        Arguments:
        - `parser`: parser to load with options.
        """
        DirectedAcyclicGraphHelper.setup_command_line(parser)
        BipartiteGraphHelper.setup_command_line(parser, suffix="_mapping")
Example #2
0
    def setup_command_line(parser):
        """Setup the command line options for stone formulas

        Arguments:
        - `parser`: parser to load with options.
        """
        DirectedAcyclicGraphHelper.setup_command_line(parser)
        BipartiteGraphHelper.setup_command_line(parser,suffix="_mapping")
Example #3
0
    def setup_command_line(parser):

        parser.add_argument('--equal',
                            '-e',
                            default=False,
                            action='store_true',
                            help="encode cardinality constraints as equations")
        BipartiteGraphHelper.setup_command_line(parser)
Example #4
0
    def setup_command_line(parser):
        """Setup the command line options for pigeonhole principle formula over graphs

        Arguments:
        - `parser`: parser to load with options.
        """
        parser.add_argument('--functional',action='store_true',
                            help="pigeons sit in at most one hole")
        parser.add_argument('--onto',action='store_true',
                            help="every hole has a sitting pigeon")
        BipartiteGraphHelper.setup_command_line(parser)
Example #5
0
    def setup_command_line(parser):
        """Setup the command line options for pigeonhole principle formula over graphs

        Arguments:
        - `parser`: parser to load with options.
        """
        parser.add_argument('--functional',
                            action='store_true',
                            help="pigeons sit in at most one hole")
        parser.add_argument('--onto',
                            action='store_true',
                            help="every hole has a sitting pigeon")
        BipartiteGraphHelper.setup_command_line(parser)
Example #6
0
    def build_cnf(args):
        """Build the pebbling formula

        Arguments:
        - `args`: command line options
        """
        D = DirectedAcyclicGraphHelper.obtain_graph(args)
        B = BipartiteGraphHelper.obtain_graph(args, suffix="_mapping")
        return SparseStoneFormula(D, B)
Example #7
0
    def build_cnf(args):
        """Build a Graph PHP formula according to the arguments

        Arguments:
        - `args`: command line options
        """
        G = BipartiteGraphHelper.obtain_graph(args) 
        return GraphPigeonholePrinciple(G,
                                        functional=args.functional,
                                        onto=args.onto)
Example #8
0
    def build_cnf(args):
        """Build a Graph PHP formula according to the arguments

        Arguments:
        - `args`: command line options
        """
        G = BipartiteGraphHelper.obtain_graph(args)
        return GraphPigeonholePrinciple(G,
                                        functional=args.functional,
                                        onto=args.onto)
Example #9
0
    def build_cnf(args):
        """Build the pebbling formula

        Arguments:
        - `args`: command line options
        """
        D = DirectedAcyclicGraphHelper.obtain_graph(args)
        B = BipartiteGraphHelper.obtain_graph(args, suffix="_mapping")
        try:
            return SparseStoneFormula(D, B)
        except ValueError as e:
            print("\nError: {}".format(e), file=sys.stderr)
            sys.exit(-1)
Example #10
0
    def build_cnf(args):
        """Build the pebbling formula

        Arguments:
        - `args`: command line options
        """
        D= DirectedAcyclicGraphHelper.obtain_graph(args)
        B= BipartiteGraphHelper.obtain_graph(args,suffix="_mapping")
        try:
            return SparseStoneFormula(D,B)
        except ValueError,e:
            print("\nError: {}".format(e),file=sys.stderr)
            sys.exit(-1)
Example #11
0
 def build_cnf(args):
     B = BipartiteGraphHelper.obtain_graph(args)
     return SubsetCardinalityFormula(B,args.equal)
Example #12
0
    def setup_command_line(parser):

        parser.add_argument('--equal','-e',default=False,action='store_true',
                            help="encode cardinality constraints as equations")
        BipartiteGraphHelper.setup_command_line(parser)
Example #13
0
 def build_cnf(args):
     B = BipartiteGraphHelper.obtain_graph(args)
     return SubsetCardinalityFormula(B, args.equal)