PrSAT SUGGESTED FORMAT

In this file a suggested format for PrSAT problems is described. 
If you have comments, please send a note to zorano@mi.sanu.ac.yu.

PROBABILITY FORMULAE

Starting from the set of propositional letters p1, p2, ...  the set of 
classical propositional formulae is obtained in the usual way. 
We use A, A1, A2, ... to denote classical propositional formulae.
Let A be a classical propositional formula and p1, ..., pk be the set of all
propositional letters that appear in A. An atom of A is a conjunction 
#p1 and ... and #pk
where #pi is used to denote either pi or not pi. 
A weight term is an expression of the form 
a1*w(A1) + ... + ak*w(Ak) 
where ai's are rational numbers and Ai's are propositional formulae.
The intended meaning of w(A) is 'probability of A'. 
A basic weight formula has the form 
t r b
where t is a weight term, b is a rational number and r is a relational symbol 
that is one of [, <, =, >, ]. The relational symbol means less or equal,
less, equal, greater, and greater or equal, respectively. 
A probability formula is a Boolean combination of basic weight formulae.
We use f, f1, f2, ... to denote probability formulae.

A probability model is a structure M = (W,H,m,v) where:
- W is a set of worlds
- H is a sigma algebra of subsets of W 
- m: H -> [0,1] is a sigma-additive probability measure
- v assigns a propositional valuation to every world w from W.
The satisfiability relation |= fulfills the following conditions for every
model M:
- M |= A, A is a propositional formula iff for every w, v(w)(A)=true
- M |= a1*w(A1) + ... + ak*w(Ak) r b iff
a1*m({w: v(w)(A1) = true}) + ... + ak*m({w: v(w)(Ak) = true}) r b
holds
- M |= not f, f is a probability formula, iff M |= f does not hold
- M |= f1 and f2, f1 , f2 are probability formulae, iff M |= f1 and M |= f2. 

WFC-FORM

A probability formula f is in the weight conjunctive form (wfc-form) if it
is a conjunction of basic weight formulae such that classical formulae 
appearing in f are in disjunctive normal form. 

PrSAT

Probability satisfiability problem (PrSAT) is:
given a formula f in wfc-form, is it satisfiable? 


FILE FORMAT

We give here our file-format for describing probability formulae in wfc-form.
The file contains ASCII characters organized in lines. 
A line is terminated with an end-of-line character.  
Fields in each line are separated by blank spaces. 
The file consists of:
(i) The first line contains two unsigned integers
    l - the number of basic weight formulae
    n - the number of propositional letters.
(ii) The first line is followed by a description of l basic weight formulae. 
     The description of each basic weight formula consists of:
     (1) The first line contains an unsigned int 
         s - the number of summands in formula.
     (2) It is followed by a description of s summands. 
         The description of each summand consists of:
         (a) The first line contains two numbers
             a - coefficient (float)
             d - the number of disjuncts in the propositional formula
             that follows (unsigned long int).  
         (b) It is followed by d lines containing descriptions of 
             the corresponding d disjuncts. Each line consists of:
             (*) c - the number of literals in the disjunct 
                (unsigned int, <= n) 
             (**) c descriptions of literals; the descriptions are 
                  mutually different numbers from 1 to n (the number of
                  the propositional letters); if the minus sign precedes
                  a number in the list, it means that the corresponding
                  propositional letter is negated 
      (3) The last line of the description of a basic weight formula 
          contains the corresponding relational symbol (r) and the 
          right side (b) of the inequality: 
          r is one of symbols [,<,=,>,]  
          b is float
(iii) The last two lines contain a description of a model
      satisfying the above probability formula. 
      (1) The first line contains:
          descriptions of l atoms; each atom is represented by a sequence
          of n (the number of propositional letters) bits grouped in char's; 
          0 at the position i means that not pi appears in the atom
          1 at the position i means that pi appears in the atom
      (2) The second line contains l probabilities (float numbers) of the
          above atoms; the sum of probabilities must be 1.00.
Every line in the file may finish with comments giving human readable 
information about the line. The comments are ignored by  the program. 


AN EXAMPLE

According to the above notions the formula:
1.00*w(p2 and not p3 and not p4) < 0.48496 and 1.00*w(p2 and p4) >= 0.338069
can be described in the following way:

2 4	                Number of formulae and number of letters
1                       Number of summands in 0. formula
1.000000 1	        Coefficient and number of disjuncts in 0.summand
3 2 -3 -4	        Number of literals and literals 
< 0.048496	        Relational symbol and the right side value
1                       Number of summands in 1. formula 
1.000000 1	        Coefficient and number of disjuncts in 0. summand
2 2 4	                Number of literals and literals 
] 0.338069	        Relational symbol and the right side value
157 47 	                Interpretation atoms
0.895342 0.104658 	Interpretation probabilities



PROGRAMS FOR FORMULAE GENERATION

There are 2 c-programs generating formulae in the wfc-form:
- ver_form_gen.c
- ver_form_gen_twoside.c

The first program reads (from the command line) the name of a configuration
file. This file contains the following lines:

1. line: an int - number for the random seed initialization
2. line: an int - number of inequalities
3. line: an int - maximal number of summands
4. line: an int - number of propositional letters
5. line: an int - maximal number of disjuncts
6. line: a string - name of an output file

Every line of a configuration file can be finished by a comment ignored during 
the reading. After the configuration file is read, the program generates a 
formula in the wfc-form. An example of a configuration file:

78336 	
1 	
1 	
4 	
1 	
p.sat

The second program also reads the name of a configuration file from the
command line, but this file has an additional line containing a float
number delta. Delta is used to define intervals for probabilities of
weight terms [right side value - delta, right side value + delta]. 
An example of a configuration file:

312387 
15 
5 
15 
5 
0.1 	float number delta defining intervals of probabilities
q.sat


PROBLEM INSTANCES (example.zip)

  n - prop.let.   l - inequalities     file name

      15                15             prsat1.sat
      15                15             prsat2.sat
      15                30             prsat3.sat
      15                30             prsat4.sat
      30                30             prsat5.sat
      30                30             prsat6.sat
      30                60             prsat7.sat
      30                60             prsat8.sat
      60                60             prsat9.sat
      60                60             prsat10.sat

  n - prop.let.   2l - inequalities    file name

      15                16             prsat101.sat
      15                30             prsat104.sat
      30                30             prsat106.sat

