WatForm / fortress

Fortress: Finite Model Finder for Many-Sorted First-Order Logic
MIT License
5 stars 0 forks source link

Fortress

Fortress is a command-line tool and library for manipulating many-sorted first order logic (MSFOL) (plus transitive closure and hopefully soon, set cardinality) formulas with SMT solvers. In particular, given scopes for all the sorts of the problem, Fortress can transform problems into formulas within the equality with uninterpreted functions decidable subset of MSFOL.

Fortress takes as input:

It answers whether the theory has a satisfying interpretation (a "model" or "solution") with the given domain sizes.

Fortress was originally described in the paper "Finite Model Finding Using the Logic of Equality with Uninterpreted Functions", available here, and has been re-implemented to create a powerful and general tool.

Details on using Fortress as the command line are available in this file. The fortress CLI take as input a file in an augmented SMT-LIB format.

Details on using Fortress as a library are available in UserGuide.md .

Details on the internal code organization and design decisions in Fortress can be found in DevelopersGuide.md .

Building Fortress

The following are necessary to build Fortress:

Build System Overview

This repository contains a multi-project sbt build, with the following projects:

Building the root project (default) is the easiest way to build Fortress. To use Fortress on the command line, you want the output from the fortress project.

You can read more about how to use multi-project builds in the sbt reference manual.

Complete Build

sbt stage

This will compile the code and produce executables:

Alternatively,

sbt dist

will compile the code produce universal zip archives:

Compile Only

sbt compile

Running Unit Tests

sbt test

Using Fortress as a Library

Most often Fortress is used as a library. You can either:

All 4 jars must be in the class path.

Instructions on using the Fortress API interface can be found in the API guide.

Using the Fortress CLI

You can run the Fortress CLI, by either:

Options for the Fortress CLI

The options to the Fortress CLI, can be found by running fortress --help. In addition:

Example usage:

fortress --timeout 30 -S A=3 B=2 --generate function.smttc

This creates a theory using the function.smttc file, and determines whether there is a satisfying interpretation for this theory where the scope of sort A is 3 and the scope of sort B is 2. If a model exists, fortress outputs Sat and writes out the model (because of the --generate option).

Developer's Guide

Information on the architecture of Fortress is available in the Developer's Guide.

Using the Fortress CLI Debug Tools (Developers)

You can run the FortressDebug CLI, by either:

The options to the FortressDebug, can be found by running fortressDebug --help. In particular:

Example usage:

fortressdebug --timeout 60 --mode count -S A=3 B=2 --version JoeONE function.smt2

You can increase the JVM stack size by setting option "-J-Xss", for example, "-J-Xss8m" sets the max stack size to 8 MB. You might want to increase stack size, because the antlr parser causes stack overflow errors when parsing large smt2 and tptp files.

Troubleshooting

If the gradle build is not working properly ensure that your JAVA_HOME environment variable is correctly set (to the folder where the jdk that you are using is installed).

Acknowledgements

The original version of Fortress was created by Amirhossein Vakili and Nancy Day. Fortress was completely rewritten in Scala by Joseph Poremba and greatly enhanced by Ryan Dancy. Joe also greatly extended the symmetry breaking used in Fortress. Additional contributors to Fortress include: Ruomei Yan, Orson Baines, Callum Moseley, Yie Jin (James) Long, and Owen Zila.

Some TPTP files publicly available on the TPTP Problem Library(http://www.tptp.org/) are used for unit tests.