Interface ProblemAPISymbolic

    • Method Detail

      • tuple

        default String[] tuple​(String symbol,
                               String... otherSymbols)
        Returns a tuple (array) of strings from the specified parameters.
        Parameters:
        symbol - a string
        otherSymbols - a sequence of strings
        Returns:
        a 1-dimensional array of strings
      • tableSymbolic

        default TableSymbolic tableSymbolic()
        Builds an empty symbolic table that can be fed with tuples.
        Returns:
        an object TableSymbolic
      • tableSymbolic

        default TableSymbolic tableSymbolic​(String... tuple)
        Builds a symbolic table containing the specified tuple.
        Parameters:
        tuple - a tuple
        Returns:
        a symbolic table with one tuple
      • tableSymbolic

        default TableSymbolic tableSymbolic​(String[]... tuples)
        Builds a symbolic table containing the specified tuples.
        Parameters:
        tuples - a sequence of tuples
        Returns:
        a symbolic table with the specified tuples
      • tableSymbolic

        default TableSymbolic tableSymbolic​(String tuples)
        Builds a symbolic table after parsing the specified string. The string is what can be expected in XCSP3, as for example (green,red)(yellow,blue) for a symbolic table.
        Parameters:
        tuples - a string representing a sequence of symbolic tuples.
        Returns:
        a table containing the parsed specified tuples
      • dom

        default Domains.DomSymbolic dom​(String[] values)
        Returns a symbolic domain composed of the sorted distinct values that come from the specified array.
        Parameters:
        values - a 1-dimensional array of strings
        Returns:
        a symbolic domain composed of the sorted distinct values that come from the specified array
      • dom

        default Domains.DomSymbolic dom​(String val,
                                        String... otherVals)
        Returns a symbolic domain composed of the sorted distinct values that come from the specified values.
        Parameters:
        val - a first string (value)
        otherVals - a sequence of other strings (values)
        Returns:
        a symbolic domain composed of the sorted distinct values that come from the specified values
      • var

        default IVar.VarSymbolic var​(String id,
                                     Domains.DomSymbolic dom,
                                     String note,
                                     Types.TypeClass... classes)
        Builds a stand-alone symbolic variable with the specified id, domain, note (short comment) and classes. Use methods dom() for building symbolic domains. For example:
         {
                @code
                VarSymbolic x = var("x", dom("red", "green", "blue"), "x is the color of the house");
         }
         
        Parameters:
        id - the id (unique name) of the variable
        dom - the symbolic domain of the variable
        note - a short comment about the variable
        classes - the tags (possibly, none) associated with the variable
        Returns:
        a stand-alone symbolic variable
      • var

        default IVar.VarSymbolic var​(String id,
                                     Domains.DomSymbolic dom,
                                     Types.TypeClass... classes)
        Builds a stand-alone symbolic variable with the specified id, domain and classes. Use methods dom() for building symbolic domains. For example:
         {
                @code
                VarSymbolic x = var("x", dom("red", "green", "blue"));
         }
         
        Parameters:
        id - the id (unique name) of the variable
        dom - the symbolic domain of the variable
        classes - the tags (possibly, none) associated with the variable
        Returns:
        a stand-alone symbolic variable
      • arraySymbolic

        default IVar.VarSymbolic[] arraySymbolic​(String id,
                                                 Size.Size1D size,
                                                 FunctionalInterfaces.IntToDomSymbolic f,
                                                 String note,
                                                 Types.TypeClass... classes)
        Builds a 1-dimensional array of symbolic variables with the specified id, size, note (short comment) and classes. Use Method size(int) for building the size (length) of the array. The specified function f associates a symbolic domain with each variable at index i of the array. In case the specified function f return the value null, the variable is not built. In the following example, the first five variables have a domain containing 3 values whereas the next five variables have a domain containing two values only:
         VarSymbolic[] = arraySymbolic("x", size(10), i -> i < 5 ? dom("red","gren","blue") : dom("yellow","orange"), 
            "x[i] is the color of the ith rabbit");
         
        Parameters:
        id - the id (unique name) of the array
        size - the length of the array
        f - a function that associates a symbolic domain with any possible index i of a variable in the array
        note - a short comment about the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 1-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[] arraySymbolic​(String id,
                                                 Size.Size1D size,
                                                 FunctionalInterfaces.IntToDomSymbolic f,
                                                 Types.TypeClass... classes)
        Builds a 1-dimensional array of symbolic variables with the specified id, size, and classes. Use Method size(int) for building the size (length) of the array. The specified function f associates a symbolic domain with each variable at index i of the array. In case the specified function f return the value null, the variable is not built. In the following example, the first five variables have a domain containing 3 values whereas the next five variables have a domain containing two values only:
         VarSymbolic[] = arraySymbolic("x", size(10), i -> i < 5 ? dom("red","gren","blue") : dom("yellow","orange"));
         
        Parameters:
        id - the id (unique name) of the array
        size - the length of the array
        f - a function that associates a symbolic domain with any possible index i of a variable in the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 1-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[] arraySymbolic​(String id,
                                                 Size.Size1D size,
                                                 Domains.DomSymbolic dom,
                                                 String note,
                                                 Types.TypeClass... classes)
        Builds a 1-dimensional array of symbolic variables with the specified id, size, domain, note and classes. Use Method size(int) for building the size (length) of the array. Each variable of the array has the specified symbolic domain. In the following example, the ten variables have a domain containing 3 values:
         VarSymbolic[] = arraySymbolic("x", size(10), dom("red","gren","blue"),"x[i] is the color of the ith rabbit");
         
        Parameters:
        id - the id (unique name) of the array
        size - the length of the array
        dom - the domain of each variable in the array
        note - a short comment about the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 1-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[] arraySymbolic​(String id,
                                                 Size.Size1D size,
                                                 Domains.DomSymbolic dom,
                                                 Types.TypeClass... classes)
        Builds a 1-dimensional array of symbolic variables with the specified id, size, domain, and classes. Use Method size(int) for building the size (length) of the array. Each variable of the array has the specified symbolic domain. In the following example, the ten variables have a domain containing 3 values:
         VarSymbolic[] = arraySymbolic("x", size(10), dom("red","gren","blue"));
         
        Parameters:
        id - the id (unique name) of the array
        size - the length of the array
        dom - the domain of each variable in the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 1-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[][] arraySymbolic​(String id,
                                                   Size.Size2D size,
                                                   FunctionalInterfaces.Intx2ToDomSymbolic f,
                                                   String note,
                                                   Types.TypeClass... classes)
        Builds a 2-dimensional array of symbolic variables with the specified id, size, note (short comment) and classes. Use Method size(int,int) for building the size (length of each dimension) of the array. The specified function f associates a symbolic domain with each variable at index (i,j) of the array. In case the specified function f return the value null, the variable is not built. In the following example, some variables have a domain containing 3 values whereas others have a domain containing two values only:
         VarSymbolic[][] = arraySymbolic("x", size(10, 5), (i,j) -> i < j ? dom("red","green","blue") : dom("yellow","orange"), 
           "x[i][j] is the color of the jth rabbit at the ith hole");
         
        Parameters:
        id - the id (unique name) of the array
        size - the size (length of each dimension) of the array
        f - a function that associates a symbolic domain with any possible index (i,j) of a variable in the array
        note - a short comment about the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 2-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[][] arraySymbolic​(String id,
                                                   Size.Size2D size,
                                                   FunctionalInterfaces.Intx2ToDomSymbolic f,
                                                   Types.TypeClass... classes)
        Builds a 2-dimensional array of symbolic variables with the specified id, size, and classes. Use Method size(int,int) for building the size (length of each dimension) of the array. The specified function f associates a symbolic domain with each variable at index (i,j) of the array. In case the specified function f return the value null, the variable is not built. In the following example, some variables have a domain containing 10 values whereas others have a domain containing two values only:
         VarSymbolic[][] = arraySymbolic("x", size(10, 5), (i,j) -> i < j ? dom("red","green","blue") : dom("yellow","orange"));
         
        Parameters:
        id - the id (unique name) of the array
        size - the size (length of each dimension) of the array
        f - a function that associates a symbolic domain with any possible index (i,j) of a variable in the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 2-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[][] arraySymbolic​(String id,
                                                   Size.Size2D size,
                                                   Domains.DomSymbolic dom,
                                                   String note,
                                                   Types.TypeClass... classes)
        Builds a 2-dimensional array of symbolic variables with the specified id, size, domain, note (short comment) and classes. Use Method size(int,int) for building the size (length of each dimension) of the array. Each variable of the array has the specified symbolic domain. In the following example, all variables have a domain containing 3 values:
         VarSymbolic[][] = arraySymbolic("x", size(10, 5), dom("red","green","blue"), 
           "x[i][j] is the color of the jth rabbit at the ith hole");
         
        Parameters:
        id - the id (unique name) of the array
        size - the size (length of each dimension) of the array
        dom - the domain of each variable in the array
        note - a short comment about the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 2-dimensional array of symbolic variables
      • arraySymbolic

        default IVar.VarSymbolic[][] arraySymbolic​(String id,
                                                   Size.Size2D size,
                                                   Domains.DomSymbolic dom,
                                                   Types.TypeClass... classes)
        Builds a 2-dimensional array of symbolic variables with the specified id, size, domain, and classes. Use Method size(int,int) for building the size (length of each dimension) of the array. Each variable of the array has the specified symbolic domain. In the following example, all variables have a domain containing 3 values:
         VarSymbolic[][] = arraySymbolic("x", size(10, 5), dom("red","green","blue"));
         
        Parameters:
        id - the id (unique name) of the array
        size - the size (length of each dimension) of the array
        dom - the domain of each variable in the array
        classes - the tags (possibly, none) associated with the array
        Returns:
        a 2-dimensional array of symbolic variables
      • ctrFalse

        default CtrEntities.CtrEntity ctrFalse​(IVar.VarSymbolic[] scp)
        Builds a disentailed symbolic constraint, i.e., a special constraint that always returns false.
        Parameters:
        scp - the scope of the constraint
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by means of method chaining.
      • ctrTrue

        default CtrEntities.CtrEntity ctrTrue​(IVar.VarSymbolic[] scp)
        Builds an entailed symbolic constraint, i.e., a special constraint that always returns true. For example, it may be useful to achieve some sophisticated tasks related to some forms of consistency.
        Parameters:
        scp - the scope of the constraint
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by means of method chaining.
      • extension

        default CtrEntities.CtrEntity extension​(IVar.VarSymbolic[] scp,
                                                String[][] tuples,
                                                Boolean positive)
        Builds a symbolic constraint extension from the specified scope and the specified array of symbolic tuples, seen as either supports (when positive is true) or conflicts (when positive is false). Note that you can use constants POSITIVE and NEGATIVE.
        Parameters:
        scp - the scope of the constraint
        tuples - the tuples defining the semantics of the constraint
        positive - boolean value indicating if the tuples are supports or conflicts
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • extension

        default CtrEntities.CtrEntity extension​(IVar.VarSymbolic[] scp,
                                                String[]... tuples)
        Builds a symbolic constraint extension from the specified scope and the specified array of symbolic tuples, seen as supports.
        Parameters:
        scp - the scope of the constraint
        tuples - the tuples defining the supports of the constraint
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • extension

        default CtrEntities.CtrEntity extension​(IVar.VarSymbolic[] scp,
                                                TableSymbolic table)
        Builds a symbolic constraint extension from the specified scope and the specified table, whose elements are seen as supports. An example of integer table that can be constructed is table("(a,b,a)(b,a,b)")
        Parameters:
        scp - the scope of the constraint
        table - the table containing the tuples defining the supports of the constraint
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • extension

        default CtrEntities.CtrEntity extension​(IVar.VarSymbolic x,
                                                String[] values,
                                                Boolean positive)
        Builds a unary symbolic constraint extension from the specified variable and the specified array of symbolic values, seen as either supports (when positive is true) or conflicts (when positive is false). Note that you can use constants POSITIVE and NEGATIVE.
        Parameters:
        x - the variable involved in this unary constraint
        values - the values defining the semantics of the constraint
        positive - boolean value indicating if the values are supports or conflicts
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • extension

        default CtrEntities.CtrEntity extension​(IVar.VarSymbolic x,
                                                String... values)
        Builds a unary symbolic constraint extension from the specified variable and the specified array of symbolic values, seen as supports.
        Parameters:
        x - the variable involved in this unary constraint
        values - the values defining the semantics of the constraint
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allDifferent

        default CtrEntities.CtrEntity allDifferent​(IVar.VarSymbolic[] list)
        Builds a constraint allDifferent on the specified symbolic variables: the variables must all take different values.
        Parameters:
        list - the involved symbolic variables
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allDifferent

        default CtrEntities.CtrEntity allDifferent​(IVar.VarSymbolic x,
                                                   IVar.VarSymbolic... others)
        Builds a constraint allDifferent on the specified symbolic variables: the variables must all take different values.
        Parameters:
        x - a first symbolic variable
        others - a sequence of other symbolic variables
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allDifferent

        default CtrEntities.CtrEntity allDifferent​(IVar.VarSymbolic[][] list)
        Builds a constraint allDifferent on the specified symbolic variables: the variables must all take different values. Note that the specified 2-dimensional array of variables will be flattened (i.e., converted into a 1-dimensional array of variables). Do not mistake this form with allDifferentList
        Parameters:
        list - the involved symbolic variables (a 2-dimensional array)
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allDifferent

        default CtrEntities.CtrEntity allDifferent​(IVar.VarSymbolic[][][] list)
        Builds a constraint allDifferent on the specified symbolic variables: the variables must all take different values. Note that the specified 3-dimensional array of variables will be flattened (i.e., converted into a 1-dimensional array of variables).
        Parameters:
        list - the involved symbolic variables (a 3-dimensional array)
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allEqual

        default CtrEntities.CtrEntity allEqual​(IVar.VarSymbolic... list)
        Builds a constraint allEqual on the specified symbolic variables: the variables must all take the same value. Basically, this is a modeling ease of use.
        Parameters:
        list - the involved symbolic variables
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining
      • allEqual

        default CtrEntities.CtrEntity allEqual​(IVar.VarSymbolic[][] list)
        Builds a constraint allEqual on the specified symbolic variables: the variables must all take the same value. Basically, this is a modeling ease of use. Note that the specified 2-dimensional array of variables will be flattened (i.e., converted into a 1-dimensional array of variables). Do not mistake this form with allEqualList
        Parameters:
        list - the involved symbolic variables (a 2-dimensional array)
        Returns:
        an object CtrEntity that wraps the built constraint and allows us to provide note and tags by method chaining