Metadata-Version: 2.4
Name: mathlogic-automate
Version: 0.1.0
Summary: Automate common math calculations and logical/boolean calculations: arithmetic, algebra, geometry, trigonometry, statistics, calculus, and propositional logic.
Author-email: Prikshithari R <prikshithari2001@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Prikshit-rp07/mathlogic-automate
Project-URL: Issues, https://github.com/Prikshit-rp07/mathlogic-automate/issues
Keywords: math,mathematics,logic,boolean,algebra,geometry,calculus,statistics,trigonometry,truth-table,calculator
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sympy>=1.12
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Dynamic: license-file

# mathlogic-automate

A Python library that automates common mathematics **and** logic
calculations — arithmetic, algebra, geometry, trigonometry, statistics,
calculus, and propositional/boolean logic — all through simple,
well-documented functions.

## Installation

```bash
pip install mathlogic-automate
```

## Quick start

```python
import mathlogic_automate as mla

# Basic arithmetic
mla.add(2, 3)                     # 5
mla.factorial(5)                  # 120
mla.is_prime(17)                  # True

# Algebra
mla.solve_equation("x**2 - 4 = 0")            # [-2, 2]
mla.expand_expression("(x + 1)**2")           # 'x**2 + 2*x + 1'
mla.factor_expression("x**2 - 9")             # '(x - 3)*(x + 3)'
mla.quadratic_roots(1, -3, 2)                 # (1, 2)

# Geometry
mla.circle_area(5)                # 78.53981633974483
mla.triangle_area_heron(3, 4, 5)  # 6.0
mla.pythagoras(a=3, b=4)          # 5.0

# Trigonometry
mla.sin_deg(30)                   # 0.49999999999999994

# Statistics
mla.summary_stats([1, 2, 2, 3, 4])
# {'count': 5, 'mean': 2.4, 'median': 2, 'mode': [2], 'min': 1,
#  'max': 4, 'range': 3, 'variance': 1.3, 'std_dev': 1.140...}

# Calculus
mla.differentiate("x**3 + 2*x")   # '3*x**2 + 2'
mla.integrate_expr("2*x")         # 'x**2'
mla.definite_integral("x**2", "x", 0, 3)   # 9.0
mla.limit_of("sin(x)/x", "x", 0)  # '1'

# Logic
mla.evaluate_logical_expression("A AND (B OR NOT C)", {"A": True, "B": False, "C": False})
# True
mla.truth_table("A AND B")
# [{'A': False, 'B': False, 'result': False},
#  {'A': False, 'B': True,  'result': False},
#  {'A': True,  'B': False, 'result': False},
#  {'A': True,  'B': True,  'result': True}]
mla.simplify_boolean("A AND (A OR B)")   # 'A'
mla.is_tautology("A OR NOT A")           # True
mla.is_satisfiable("A AND NOT A")        # False
```

## Modules

| Module | Covers |
|---|---|
| `basic` | add, subtract, multiply, divide, power, square root, factorial, primes, gcd/lcm, percentage, average |
| `algebra` | solving equations & systems, expanding, factoring, simplifying, evaluating expressions |
| `geometry` | area, perimeter, surface area, and volume for common 2D/3D shapes |
| `trigonometry` | sin/cos/tan in degrees and radians |
| `statistics_ops` | mean, median, mode, variance, standard deviation, summary stats |
| `calculus` | differentiation, indefinite/definite integrals, limits |
| `logic` | truth tables, boolean simplification, CNF/DNF, tautology/contradiction/satisfiability checks, AND/OR/NOT/XOR/implies/equivalent |

## Logic expression syntax

Expressions accept either word operators or symbols:

| Meaning | Word form | Symbol form |
|---|---|---|
| AND | `A AND B` | `A & B` |
| OR | `A OR B` | `A \| B` |
| NOT | `NOT A` | `~A` |
| XOR | `A XOR B` | `A ^ B` |
| Implies | `A -> B` | `A -> B` |
| Equivalent | `A <-> B` | `A <-> B` |

## Running tests

```bash
pip install -e ".[dev]"
pytest
```

## License

MIT
