This package contains code necessary for running the quartet and projection
encodings from the paper

Janhunen, T., Gebser, M., Rintanen, J., H. Nyman, J. Pensar, J. Corander:
'Learning Discrete Decomposable Graphical Models via Constraint Optimization'
Statistics and Computing, online access, 11 Nov 2015.
DOI: 10.1007/s11222-015-9611-4

This software package was originally published on
http://research.ics.aalto.fi/software/asp/

The package consists of the following parts

	1. Download scripts for clasp and gringo
	2. Sample data sets (heart and econ)
        3. Filtering scripts (filter.sh and filter-all.sh)
	4. Encoding for learning Markov networks (peo.lp)
	5. Encoding for learning labeled Markov networks (peo-lab.lp)
        6. Run scripts (run.sh and run-all.sh)

1. Download scripts
-------------------

Two .sh scripts:
	wget-clasp.sh
	wget-gringo.sh

When executed, these scripts will check if you already have the
clasp/gringo binary in the current folder, if not, they will try to
download it from SourceForge.

The scripts described below assume that clasp and gringo have been
installed in the current folder, but this can easily be changed by
setting the "DIR" path variable appropriately.

2. Sample data sets
-------------------

The files data/heart.lp, data/econ.lp, data-lab/heart.lp, and
data-lab/econ.lp contain the score information for our sample data
sets. These files must be processed with the filtering scripts first
(the files are not compatible with the provided encodings as such).

3. Filtering scripts
--------------------

The script filter-all.sh is responsible for creating filtered data
sets in the directories data/ and data-lab/. These files are
compatible with the encodings peo.lp and peo-lab.lp, respectively.
A shell command line:

$ ./filter-all.sh

4. Encoding for Markov network learning
---------------------------------------

The file peo.lp can be grounded with any of the filtered files
data/*-*.lp and forwarded for the solver for computation.
An example of a shell command line:

$ gringo peo.lp data/econ-edge-k\=2.lp | clasp

5. Encoding for labeled Markov network learning
-----------------------------------------------

The file peo-lab.lp can be grounded with any of the filtered files
data-lab/*-*.lp and forwarded for the solver for computation.
An example of a shell command line:

$ gringo peo-lab.lp data-lab/econ-edge-k\=2.lp | clasp

6. Run scripts
--------------

The script run-all.sh will run all filtering combinations
for the heart and econ datasets (as reported in the paper).

