Skip to main content

A package which implements various systems of n valuedlogic.

Project description

MVL (many valued logic)

MVL (many valued logic) is a python package which implements different logic systems that use more than 2 values.

What logic systems are implemented?

The following 3 valued logic systems are supported by MVL:

  • Bochvar
  • Kleene
  • Priest

The following n valued logic systems are supported by MVL:

  • Łukasiewicz

The following systems are planned for future support:

  • Gödel MVL
  • Belnap
  • Product logic
  • Post logic

Usage

Using MVL is designed to integrate with existing python infrastructure as much as possible. Example usages of kleene and lukasiewicz logic are given below.

>>> from mvl import kleene as k
>>> k.t
LukasiewiczLogicValue.True
>>> k.and_(k.t, k.u)
0.5
>>> k.or_(k.u, k.u)
0.5
>>> k.implies(k.u, k.t)
1.0
>>> k.implies(k.u, k.u)
0.5
>>> k.implies(k.f, k.u)
1.0

>>> from mvl.lukasiewicz import *
>>> ls = LogicSystem(5, LukasiewiczLogicValue)
>>> ls.values
[LukasiewiczLogicValue(0.0), LukasiewiczLogicValue(0.25), LukasiewiczLogicValue(0.5), LukasiewiczLogicValue(0.75), LukasiewiczLogicValue(1.0)]
>>> t = ls.values[4]
>>> bool(t)
True
>>> bool(ls.values[3])
False

Project details


Download files

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

Files for mvl, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size mvl-0.1.0-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mvl-0.1.0.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page