Metadata-Version: 2.4
Name: cosmo-synthesis
Version: 0.1.0
Summary: Assumption and strategy templates as contracted strategy masks for two-objective parity games
Keywords: parity games,contract-based synthesis,strategy templates,reactive synthesis
Author: Satya Prakash Nayak
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering
Project-URL: Homepage, https://github.com/satya2009rta/cosmo
Project-URL: Paper, https://arxiv.org/abs/2307.06212
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# CoSMo-**Co**ntracted-**S**trategy-**M**ask-Neg**o**tiation

CoSMo is a tool for computing assumption and strategy templates as contracted strategy masks for both players in a two-objective parity game, presented in the paper [Contract-Based Distributed Logical Controller Synthesis](https://arxiv.org/abs/2307.06212) (HSCC'24).

## Installation

### From PyPI

CoSMo is available on [PyPI](https://pypi.org/project/cosmo-synthesis/). The recommended way to install CoSMo is to use [uv](https://docs.astral.sh/uv/getting-started/installation/) or [pipx](https://pipx.pypa.io/stable/how-to/install-pipx.html), which install command-line tools in isolated environments and make them available on the `PATH`:

```
uv tool install cosmo-synthesis
```

or

```
pipx install cosmo-synthesis
```

This installs the executables `cosmo` and `genMaze`, which can then be called directly from the terminal.

Precompiled packages are available for Linux and macOS. On other platforms, CoSMo is compiled from source during the installation, which requires a compiler supporting C++20. The development version can be installed directly from this repository by replacing `cosmo-synthesis` with `git+https://github.com/satya2009rta/cosmo.git` in the commands above.

### Building from source

Building from source requires [GCC](https://gcc.gnu.org/install/). Run the following command to build all executable files

```
make
```

The executable files are generated and stored in the folder `./build/`.

## Usage 

Usage of each executable is outlined below.

### - cosmo
```
Usage: cosmo [OPTION...]
```

Inputs/Outputs:
- STDIN: 
    - description of a (single-objective) parity game in extended-HOA/pgsolver format OR 
    - description of a multi-objective parity game in extended-HOA/pgsolver format (except for the 1st objective, all other objectives are considered for player 1)
    - concatenated description of two parity games in extended-HOA format 
- STDOUT: 
    - assumption and strategy templates for each player (in case of a two-objective parity game)
    - assumption on player 1 and strategy template for player 0 in case of a single-objective parity game

The possible OPTIONs are as follows:
- --print-actions: print the template with actions instead of edges (only for games with labels on edges)
- --print-game: print the parity game (same format as input)
- --print-template-size: print size of the templates

Example usage:
```
cosmo --print-game < ./examples/test_dhoa_02.hoa
```

### - genMaze
```
Usage: genMaze [num_cols] [num_rows] [num_walls] [num_corr] [obj1] [obj2]
```

Inputs/Outputs:
- num_cols: number of columns
- num_rows: number of rows
- num_walls: number of walls
- num_corr: number of corridors (optional, default is 0)
- obj1: objective of Player 1 as a parity game in extended-HOA format (optional, default is GF ur0)
- obj2: objective of Player 2 as a parity game in extended-HOA format (optional, default is GF ul1)
- STDOUT: a maze benchmark as a two-objective parity game

Example usage:
```
genMaze 3 3 2 1
```


