Skip to content

ekuiter/clausy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clausy: clausify feature-model formulas 🎅

clausy transforms feature-model formulas into conjunctive normal form (CNF) for subsequent analysis.

Getting Started

To transform any .sat, .model, or FeatureIDE-compatible file into .cnf (aka .dimacs), run:

git clone https://github.com/ekuiter/clausy.git
cd clausy

# option 1: build Docker image
docker build -t clausy .
cat meta/test.sat | docker run --rm -i clausy

# option 2: build into bin/ directory
make
bin/clausy meta/test.sat

Advanced Usage, Documentation, and Tests

Documentation for clausy is available online.

# equivalent to the above, but more verbose
bin/clausy meta/test.sat to_cnf_dist print

# read from standard input and count solutions with Tseitin transformation
cat model.uvl | bin/clausy -.uvl to_cnf_tseitin count

# read from command line and find some solution
echo '(!def(a)|def(b))' | bin/clausy -.model to_cnf_dist satisfy

# prove a tautology
! echo '(def(a)|!def(a))' | bin/clausy -.model '(-1)' to_cnf_tseitin satisfy &>/dev/null

# prove model equivalence
! bin/clausy a.model b.model '+(*(-1 2) *(1 -2))' to_cnf_tseitin satisfy &>/dev/null

# compute diff statistics
bin/clausy a.model b.model diff

# serialize diff
bin/clausy a.model b.model 'diff weak weak a_to_b'
 
# simplify a given CNF
bin/clausy model.dimacs

# run tests
make test

# view documentation
make doc

# view live documentation (for developers)
make doc-live

License

The source code of this project is released under the LGPL v3 license.