Code Monkey home page Code Monkey logo

bosy's Introduction

BoSy

BoSy is a reactive synthesis tool based on constraint-solving.

Awards

  • First and second place in sequential LTL synthesis track (SYNTCOMP 2016)
  • Second and third place in sequential LTL realizability track (SYNTCOMP 2016)
  • First place (quality ranking) in sequential LTL synthesis track (SYNTCOMP 2017)
  • Third place in sequential LTL realizability track (SYNTCOMP 2017)

Online Interface

BoSy can be tried without installation directly in your browser in our online interface.

Installation

BoSy is tested on macOS and Ubuntu.

  • Requires Swift compiler
  • make builds the minimal configuration:
    • downloads and builds required dependencies (in directory Tools)
    • builds the BoSy binary
  • Optional dependencies are built with make all

One may need to install additional dependencies for building the tools that BoSy depends on. Check the make output and the respective tool description for more information.

System Package Dependencies

The following packages need to be installed in order to build BoSy with all dependencies.

For CAQE, you also need Rust installed.

One may also need to install the python-is-python3 package.

Ubuntu 20.04

apt-get install bison build-essential clang cmake curl flex gcc git libantlr3c-dev libbdd-dev libboost-program-options-dev libicu-dev libreadline-dev mercurial psmisc unzip vim-common wget zlib1g-dev libsqlite3-dev python3-distutils
# for rust
apt-get install rustc cargo
# Haskell stack
curl -sSL https://get.haskellstack.org/ | sh

macOS

xcode-select --install
brew tap brewsci/science
brew install libbuddy haskell-stack cmake

Usage

BoSy uses a JSON based input file format (SYNTCOMP TLSF support via a transformation tool).

Consider the following arbiter specification for two clients. Every request from a client (signal r_0/r_1) must be eventually granted (signal g_0/g_1) by the arbiter with the restriction that g_0 and g_1 may not be set simultaneously.

{
	"semantics": "mealy",
	"inputs":  ["r_0", "r_1"],
	"outputs": ["g_0", "g_1"],
	"assumptions": [],
	"guarantees": [
		"G ((!g_0) || (!g_1))",
		"G (r_0 -> (F g_0))",
		"G (r_1 -> (F g_1))"
	]
}

The command ./bosy.sh [--synthesize] arbiter.json checks the specification for realizability. If the option --synthesize is given, a solution is extracted after realizability check. Check ./bosy.sh --help for more options.

Synthesis from HyperLTL Specifications

BoSyHyper (a separate binary) supports synthesis of reactive systems from specifications given in HyperLTL.

Example

The following system keeps a secret until the publish signal arrives.

{
    "semantics": "moore",
    "inputs": ["decision", "value", "publish"],
    "outputs": ["internal", "result"],
    "assumptions": [],
    "guarantees": [
        "!internal",
        "(G (decision -> (value <-> X internal)))",
        "(G (!decision -> (internal <-> X internal)))",
        "(G ( publish -> X(internal <-> result)))"
    ],
    "hyper": [
        "forall pi1 pi2. ( (publish[pi1] || publish[pi2]) R (result[pi1] <-> result[pi2]) )"
    ]
}
$ swift run -c release BoSyHyper Samples/HyperLTL/SecretDecision.bosy
info: Linear automaton contains 4 states
info: Hyper automaton contains 1 states
info: build encoding for bound 1
info: build encoding for bound 2
info: build encoding for bound 3
realizable

bosy's People

Contributors

aweinert avatar frederikschmitt avatar ltentrup avatar malteschledjewski avatar pefaymon avatar stemar94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bosy's Issues

`false` as guarantee leads to incorrect behavior

Just having a single guarantee false causes both players to be winning.

The probable cause is the construction of the CoBüchiautomaton.
This is a corner case that may not be handled correctly while looking for rejecting sinks.

[OSX] Couldn't posix_spawn error 8, when --synthesize option is passed to bosy

As title, when I tried to use the --synthesize option on OSX, an error is reported.
And I think the issue is related to the use of some linux-64 bit binaries

For example, in Solver.swift line 528
it tries to launch a binary under Tools/quabscm, which turns out to be a 64bit ELF executable
When I checked the make file, it is downloaded from a dropbox link, with only the linux binary in it.

