Skip to main content

Mathematical Logic

Project description

Dialectic

Mathematical logic implementation using python.

Install

pip install dialectic

Usage

from dialectic import Atomic

# Atomic objects
a = Atomic('a')
b = Atomic('b')

# Invert
invert = ~a

# Conjunction
conjunction = (a & b)

# Disjunction
disjunction = (a | b)

# Implication
implication = (a > b)

# Equality (iff)
equality = (a == b)

# Validation with given sentence set
implication.validate({a, b})

# Parsing a sentence list
from dialectic import parse_sentences

parsed_set = parse_sentences([implication, a])

# Inference
from dialectic import Inference

is_valid = Inference((a > b), [b]).is_valid_argument()
is_tautology = Inference((a | ~a)).is_tautology()
is_contradictory = Inference((a & ~a)).is_contradictory()
is_contingent = Inference((a & b)).is_contingent()

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

dialectic-0.3.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

dialectic-0.3.2-py3-none-any.whl (4.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