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.

Source Distribution

mvl-0.1.0.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

mvl-0.1.0-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

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