ctxform

Equivalence checker for contextual formulas

https://github.com/ningit/ctxform

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

equivalence-checker propositional-logic temporal-logic
Last synced: 6 months ago · JSON representation ·

Repository

Equivalence checker for contextual formulas

Basic Info
  • Host: GitHub
  • Owner: ningit
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 43.9 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
equivalence-checker propositional-logic temporal-logic
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Equivalence checker for contextual formulas

This is an equivalence checker for contextual formulas in propositional logic, LTL, and CTL. Contextual formulas extend ordinary formulas with expressions c[φ], where c is a context variable and φ is a contextual formula. Contexts are ordinary formulas with a special variable [], the hole, and a contextual formula is instantiated with a context for each context variable c by replacing c[φ] expressions with the context where the hole is in turn replaced by φ. Two contextual formulas are equivalent if all their instantiations are equivalent as ordinary formulas.

The tool's output indicates whether the equivalence holds, one formula implies the other, or they are unrelated. When there is no equivalence, a counterexample is obtained and consists of a context (simplified from the canonical context in the reference) and a valuation or counterexample trace for the propositional variables. Satisfiability and validity can be checked using the constant formulas true and false.

Usage

The command python -m ctxform in the root directory will start a REPL prompt for the two formulas of the identity. By default, LTL formulas are expected, but a different logic can be chosen with the command-line argument --logic name (or -l name) where name is either bool, ltl, or ctl. The option --any-formula (or -a) drops the assumption that the contexts are monotonic, i.e., it check whether the contextual formula holds for any replacement without restrictions. Negation normal form is not required even without the --any-formula flag. Other options are listed with --help.

The syntax of formulas is that of Spot, as described in the document Spot's Temporal Logic Formulas by Alexandre Duret-Lutz, extended with the A and E operators for CTL only.

The tool can also be used as a web interface with the command python -m ctxform.service -s 8080. This will start a web service on http://localhost:8080/ that can be stopped with Ctrl+C.

Dependencies

The tool requires Python 3.10 or a more recent version to run. Morever, it depends on the following packages:

  • lark (for parsing, can be installed with pip install lark).
  • pysat (for propositional logic, can be install with pip install python-sat).
  • spot (for LTL, instructions to install are available in https://spot.lre.epita.fr/install.html).
  • clt-sat (for CTL, a single binary that can be built from source). Our tool will look for the binary in the bin subdirectory of the current working directory. Some binaries are available in the release section of this repository.

The last three packages are only required if the corresponding logic is used. For the web interface, tornado (which can be installed with pip install tornado) is also required.

Benchmarks

The script test.py and the lists of formulas formulas.toml and mutated_formulas.toml have been used to test and benchmark the tool. Since some executions timeout and run out of memory, each equivalence is checked in a confined environment for which a Linux system with systemd is required. Moreover, systemd 255 or above is needed to obtain the memory usage peak, although the script can be run with an older version. The official Python bindings for D-Bus are used to communicate with systemd (usually a package named python3-dbus or dbus-python in the Linux distribution repositories).

Time and memory bounds can be adjusted with --timeout and --memlimit.

References

Owner

  • Login: ningit
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it as below.
authors:
- family-names: Rubio
  given-names: Rubén
  orcid: https://orcid.org/0000-0003-2983-3404
title: Equivalence checker for contextural formulas
version: 1.0.0
date-released: 2024-06-24
url: https://github.com/ningit/ctxform
preferred-citation:
  type: conference-paper
  doi: 10.4230/LIPIcs.CONCUR.2024.24
  authors:
    - family-names: Esparza
      given-names: Javier
      orcid: https://orcid.org/0000-0001-9862-4919
    - family-names: Rubio
      given-names: Rubén
      orcid: https://orcid.org/0000-0003-2983-3404
  title: Validity of contextual formulas
  conference:
    name: 35th International Conference on Concurrency Theory (CONCUR) 2024
    date-end: 2024-09-13
  year: 2024
  month: 9
  start: 11:1
  end: 11:20
  volume: 311
  collection-title: LIPIcs
  publisher:
    name: Schloss Dagstuhl - Leibniz-Zentrum für Informatik

GitHub Events

Total
Last Year

Dependencies

pyproject.toml pypi
  • lark *