Metadata-Version: 2.1
Name: py-aiger-ptltl
Version: 3.1.2
Summary: Library for generating (p)ast (t)ense (l)inear (t)emporal (l)ogic monitors as aiger circuits.
Home-page: https://github.com/mvcisback/py-aiger-past-ltl
License: MIT
Author: Marcell Vazquez-Chanlatte
Author-email: mvc@linux.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: with_bv
Requires-Dist: py-aiger (>=6.0.0,<7.0.0)
Requires-Dist: py-aiger-bv (>=4.5.2,<5.0.0); extra == "with_bv"
Project-URL: Repository, https://github.com/mvcisback/py-aiger-past-ltl
Description-Content-Type: text/markdown

# py-aiger-past-ltl

Library for generating (p)ast (t)ense (l)inear (t)emporal (l)ogic
monitors as aiger circuits. Builds on the [py-aiger](https://github.com/mvcisback/py-aiger) project.

[![Build Status](https://cloud.drone.io/api/badges/mvcisback/py-aiger-past-ltl/status.svg)](https://cloud.drone.io/mvcisback/py-aiger-past-ltl)
[![codecov](https://codecov.io/gh/mvcisback/py-aiger-past-ltl/branch/master/graph/badge.svg)](https://codecov.io/gh/mvcisback/py-aiger-past-ltl)
[![PyPI version](https://badge.fury.io/py/py-aiger-ptltl.svg)](https://badge.fury.io/py/py-aiger-ptltl)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)

<!-- markdown-toc end -->


# Installation

If you just need to use `aiger_ptltl`, you can just run:

`$ pip install py-aiger-ptltl`

For developers, note that this project uses the
[poetry](https://poetry.eustace.io/) python package/dependency
management tool. Please familarize yourself with it and then
run:

`$ poetry install`

# Usage

The primary entry point for using `aiger_ptltl` is the `PTLTLExpr`
class which is a simple extension of `aiger.BoolExpr` to support the
temporal operators, historically, past (once), (variant) yesterday,
and since.

```python
import aiger_ptltl as ptltl

# Atomic Propositions
x = ptltl.atom('x')
y = ptltl.atom('y')
z = ptltl.atom('z')

# Propositional logic
expr1 = ~x
expr2 = x & (y | z)
expr3 = (x & y) | ~z
expr4 = ~(x & y & z)

# Temporal Logic
expr5 = x.historically()  #  (H x) ≡ x has held for all previous cycles (inclusive).
expr6 = x.once()  #  (P x) ≡ x once held in a past cycle (inclusive).
expr7 = x.vyest()  #  (Z x) ≡ x held in the previous cycle (true at time = 0).
expr8 = x.yest()  #  (Y x) ≡ x held in the previous cycle (false at time = 0).
expr9 = x.since(y)  #  [x S y] ≡ x has held since the cycle after y last held.

# Composition
expr9 = expr7.since(expr9.vyest().vyest())
```

