Example #1
0
void PlogApp::initOptions(ProgramOptions::OptionContext &root) {
    using namespace ProgramOptions;
    BaseType::initOptions(root);
    grOpts_.defines.clear();
    grOpts_.verbose = false;
    OptionGroup gringo("Gringo Options");
    gringo.addOptions()
            ("text", storeTo(grOpts_, parseText)->flag(), "Print plain text format")
            ("const,c", storeTo(grOpts_.defines, parseConst)->composing()->arg("<id>=<term>"), "Replace term occurrences of <id> with <term>")
            ("output,o", storeTo(grOpts_.outputFormat = Gringo::Output::OutputFormat::INTERMEDIATE, values<Gringo::Output::OutputFormat>()
                    ("intermediate", Gringo::Output::OutputFormat::INTERMEDIATE)
                    ("text", Gringo::Output::OutputFormat::TEXT)
                    ("reify", Gringo::Output::OutputFormat::REIFY)
                    ("smodels", Gringo::Output::OutputFormat::SMODELS)), "Choose output format:\n"
                     "      intermediate: print intermediate format\n"
                     "      text        : print plain text format\n"
                     "      reify       : print program as reified facts\n"
                     "      smodels     : print smodels format\n"
                     "                    (only supports basic features)")
            ("output-debug", storeTo(grOpts_.outputOptions.debug = Gringo::Output::OutputDebug::NONE, values<Gringo::Output::OutputDebug>()
                    ("none", Gringo::Output::OutputDebug::NONE)
                    ("text", Gringo::Output::OutputDebug::TEXT)
                    ("translate", Gringo::Output::OutputDebug::TRANSLATE)
                    ("all", Gringo::Output::OutputDebug::ALL)), "Print debug information during output:\n"
                     "      none     : no additional info\n"
                     "      text     : print rules as plain text (prefix %%)\n"
                     "      translate: print translated rules as plain text (prefix %%%%)\n"
                     "      all      : combines text and translate")
            ("warn,W"                   , storeTo(grOpts_, parseWarning)->arg("<warn>")->composing(), "Enable/disable warnings:\n"
                    "      none:                     disable all warnings\n"
                    "      all:                      enable all warnings\n"
                    "      [no-]atom-undefined:      a :- b.\n"
                    "      [no-]file-included:       #include \"a.lp\". #include \"a.lp\".\n"
                    "      [no-]operation-undefined: p(1/0).\n"
                    "      [no-]variable-unbounded:  $x > 10.\n"
                    "      [no-]global-variable:     :- #count { X } = 1, X = 1.\n"
                    "      [no-]other:               clasp related and uncategorized warnings")
            ("rewrite-minimize"         , flag(grOpts_.rewriteMinimize = false), "Rewrite minimize constraints into rules")
            ("keep-facts"               , flag(grOpts_.keepFacts = false), "Do not remove facts from normal rules")
            ("reify-sccs"               , flag(grOpts_.outputOptions.reifySCCs = false), "Calculate SCCs for reified output")
            ("reify-steps"              , flag(grOpts_.outputOptions.reifySteps = false), "Add step numbers to reified output")
            ("foobar,@4"                , storeTo(grOpts_.foobar, parseFoobar) , "Foobar")
            ;
    root.add(gringo);

    OptionGroup basic("Basic Options");
    // add basic options
    basic.addOptions()
            ("mode", storeTo(mode_ = mode_plog, values<Mode>()
                     ("clingo", mode_plog)
                     ("clasp", mode_ground_plog)
    ("gringo", mode_gringo)),
             "Run in {clingo|clasp|gringo} mode\n")
            ;
    root.add(basic);

}
Example #2
0
void ClaspConApp::initOptions(ProgramOptions::OptionContext& root)
{
    using namespace ProgramOptions;
    ClaspAppBase::initOptions(root);
    OptionGroup cspconf("Constraint Processing Options");
    cspconf.addOptions()
            ("redundant-clause-check", storeTo(conf_.redundantClauseCheck = true), "Check translated clauses for redundancies (default: true)")
            ("domain-size", storeTo(conf_.domSize = 10000), "the maximum number of chunks a domain can have when multiplied (default: 10000)")
            ("break-symmetries", storeTo(conf_.break_symmetries = true), "break symmetries, can't do enumeration without (default: true)")
            ("split-size", storeTo(conf_.splitsize_maxClauseSize.first = 3), "constraints are maybe split into this size (minimum: 3) (default: 3)")
            ("max-clause-size", storeTo(conf_.splitsize_maxClauseSize.second = 1024), "constraints are only split if they produce more clauses than this (default: 1024)")
            ("pidgeon-optimization", storeTo(conf_.pidgeon = false), "do pidgeon-hole optimization for alldistinct constraints (default: false)")
            ("permutation-optimization", storeTo(conf_.permutation = false), "do permutation optimization for alldistinct constraints (default: false)")
            ("disjoint-to-distinct", storeTo(conf_.disjoint2distinct = false), "do translate disjoint to distinct constraint if possible (default: false)")
            ("distinct-to-card", storeTo(conf_.alldistinctCard = true), "do translate distinct constraint with cardinality constraints (default: true)")
            ("explicit-binary-order", storeTo(conf_.explicitBinaryOrderClausesIfPossible = true), "explicitly create binary order clauses if possible (default: true)")
            ("learn-clauses", storeTo(conf_.learnClauses = true), "learn clauses while propagating (default: true)")
            //("lazy-variable-creation", flag(conf_.lazyLiterals = true), "create order variables lazily (default: true)")
            ("difference-logic", storeTo(conf_.dlprop = 0), "0: no difference logic propagator, 1 early, 2 late  (default: 0)")
            ("create-on-conflict", storeTo(conf_.createOnConflict = true), "lazily create variables on conflict (default: true)")
            ("translate-constraints", storeTo(conf_.translateConstraints = 1000), "translate constraints with an estimated number of clauses less than this (default: 1000)")
            ("min-lits-per-var", storeTo(conf_.minLitsPerVar = 1000), "minimum number of precreated literals per variable (-1=all) (default: 1000)")
            ("equalityProcessing", storeTo(conf_.equalityProcessing = true), "find and replace equal variable views (default: true)")
            ;
    root.add(cspconf);
    
 /*  OptionGroup basic("Basic Options");
    basic.addOptions()
            ("mode", storeTo(mode_ = mode_clingo, values<Mode>()
                             ("clingo", mode_clingo)
                             ("clasp", mode_clasp)
                             ("gringo", mode_gringo)), 
             "Run in {clingo|clasp|gringo} mode\n")
            ;
    root.add(basic);*/
}