Giter Site home page Giter Site logo

moloss's Introduction

MOLOSS, a MOdal LOgic Satisfiability Solver Build Status

MOLOSS is a satisfiability solver for modal logics. It is an implementation (and more) of C. Aceres, P. Fontaine and S. Merz paper "Modal Satisfiability via SMT solving" in which the authors use a translation of propositional modal logic to first-order logic.

Copyright

MOLOSS is licensed under the GNU General Public License v3. See the COPYING file for more details.

Installation

For the moment, you can only install MOLOSS manually. To install MOLOSS, you need:

  • an OCaml compiler (version >= 4.0.3)
  • the Menhir parser generator
  • the OCaml library mSat
  • the OCaml library ocaml-minisat to interact with the MiniSat solver

All these tools can be easily installed using the OPAM OCaml Package Manager:

opam install menhir msat minisat
eval $(opam config env)

You can then build the system with

make

The previous command will build a native and byte code executable. You may also use more specific targets:

  • profile for native code executable with profiling
  • debug for byte code executable with debug
  • static for static native code executable with no dynamic libraries (even libc)

Notice also that:

  • (for the moment) MOLOSS uses UNIX system calls, so you must be on a UNIX/Linux system to use it
  • MOLOSS uses Z3, a SMT solver. You must have a Z3 installed if you want to use it as an oracle or directly (see further).

Documentation

You can find the documentation online.

Usage

The moloss executable takes as an argument a file containing the formula to be checked in InToHyLo format (see examples in the data directory or 4.1). MOLOSS then output SAT or UNSAT. By default, MiniSat is used as an oracle.

MOLOSS implements some frame axioms that can be called as an option of the execautable:

  • -S or -M: reflexiv relation
  • -B: symmetric relation
  • -4: transitive relation
  • -5: euclidian relation
  • -CD: functionnal relation

Options:

  • --all: all SAT oracles are used (MiniSat, Z3, mSAT)
  • --z3, --mSAT: only the corresponding oracle is used
  • --time: print the total execution time (including parsing)
  • --get-model: print the Kripke model if the formula is satisfiable in the Flat Kripke Model (FKM) format.
  • --get-assert: print the assertions made by the solver and the final model if the formule is satisfiable.
  • --direct: use Z3 as a first-order solver on the translation of modal formulas into first-order formulas (no instanciation procedures)
  • --get-log: print the log of interaction with the z3 SMT solver (only for direct mode)
  • --soft: use assert-soft constraints, even if not needed by the considered modal logic
  • --soft-ignore: do not use assert-soft constraints, even if needed (beware, infinite loop possible in this case!)

Not yet avaible options:

  • --get-proof: print a proof unsatisfiability if the formula is unsatisfiable (Z3 only)

Acknowledgments

MOLOSS has been partly developed during an internship at ISAE-SUPAERO and ONERA.

moloss's People

Contributors

jogiet avatar tofgarion avatar

Stargazers

 avatar Caleb Schultz Kisby avatar binaryflesh avatar Montmirail Valentin avatar

Watchers

 avatar  avatar

moloss's Issues

Problem with installation in the file `ast_fo`

There is a problem with the installation.
Installing Opam, Ocaml and everything is ok.

But then when I type make here is the following problem:

valentinmontmirail@Ubuntu:~/moloss/$ make
ocamlfind query unix
/usr/lib/ocaml

ocamlfind query minisat
/home/valentinmontmirail/.opam/system/lib/minisat

ocamlfind query msat
/home/valentinmontmirail/.opam/system/lib/msat

ocamlbuild -use-ocamlfind -I src -I tests src/moloss.native
Warning: tag "color" does not expect a parameter, but is used with parameter "always"
+ ocamlfind ocamlc -c -bin-annot -package minisat -package unix -package msat -I src -I tests -o 
src/ast_fo.cmo src/ast_fo.ml
File "src/ast_fo.ml", line 65, characters 29-41:
Error: Unbound value Sset.of_list

