The qCORAL input file format

The input file format is quite simple. Here is an example:

;; This is a comment!
1 NORMAL -100 100 0 33.3
2 NORMAL -100 100 0 33.3

The first section, ":Variables:", contain the input variables used in the constraints plus their characteristics. Each line define a single input variable. The input format is as follows:


  • $ID is an unique integer identifier for the variable.
  • $VARTYPE is the distribution of the variable. Allowed values are NORMAL,EXPONENTIAL,BINOMIAL,POISSON,GEOMETRIC,UNIFORM_INT and UNIFORM_REAL.
  • $LOWER_BOUND and $UPPER_BOUND are, respectively, the lower and upper bound of the variable.
  • $[VARTYPE_PARAMS] is a list of the distribution parameters for the variable. In our example above, both variables are NORMAL, so we have two extra parameters: the mean (0) and the standard deviation (33.3). Other types have the following parameters:
    5. UNIFORM_INT/REAL: none

For more details on how the parsing of variables is done, see the method coral.counters.DistributionAwareQCoral.parseVariable(...)

The second section, ":Constraints:", contain the constraints to be analyzed by qCORAL. The complete grammar of the input language for symbolic expressions can be found in docs/QCORAL_INPUT_LANGUAGE.txt, or here.

One example expression:

// pretty-prints as: sin(id_1 * id_2) < 0 && cos(2x) > 0.25

You can also define a "truncated" domain for a single constraint. Example:

// in this case, the domain of V1 is [-1,1], and V_2 is [-2,2]

In this specific constraint, V1 and V2 are handled as variables following a truncated distribution (see this link for more information).