Skip to main content

Linter for FO-dot, used in the IDP-Z3 system

Project description

FOLint

FOLint is a linting tool for FO(·). Its functionality can be split up in four parts:

  • Detection of syntax errors
  • Detection of type errors
  • Detection of typical formalization errors
  • Enforcing a style guide

This project was initially started by Lars Vermeulen during his master thesis: https://github.com/larsver/folint

Installation

pip install folint

CLI usage

folint file.idp

FOLint in editors

FOLint can be integrated in many editors. A collection of guides are kept in the folint-in-editors folder.

Build new version

python setup.py bdist_wheel sdist

Don't forget to update the version number of FOLint + the version number of IDP in the dependency!

Appendix: Full list of functionality

For a full list, see "Vermeulen, L. (2022). Statische Code Analyse voor FO(·). KU Leuven. Faculteit Industriële Ingenieurswetenschappen."

Type Checking

  • Typing of comparisons (f = g, f > g, …)
  • Typing of mathematical operators (x + y, x - y, …)
  • Warning for untyped quantifiers
  • Verifying the types of the elements in symbol interpretations

Common mistake checking

  • Warning when using a conjunction with universal quantification (e.g., !x in Person: age(x) > 18 & adult(x))
  • Warning when using an implication with existential quantification (e.g., ?x in Person: driving_license(x) => sober(x))
  • Worning when variable is only on one side of an equivalence (e.g., !x,y: phi(x) <=> psi(x, y))

Style guide

  • Use brackets with negated in statement
  • Warn against redundant brackets
  • Naming conventions: Type starting with capital letter, other symbols in snake_case
  • Highlight unused quantification variables
  • Warn when not using pretty_print

Other

  • Wrong number of arguments for predicate/function
  • Wrong number of arguments for model_check or using unknown block names
  • Checking if types are defined in voc or struct
  • Checking totality of functions
  • Checking for duplicate entries in interpretations
  • Checking corretness of entries in interpretations
  • Other minor linting such as "no double spaces", "spaces around connectives", ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

folint-1.0.8.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

folint-1.0.8-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file folint-1.0.8.tar.gz.

File metadata

  • Download URL: folint-1.0.8.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for folint-1.0.8.tar.gz
Algorithm Hash digest
SHA256 a289f54ce8e8c09724a60bef1d0dde852f6ac6f51763ad97c0826e1afa8c8d25
MD5 63a09ed1a6be30d18c21405187fac768
BLAKE2b-256 c4f40e7dcfccc498cd6c05d94f87609cbd2904eefb49e1dacc98b9d13ccd7410

See more details on using hashes here.

File details

Details for the file folint-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: folint-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for folint-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d5ae86c72eb5f1a77de8b40bd0b1cc94c46b8fc6e5e5d2c8c037f385294df00c
MD5 463df6aee6d8b6841202f00880b177ef
BLAKE2b-256 5602c3fb9cdeadb8dffb1f06aa94a22d9d820c20a508d1f29b3ae52c5511cac7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page