Command exited with code 2.

It looks like there is a problem in this file "src/ast_fo.ml", line 65, characters 29-41.

Could you make a release ?

Hello,

I will use Moloss in an article, but to cite it, I need something that can not change during the time.
It would be nice to have a release like Moloss 1.0. Like this, if someone is not sure about the results we give in the paper, he can download moloss 1.0, which will be the exact same version as the one we use, and re-run the solver on the benchmarks considered.

Thanks in advance,

Static-Compilation

One good feature for a solver is the ability to be compiled as a static executable.
Do you think it is possible to add such feature ?

Because I compile moloss on my machine and tried to run it on our super-calculator, but I get the following problem:

Fatal error: cannot load shared library dllminisat_stubs
Reason: dllminisat_stubs.so: cannot open shared object file: No such file or directory

Keep me informed if you think it is possible :).

Input format: should be a standard ? Why not InToHyLo ?

Hello,

It is not really an issue but more a proposition of a feature. If you want this solver to be used in comparison with others solvers, it is worth it to standardize the input.

Here is the BNF grammar of the most used input standard (see [4.1, 1] for more details):

<file> ::= 'begin' <fml> 'end'

<fml>  ::= '(' <fml> ')'
    |   'true' | 'false' 
    |   'p'<id> 
    |   '~' <fml>
    |   '<r' <id> '>' <fml> 
    |   '[r' <id> ']' <fml> 
    |   <fml> '&' <fml>
    |   <fml> '|' <fml>
    |   <fml> '->' <fml>
    |   <fml> '<->' <fml>

with <id> being a numerical sequence. Unary operators have the highest precedence in this format (called InToHyLo). The precedence of the binary operators is the following: &, |, ->, <->.

If you want to just patch your solver and not deal fully with the multiple modalities, you can just parse [] by [r1] and <> by <r1>.

Keep me informed if you plan to do such modifications, if not, I will try to propose a pull-request in the following weeks in order to see the performance of such a solver on real instances where SMT solving has more chances to be efficient.

Best Regards,

Unifying the output

Hello,

