MPP Test Suite Overview
This document provides an overview of the test files in the MPP project and the aspects of the system they are designed to validate.
Core Symbolic and Algebraic Tests
tests/simplify.rs
- Purpose: Verifies the correctness of the symbolic simplification engine (
src/simplify.rs
).
- Coverage:
- Simplification rules for fundamental operations like
Add
, Mul
, Pow
, especially with identity elements (0 and 1).
- Correct handling of constants such as
Pi
, PlanckConstant
.
- Simplification of complex and nested expressions to their canonical forms.
- Ensures terms are sorted and like terms are combined correctly.
tests/algebra_structure.rs
- Purpose: Validates the axiomatic properties of the algebraic structures defined in the MPP system, as outlined in
docs/MPP-Algebra.md
.
- Coverage:
- Property-based testing of axioms for:
- Commutative Ring (associativity, commutativity, identity, inverse, distributivity).
- Non-commutative Algebra.
- Tensor Algebra.
- Verification is done by comparing canonical forms of equivalent expressions.
tests/imaginary.rs
- Purpose: Tests operations and properties involving imaginary numbers.
- Coverage:
- Verification of
i^2
simplifying to -1
.
- Correct simplification of expressions like
1/i
to -i
.
- Basic arithmetic with complex symbolic expressions.
tests/euler.rs
- Purpose: Verifies Euler’s identity through symbolic simplification.
- Coverage:
- Ensures that the expression
e^(i*π) + 1
simplifies to 0
.
tests/symbolic_closure.rs
- Purpose: Tests the symbolic closure properties of the system, ensuring that operations on symbolic expressions yield valid symbolic expressions within the defined framework.
- Coverage:
- Verifies that various mathematical operations maintain symbolic integrity and do not unintentionally evaluate to numerical results prematurely.
- Checks consistency as described in
docs/MPP-Symbolic-Closure.md
.
Constants and Units Tests
tests/constants.rs
- Purpose: Verifies the definitions and fundamental relationships of core physical constants.
- Coverage:
- Identities like
c·τ = P
and c·Δ = P
.
Display
trait implementation for constants, ensuring correct string representation and round-trip parsing if applicable.
tests/constant_relationships.rs
- Purpose: Expands on testing the relationships between various primitive and derived constants.
- Coverage:
- Tests identities and conversions between constants as defined in
docs/MPP-Constants-Hierarchy.md
and docs/MPP-Physics.md
.
tests/dimensions.rs
- Purpose: Validates the dimensional analysis system (
src/dimensions.rs
).
- Coverage:
- Correct inference of physical dimensions from symbol names.
- Verification of dimensional consistency in equations and operations.
- Handling of base units (
[P]
, [τ]
, etc.) and rational exponents for dimensions.
- Error reporting for dimensional mismatches.
tests/units.rs
- Purpose: Tests the general system for handling physical units, potentially covering conversions and consistency for a broader range of units beyond fundamental Planck units.
- Coverage:
- Operations involving symbolic units.
- Consistency checks as per
docs/MPP-Units.md
.
tests/planck_units.rs
- Purpose: Focuses specifically on calculations and definitions involving Planck units.
- Coverage:
- Verifies expressions and simplifications involving
P
, τ
, Δ
, c
, ℏ
, etc.
- Ensures consistency with the system’s philosophy of using Planck-scale constants.
Physics Domain Tests
tests/calculus.rs
/ tests/integral.rs
- Purpose: Verifies the symbolic calculus engine, including differentiation and integration (
src/calculus.rs
).
- Coverage (
tests/integral.rs
as per PROMPT.md
):
- Fundamental integration rules (e.g.,
x^-1
to ln(x)
).
- Trigonometric integrals (e.g.,
sin(x)
to -cos(x)
).
- Partial derivatives, including chain rule and product rule.
- (Note:
PROMPT.md
also mentions tests/advanced_integration.rs
for more advanced techniques, which is not in the current file list but its described functionalities might be partially covered here or planned.)
tests/spacetime.rs
- Purpose: Tests functionalities related to 4D spacetime mathematics (
src/spacetime.rs
).
- Coverage:
- Operations with spacetime vectors.
- Calculation of spacetime intervals.
- Lorentz factor calculations.
- Handling of metric tensors (e.g.,
diag(1,-1,-1,-1)
).
tests/tensor.rs
- Purpose: Verifies basic tensor operations and manipulations (
src/tensor.rs
).
- Coverage:
- Tensor creation and representation.
- Fundamental tensor algebra operations (addition, scalar multiplication, tensor product).
- Contractions and other basic manipulations.
tests/tensor_variance.rs
- Purpose: Tests aspects of tensor variance and transformation properties under coordinate changes. This is crucial for General Relativity.
- Coverage:
- Initial tests for tensor transformation laws.
- Verification of how tensor components change with coordinate transformations (related to “Next Focus” in
PROMPT.md
).
tests/quantum.rs
- Purpose: Validates symbolic operations specific to quantum mechanics (
src/quantum.rs
).
- Coverage:
- Representation and manipulation of Ket and Bra vectors.
- Inner products (
\braket{\psi}{\phi}
).
- Commutator operations (
\commutator{A}{B}
).
- Basic properties of quantum operators.
tests/clifford.rs
- Purpose: Provides robust testing for Clifford algebra operations, particularly with Dirac gamma matrices.
- Coverage:
- Canonical ordering of gamma matrix products.
- Verification of anti-commutation relations (e.g.,
{γ^μ, γ^ν} = 2g^μν
).
- Simplification of complex products of gamma matrices.
- Operations relevant to
src/simplify.rs
enhancements for Dirac matrices.
tests/quantum_completeness.rs
- Purpose: Aims to test the completeness and consistency of the quantum mechanical framework within MPP.
- Coverage:
- May include tests for a comprehensive set of quantum postulates or ensuring that combinations of operations behave as expected in a complete system.
tests/quantum_field_theory.rs
- Purpose: Tests functionalities related to Quantum Field Theory (QFT).
- Coverage:
- Symbolic representation of QFT concepts (e.g., fields, creation/annihilation operators in a QFT context).
- Basic QFT calculations or simplifications.
tests/cosmological.rs
- Purpose: Verifies the implementation of cosmological constants and equations (
src/cosmology.rs
and docs/MPP-Cosmology.md
).
- Coverage:
- Correct representation and use of cosmological constants (Λ, H, Ω, etc.).
- Symbolic verification of Friedmann equations.
- Calculations involving scale factor, redshift, and density parameters.
- Dimensional consistency in cosmological equations.
tests/gauge_theory.rs
- Purpose: Tests concepts and operations related to gauge theories.
- Coverage:
- Symbolic manipulations relevant to gauge transformations.
- Interaction with tensor and quantum modules for gauge theory constructs.
tests/lie_algebra.rs
- Purpose: Tests structures and operations related to Lie algebras.
- Coverage:
- Verification of Lie bracket properties (anti-commutativity, Jacobi identity).
- Symbolic manipulation of Lie algebra elements.
tests/advanced_physics.rs
- Purpose: Contains tests for more complex, integrated physics calculations that may span multiple modules of the MPP system.
- Coverage:
- Could include derivations or verifications of known physical formulas or scenarios.
- Tests combining calculus, algebra, tensor methods, and physical constants.
tests/integration.rs
- Purpose: Focuses on “physics integration tests,” meaning it tests the integration of different symbolic modules to perform complex physical calculations.
- Coverage:
- Examples like the symbolic derivation of the Schwarzschild radius.
- Relativistic energy-momentum calculations.
- Scenarios that require interplay between
src/calculus.rs
, src/constants.rs
, src/spacetime.rs
, etc.
Parser Tests
tests/tex_parser.rs
- Purpose: Validates the MPP-TeX parser (
src/tex_parser.rs
).
- Coverage:
- Correct parsing of MPP-TeX syntax into symbolic expression trees.
- Operator precedence (e.g.,
a + b * c
vs. (a + b) * c
).
- Associativity rules (left, right).
- Handling of implicit multiplication (e.g.,
2\pi
).
- Parsing of all supported MPP-TeX commands (
\let
, \derive
, \ket
, \tensor
, etc.).
- Syntax error handling and reporting.