Under the folder Tools, there are actually 4 binaries that are ELF executable instead of Mac-O executable:
caqem, hqs-linux, quabscm,vampire, that can likely cause the same problem.

So I'm just wandering if you would kindly provide the Mac-Version binary as well ?

Build problems

Environment:

OS: macOS 10.13.3 Beta
swiftc version: 4.0.3

I got a few errors while trying to build bosy:

While building ltl3ba:

cd Tools ; curl -OL https://sourceforge.net/projects/ltl3ba/files/ltl3ba/1.1/ltl3ba-1.1.3.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   746  100   746    0     0   1286      0 --:--:-- --:--:-- --:--:--  1286
cd Tools ; tar xzf ltl3ba-1.1.3.tar.gz
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
make: *** [Tools/ltl3ba-1.1.3] Error 1
rm Tools/ltl3ba-1.1.3.tar.gz

I downloaded the tarball manually from Sourceforge and edited out that part of the Makefile. Then:

cd Tools ; make -C ltl3ba-1.1.3
g++  -O3 -DNXT -I/usr/local/include/  -c -o parse.o parse.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from parse.c:36:
./ltl3ba.h:40:10: fatal error: 'bdd.h' file not found
#include <bdd.h>
         ^~~~~~~
1 error generated.
make[1]: *** [parse.o] Error 1
make: *** [Tools/ltl3ba-1.1.3/ltl3ba] Error 2

I determined this is because ltl3ba requires BuDDy (according to that project's readme). So, I downloaded v 2.4 from Sourceforge, then:

tar xzf buddy-2.4.tar.gz
cd buddy-2.4
./configure && make
make install

I didn't mind installing these to my system, but ideally if this were a part of building these directories would be installed more locally.

After that things seem to go OK, although I got this warning on each file:

cd Tools ; make -C ltl3ba-1.1.3
g++  -O3 -DNXT -I/usr/local/include/  -c -o parse.o parse.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from parse.c:36:
./ltl3ba.h:241:15: warning: 'print_set_out' has C-linkage specified, but returns user-defined type 'std::ostream &' (aka 'basic_ostream<char> &') which is incompatible with C [-Wreturn-type-c-linkage]
std::ostream& print_set_out(std::ostream &, int *, int);
              ^
1 warning generated.

After that, I ran the simple_arbiter sample and it seemed to work OK.

Encounters error in running the example HyperLTL spec in BoSy

Environment : Ubuntu 20.04

I have installed the swift
Done BoSy make
Installed other packages mentioned in the git page for Ubuntu 20.04

When I try to run : swift run -c release BoSyHyper Samples/HyperLTL/SecretDecision.bosy
I got the below error
##########
[1/1] Planning build

  • Build Completed!info: Linear automaton contains 4 states
    info: Hyper automaton contains 1 states
    info: build encoding for bound 1
    (set-logic UFDTLIA)
    .
    .
    .
    Foundation/Process.swift:388: Fatal error: Error Domain=NSCocoaErrorDomain Code=260 "The file doesn’t exist."
    Illegal instruction (core dumped)
    ##########

I have added complete output as attachment file

Kindly help me to fix this issue.

Error on dependencies when trying a fresh build

When trying to build, seems that there's an issue in Swift dependency graph file (I'm not sure of this, never used Swift before, I'm not sure how it handles dependencies).

cp Tools/spot-2.5/bin/ltl2tgba Tools/
swift build --configuration release -Xcc -O3 -Xcc -DNDEBUG -Xswiftc -Ounchecked
Updating https://github.com/ltentrup/CAiger.git
Updating https://github.com/ltentrup/SafetySynth.git
Updating https://github.com/apple/swift-package-manager.git
Updating https://github.com/ltentrup/CUDD.git
error: dependency graph is unresolvable; found these conflicting requirements:

Dependencies:
https://github.com/ltentrup/CAiger.git @ 0.1.0..<1.0.0
https://github.com/ltentrup/CUDD.git @ 0.2.0..<1.0.0
make: *** [Makefile:11: release] Error 1

Build Error

When building BoSy the cadet tool dependency causes an error due to an implicit function declaration.

Please find the compiler output attached.

Environment:
macOS 10.15.6
Apple clang version 12.0.0 (clang-1200.0.32.2)

output.txt

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.