When I was parsing some of your results, I detect something strange.
The output when it is unsatisfiable is c \027[31mUNSAT\027[0m

You should change it into s UNSATISFIABLE in order to unify the outputs and to have s SATISFIABLE and s UNSATISFIABLE according to the solution.

I will send you a detailed email about your solver when I will have everything (maybe next week).
Cheers,

Problem with the model v2

Hello,

I find another bug related to the model-output.
Again does not seems to be something big, just a display problem.
Here is the StackTrace:

c (p100) & ((~ (p101)) & ([r1] (((~ (p101)) | (p100)) & (((~ (p102)) | (p101)) & (((~ (p100)) | (((~ (p1)) | ([r1] ((~ (p100)) | (p1)))) & ((p1) | ([r1] ((~ (p100)) | (~ (p1))))))) & (((~ (p101)) | (((~ (p2)) | ([r1] ((~ (p101)) | (p2)))) & ((p2) | ([r1] ((~ (p101)) | (~ (p2))))))) & ((~ ((p100) & (~ (p101)))) | ((<r1> ((p101) & ((~ (p102)) & (p2)))) & (<r1> ((p101) & ((~ (p102)) & (~ (p2))))))))))))) 

c oracle minisat
c #propositions #worlds #relations #edges
s SATISFIABLE
v 101 1 1 0
v -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 100 -101 0
v -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 0

There is 2 worlds displayed, and they are basically the same, except that in one, p100 is true, and in the other one p100 is false. In my opinion, it is missing the link r1 w0 w1 and it should be 2 worlds not one.

Some issue in the model returned

Hello,

I tested moloss on a formula and I detect a bug in the model returned.

bash$ ./test.intohylo --get-model
c (p100) & ((~ (p101)) & (((~ (p101)) | (p100)) & (((~ (p102)) | (p101)) & (((~ (p103)) | (p102)) & (((~ (p100)) | (((~ (p1)) | ([r1] ((~ (p100)) | (p1)))) & ((p1) | ([r1] ((~ (p100)) | (~ (p1))))))) & (((~ (p101)) | (((~ (p2)) | ([r1] ((~ (p101)) | (p2)))) & ((p2) | ([r1] ((~ (p101)) | (~ (p2))))))) & (((~ (p102)) | (((~ (p3)) | ([r1] ((~ (p102)) | (p3)))) & ((p3) | ([r1] ((~ (p102)) | (~ (p3))))))) & (((~ ((p100) & (~ (p101)))) | ((<r1> ((p101) & ((~ (p102)) & (p2)))) & (<r1> ((p101) & ((~ (p102)) & (~ (p2))))))) & (((~ ((p101) & (~ (p102)))) | ((<r1> ((p102) & ((~ (p103)) & (p3)))) & (<r1> ((p102) & ((~ (p103)) & (~ (p3))))))) & (([r1] (((~ (p101)) | (p100)) & (((~ (p102)) | (p101)) & (((~ (p103)) | (p102)) & (((~ (p100)) | (((~ (p1)) | ([r1] ((~ (p100)) | (p1)))) & ((p1) | ([r1] ((~ (p100)) | (~ (p1))))))) & (((~ (p101)) | (((~ (p2)) | ([r1] ((~ (p101)) | (p2)))) & ((p2) | ([r1] ((~ (p101)) | (~ (p2))))))) & (((~ (p102)) | (((~ (p3)) | ([r1] ((~ (p102)) | (p3)))) & ((p3) | ([r1] ((~ (p102)) | (~ (p3))))))) & (((~ ((p100) & (~ (p101)))) | ((<r1> ((p101) & ((~ (p102)) & (p2)))) & (<r1> ((p101) & ((~ (p102)) & (~ (p2))))))) & ((~ ((p101) & (~ (p102)))) | ((<r1> ((p102) & ((~ (p103)) & (p3)))) & (<r1> ((p102) & ((~ (p103)) & (~ (p3))))))))))))))) & ([r1] ([r1] (((~ (p101)) | (p100)) & (((~ (p102)) | (p101)) & (((~ (p103)) | (p102)) & (((~ (p100)) | (((~ (p1)) | ([r1] ((~ (p100)) | (p1)))) & ((p1) | ([r1] ((~ (p100)) | (~ (p1))))))) & (((~ (p101)) | (((~ (p2)) | ([r1] ((~ (p101)) | (p2)))) & ((p2) | ([r1] ((~ (p101)) | (~ (p2))))))) & (((~ (p102)) | (((~ (p3)) | ([r1] ((~ (p102)) | (p3)))) & ((p3) | ([r1] ((~ (p102)) | (~ (p3))))))) & (((~ ((p100) & (~ (p101)))) | ((<r1> ((p101) & ((~ (p102)) & (p2)))) & (<r1> ((p101) & ((~ (p102)) & (~ (p2))))))) & ((~ ((p101) & (~ (p102)))) | ((<r1> ((p102) & ((~ (p103)) & (p3)))) & (<r1> ((p102) & ((~ (p103)) & (~ (p3)))))))))))))))))))))))))) 

c oracle minisat
c #propositions #worlds #relations #edges
v 103 1 1 6
v 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 100 -101 -102 -103 0
v 1 2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 100 101 -102 -103 0
v r1 w0 w1
v r1 w0 w2
v r1 w1 w4
v r1 w1 w5
v r1 w2 w3
v r1 w2 w6
s SATISFIABLE

In gives a model which looks correct for the valuation but some information are missing.

You indicate on the first line v 103 1 1 6 that we have 103 variables (which is true) but only 1 world.
However, in your valuation you count already 2 and in the relation between the worlds you go until w6 so 7 worlds (which is the smallest value in fact). Moreover, your relations are good, it is suppose to give in output a binary tree and you have it.

Thus, I have no doubt that you have found the correct model, it is just no well displayed I think :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.