Class PseudoBooleanParser


  • public final class PseudoBooleanParser
    extends FormulaParser
    A parser for pseudo Boolean formulas.

    The syntax for pseudo Boolean formulas in LogicNG is:

    • $true for the constant TRUE
    • $false for the constant FALSE
    • ~ for the negation
    • | for the disjunction (OR)
    • & for the conjunction (AND)
    • => for the implication
    • <=> for the equivalence
    • * for the multiplication of a literal and its coefficient
    • + for the summation
    • = for equals
    • <= for less-equals
    • < for less than
    • >= for greater-equals
    • > for greater than
    Brackets are ( and ). For variable names, there are the following rules:
    • must begin with a alphabetic character, _, @, or #
    • can only contain alphanumerical character, _, or #
    • @ is only allowed at the beginning of the variable name and is reserved for special internal variables

    A valid pseudo Boolean expression is of the form c_1 * l_1 + ... + c_n * l_n R k where the c_i are coefficients, l_i are literals, and R is one of =, >, >=, <, <=.

    Since:
    1.0
    Version:
    2.4.1
    • Constructor Detail

      • PseudoBooleanParser

        public PseudoBooleanParser​(org.logicng.formulas.FormulaFactory f)
        Constructs a new parser for pseudo boolean formulas.
        Parameters:
        f - the formula factory