mathema 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mathema-0.6.0/LICENSE.md +108 -0
- mathema-0.6.0/LICENSING.md +67 -0
- mathema-0.6.0/PKG-INFO +487 -0
- mathema-0.6.0/README.md +426 -0
- mathema-0.6.0/mathema/__init__.py +806 -0
- mathema-0.6.0/mathema/_brute_force.py +154 -0
- mathema-0.6.0/mathema/_deprecation.py +49 -0
- mathema-0.6.0/mathema/_indexed.py +145 -0
- mathema-0.6.0/mathema/_math_vocab.py +181 -0
- mathema-0.6.0/mathema/_providers.py +100 -0
- mathema-0.6.0/mathema/_render_mode.py +41 -0
- mathema-0.6.0/mathema/_sampling.py +182 -0
- mathema-0.6.0/mathema/_scan.py +134 -0
- mathema-0.6.0/mathema/_shrink.py +77 -0
- mathema-0.6.0/mathema/_target_resolvers.py +51 -0
- mathema-0.6.0/mathema/_tier_text.py +114 -0
- mathema-0.6.0/mathema/_timeout.py +155 -0
- mathema-0.6.0/mathema/acceptance.py +1282 -0
- mathema-0.6.0/mathema/analysis.py +1019 -0
- mathema-0.6.0/mathema/audit.py +1365 -0
- mathema-0.6.0/mathema/auth.py +334 -0
- mathema-0.6.0/mathema/authoring.py +727 -0
- mathema-0.6.0/mathema/badges.py +870 -0
- mathema-0.6.0/mathema/centrality.py +119 -0
- mathema-0.6.0/mathema/claim_families.py +2762 -0
- mathema-0.6.0/mathema/cli.py +3055 -0
- mathema-0.6.0/mathema/compendium/__init__.py +544 -0
- mathema-0.6.0/mathema/compendium/export.py +189 -0
- mathema-0.6.0/mathema/compiled.py +190 -0
- mathema-0.6.0/mathema/concepts.py +298 -0
- mathema-0.6.0/mathema/conjecture.py +5050 -0
- mathema-0.6.0/mathema/corroboration.py +185 -0
- mathema-0.6.0/mathema/diagnostics.py +592 -0
- mathema-0.6.0/mathema/dimensions.py +241 -0
- mathema-0.6.0/mathema/docstring.py +932 -0
- mathema-0.6.0/mathema/domain.py +1820 -0
- mathema-0.6.0/mathema/equivalence.py +827 -0
- mathema-0.6.0/mathema/f.py +59 -0
- mathema-0.6.0/mathema/families.py +287 -0
- mathema-0.6.0/mathema/fetch.py +91 -0
- mathema-0.6.0/mathema/finite_sets.py +123 -0
- mathema-0.6.0/mathema/forms.py +210 -0
- mathema-0.6.0/mathema/gates.py +826 -0
- mathema-0.6.0/mathema/grammar.py +3057 -0
- mathema-0.6.0/mathema/hazards.py +730 -0
- mathema-0.6.0/mathema/identity.py +166 -0
- mathema-0.6.0/mathema/impl_coverage.py +457 -0
- mathema-0.6.0/mathema/intent.py +162 -0
- mathema-0.6.0/mathema/interfaces/__init__.py +15 -0
- mathema-0.6.0/mathema/interfaces/extension.py +165 -0
- mathema-0.6.0/mathema/interfaces/mcp/__init__.py +18 -0
- mathema-0.6.0/mathema/interfaces/mcp/resources.py +222 -0
- mathema-0.6.0/mathema/interfaces/mcp/server.py +132 -0
- mathema-0.6.0/mathema/interfaces/mcp/tools.py +685 -0
- mathema-0.6.0/mathema/interfaces/runtime.py +147 -0
- mathema-0.6.0/mathema/inventory.py +999 -0
- mathema-0.6.0/mathema/lexicon.py +1085 -0
- mathema-0.6.0/mathema/linalg.py +233 -0
- mathema-0.6.0/mathema/locks.py +126 -0
- mathema-0.6.0/mathema/matrices.py +388 -0
- mathema-0.6.0/mathema/moved.py +137 -0
- mathema-0.6.0/mathema/partiality.py +43 -0
- mathema-0.6.0/mathema/probing.py +1211 -0
- mathema-0.6.0/mathema/py.typed +0 -0
- mathema-0.6.0/mathema/reason_codes.py +936 -0
- mathema-0.6.0/mathema/records.py +321 -0
- mathema-0.6.0/mathema/representations.py +102 -0
- mathema-0.6.0/mathema/review.py +195 -0
- mathema-0.6.0/mathema/routes.py +232 -0
- mathema-0.6.0/mathema/spec.py +2297 -0
- mathema-0.6.0/mathema/suggest.py +727 -0
- mathema-0.6.0/mathema/symbolic/__init__.py +47 -0
- mathema-0.6.0/mathema/symbolic/_base.py +1154 -0
- mathema-0.6.0/mathema/symbolic/_conditioned.py +1037 -0
- mathema-0.6.0/mathema/symbolic/_coupled.py +205 -0
- mathema-0.6.0/mathema/symbolic/_dot.py +188 -0
- mathema-0.6.0/mathema/symbolic/_extensive.py +769 -0
- mathema-0.6.0/mathema/symbolic/_fold.py +917 -0
- mathema-0.6.0/mathema/symbolic/_forms.py +250 -0
- mathema-0.6.0/mathema/symbolic/_guard_points.py +184 -0
- mathema-0.6.0/mathema/symbolic/_loop_shapes.py +108 -0
- mathema-0.6.0/mathema/symbolic/_matrix.py +400 -0
- mathema-0.6.0/mathema/symbolic/_normalize.py +422 -0
- mathema-0.6.0/mathema/symbolic/_partiality.py +591 -0
- mathema-0.6.0/mathema/symbolic/_proof_support.py +2823 -0
- mathema-0.6.0/mathema/symbolic/_prove.py +3402 -0
- mathema-0.6.0/mathema/symbolic/_recurrence.py +275 -0
- mathema-0.6.0/mathema/symbolic/_residues.py +908 -0
- mathema-0.6.0/mathema/symbolic/_seq_common.py +698 -0
- mathema-0.6.0/mathema/symbolic/_smt.py +309 -0
- mathema-0.6.0/mathema/symbolic/_strategies.py +345 -0
- mathema-0.6.0/mathema/symbolic/_sum.py +584 -0
- mathema-0.6.0/mathema/sync.py +444 -0
- mathema-0.6.0/mathema/targets.py +306 -0
- mathema-0.6.0/mathema/tiers.py +268 -0
- mathema-0.6.0/mathema/types.py +527 -0
- mathema-0.6.0/mathema/verify.py +1109 -0
- mathema-0.6.0/mathema.egg-info/PKG-INFO +487 -0
- mathema-0.6.0/mathema.egg-info/SOURCES.txt +343 -0
- mathema-0.6.0/mathema.egg-info/dependency_links.txt +1 -0
- mathema-0.6.0/mathema.egg-info/entry_points.txt +2 -0
- mathema-0.6.0/mathema.egg-info/requires.txt +42 -0
- mathema-0.6.0/mathema.egg-info/top_level.txt +1 -0
- mathema-0.6.0/pyproject.toml +169 -0
- mathema-0.6.0/setup.cfg +4 -0
- mathema-0.6.0/tests/test_abs_statement_round_trip.py +95 -0
- mathema-0.6.0/tests/test_accept_exit_codes.py +54 -0
- mathema-0.6.0/tests/test_acceptance.py +533 -0
- mathema-0.6.0/tests/test_annotation_domain_inference.py +73 -0
- mathema-0.6.0/tests/test_assuming_surface.py +434 -0
- mathema-0.6.0/tests/test_auth.py +257 -0
- mathema-0.6.0/tests/test_authoring.py +547 -0
- mathema-0.6.0/tests/test_badges.py +320 -0
- mathema-0.6.0/tests/test_blocked_codes.py +202 -0
- mathema-0.6.0/tests/test_boolean_returns.py +82 -0
- mathema-0.6.0/tests/test_boundary_fragility.py +107 -0
- mathema-0.6.0/tests/test_branch_pruning.py +392 -0
- mathema-0.6.0/tests/test_branch_pruning_edges.py +176 -0
- mathema-0.6.0/tests/test_branched_loops.py +306 -0
- mathema-0.6.0/tests/test_brute_force_route.py +158 -0
- mathema-0.6.0/tests/test_bundled_params.py +83 -0
- mathema-0.6.0/tests/test_calculus_probe_skip.py +35 -0
- mathema-0.6.0/tests/test_calculus_sugar.py +366 -0
- mathema-0.6.0/tests/test_callable_row_statement.py +33 -0
- mathema-0.6.0/tests/test_canonical_narrowing.py +45 -0
- mathema-0.6.0/tests/test_cdd_loop_e2e.py +92 -0
- mathema-0.6.0/tests/test_cdd_spec_conformance.py +269 -0
- mathema-0.6.0/tests/test_centrality.py +68 -0
- mathema-0.6.0/tests/test_chained_comparison.py +132 -0
- mathema-0.6.0/tests/test_check_headers.py +75 -0
- mathema-0.6.0/tests/test_claim_auto_names.py +106 -0
- mathema-0.6.0/tests/test_claim_floor.py +205 -0
- mathema-0.6.0/tests/test_claim_keywords.py +80 -0
- mathema-0.6.0/tests/test_claim_name_never_overrides_statement.py +56 -0
- mathema-0.6.0/tests/test_claim_notes.py +42 -0
- mathema-0.6.0/tests/test_claim_rows.py +144 -0
- mathema-0.6.0/tests/test_claim_store_round_trip.py +143 -0
- mathema-0.6.0/tests/test_claim_text_soundness.py +453 -0
- mathema-0.6.0/tests/test_claims_file_shape.py +154 -0
- mathema-0.6.0/tests/test_clamp_resolution.py +80 -0
- mathema-0.6.0/tests/test_classify_bound.py +59 -0
- mathema-0.6.0/tests/test_cli_audit_init.py +740 -0
- mathema-0.6.0/tests/test_cli_bad_arguments.py +124 -0
- mathema-0.6.0/tests/test_cli_blocked_detail.py +67 -0
- mathema-0.6.0/tests/test_cli_describe.py +133 -0
- mathema-0.6.0/tests/test_cli_describe_detail.py +275 -0
- mathema-0.6.0/tests/test_cli_describe_issue.py +109 -0
- mathema-0.6.0/tests/test_cli_errors.py +100 -0
- mathema-0.6.0/tests/test_cli_exit_codes.py +124 -0
- mathema-0.6.0/tests/test_cli_smoke.py +644 -0
- mathema-0.6.0/tests/test_cli_verify.py +376 -0
- mathema-0.6.0/tests/test_compact_output.py +400 -0
- mathema-0.6.0/tests/test_compendium.py +123 -0
- mathema-0.6.0/tests/test_compendium_acceptance.py +106 -0
- mathema-0.6.0/tests/test_compendium_export.py +95 -0
- mathema-0.6.0/tests/test_compiled_forms.py +105 -0
- mathema-0.6.0/tests/test_complex_defenses.py +78 -0
- mathema-0.6.0/tests/test_complex_domain.py +191 -0
- mathema-0.6.0/tests/test_complex_result_is_a_raise.py +77 -0
- mathema-0.6.0/tests/test_compound_bars.py +96 -0
- mathema-0.6.0/tests/test_comprehension_lifting.py +120 -0
- mathema-0.6.0/tests/test_concepts.py +265 -0
- mathema-0.6.0/tests/test_conditional_folds.py +126 -0
- mathema-0.6.0/tests/test_convex_combination_certificate.py +69 -0
- mathema-0.6.0/tests/test_corroboration.py +155 -0
- mathema-0.6.0/tests/test_coupled_accumulators.py +76 -0
- mathema-0.6.0/tests/test_critical_point_probing.py +104 -0
- mathema-0.6.0/tests/test_critical_points_cache.py +73 -0
- mathema-0.6.0/tests/test_declared_join.py +145 -0
- mathema-0.6.0/tests/test_declared_tolerance_is_the_whole_allowance.py +49 -0
- mathema-0.6.0/tests/test_definedness_region_claim.py +49 -0
- mathema-0.6.0/tests/test_dependencies.py +210 -0
- mathema-0.6.0/tests/test_deprecation.py +37 -0
- mathema-0.6.0/tests/test_derivative_at_a_kink.py +83 -0
- mathema-0.6.0/tests/test_derive_case_split.py +168 -0
- mathema-0.6.0/tests/test_derive_route_real_world.py +431 -0
- mathema-0.6.0/tests/test_deterministic_budgets.py +123 -0
- mathema-0.6.0/tests/test_diagnostic_report.py +128 -0
- mathema-0.6.0/tests/test_diagnostics_critical_points.py +96 -0
- mathema-0.6.0/tests/test_diagnostics_hazards.py +68 -0
- mathema-0.6.0/tests/test_diagnostics_motifs.py +103 -0
- mathema-0.6.0/tests/test_dimension_premises.py +94 -0
- mathema-0.6.0/tests/test_dimensions.py +630 -0
- mathema-0.6.0/tests/test_disequality_soundness.py +49 -0
- mathema-0.6.0/tests/test_docs_examples.py +282 -0
- mathema-0.6.0/tests/test_docs_outputs.py +611 -0
- mathema-0.6.0/tests/test_docstring.py +339 -0
- mathema-0.6.0/tests/test_docsync.py +330 -0
- mathema-0.6.0/tests/test_docsync_verb.py +204 -0
- mathema-0.6.0/tests/test_domain.py +205 -0
- mathema-0.6.0/tests/test_domain_key_validation.py +39 -0
- mathema-0.6.0/tests/test_domain_object_proof_support.py +149 -0
- mathema-0.6.0/tests/test_domain_projection.py +78 -0
- mathema-0.6.0/tests/test_domain_set_notation.py +185 -0
- mathema-0.6.0/tests/test_empty_premise_region.py +33 -0
- mathema-0.6.0/tests/test_enforce_domain_reads_every_claim_domain_shape.py +66 -0
- mathema-0.6.0/tests/test_equality_exact_disproof.py +77 -0
- mathema-0.6.0/tests/test_equality_guard_inside_interval.py +47 -0
- mathema-0.6.0/tests/test_equivalence.py +444 -0
- mathema-0.6.0/tests/test_equivalence_both_sides_raise.py +98 -0
- mathema-0.6.0/tests/test_erf_and_erfc.py +95 -0
- mathema-0.6.0/tests/test_evidence_ladder.py +39 -0
- mathema-0.6.0/tests/test_extended_math_functions.py +228 -0
- mathema-0.6.0/tests/test_extension_surface.py +206 -0
- mathema-0.6.0/tests/test_extensive_ladder.py +191 -0
- mathema-0.6.0/tests/test_extensive_proofs.py +395 -0
- mathema-0.6.0/tests/test_facts_injection.py +119 -0
- mathema-0.6.0/tests/test_falsification_needs_a_witness.py +95 -0
- mathema-0.6.0/tests/test_families.py +135 -0
- mathema-0.6.0/tests/test_family_disproof_witness.py +110 -0
- mathema-0.6.0/tests/test_fast_rescues.py +64 -0
- mathema-0.6.0/tests/test_field_reports.py +324 -0
- mathema-0.6.0/tests/test_finite_sets.py +93 -0
- mathema-0.6.0/tests/test_float_companion.py +286 -0
- mathema-0.6.0/tests/test_fold_composition.py +93 -0
- mathema-0.6.0/tests/test_fold_over_an_empty_sequence.py +58 -0
- mathema-0.6.0/tests/test_form_hash_is_interpreter_stable.py +47 -0
- mathema-0.6.0/tests/test_forms.py +73 -0
- mathema-0.6.0/tests/test_fractional_power_of_a_negative_base.py +51 -0
- mathema-0.6.0/tests/test_funcs_guarded.py +151 -0
- mathema-0.6.0/tests/test_function_vocab_parity.py +203 -0
- mathema-0.6.0/tests/test_gap_substitution.py +74 -0
- mathema-0.6.0/tests/test_gate.py +84 -0
- mathema-0.6.0/tests/test_grammar.py +516 -0
- mathema-0.6.0/tests/test_grammar_reservations.py +32 -0
- mathema-0.6.0/tests/test_guard_adjudication.py +225 -0
- mathema-0.6.0/tests/test_guarded_folds_and_domain_sugar.py +118 -0
- mathema-0.6.0/tests/test_hazards.py +75 -0
- mathema-0.6.0/tests/test_impl_coverage.py +424 -0
- mathema-0.6.0/tests/test_import_graph.py +146 -0
- mathema-0.6.0/tests/test_inequality_claims.py +46 -0
- mathema-0.6.0/tests/test_inferred_literal_domain.py +93 -0
- mathema-0.6.0/tests/test_init_agents.py +231 -0
- mathema-0.6.0/tests/test_integer_part_claims.py +248 -0
- mathema-0.6.0/tests/test_intent_acceptance.py +161 -0
- mathema-0.6.0/tests/test_interval_pass.py +111 -0
- mathema-0.6.0/tests/test_interval_soundness.py +173 -0
- mathema-0.6.0/tests/test_inventory.py +814 -0
- mathema-0.6.0/tests/test_is_arbitrary_input_safe.py +100 -0
- mathema-0.6.0/tests/test_is_compendium_safe.py +116 -0
- mathema-0.6.0/tests/test_is_defined.py +269 -0
- mathema-0.6.0/tests/test_is_defined_witness.py +112 -0
- mathema-0.6.0/tests/test_is_empty_safe.py +87 -0
- mathema-0.6.0/tests/test_is_extremity_safe.py +69 -0
- mathema-0.6.0/tests/test_is_missing_safe.py +204 -0
- mathema-0.6.0/tests/test_is_pole_safe.py +91 -0
- mathema-0.6.0/tests/test_is_representation_safe.py +102 -0
- mathema-0.6.0/tests/test_is_state_safe.py +83 -0
- mathema-0.6.0/tests/test_lambda_lifting.py +73 -0
- mathema-0.6.0/tests/test_lazy_sampling_setup.py +119 -0
- mathema-0.6.0/tests/test_let_bindings.py +257 -0
- mathema-0.6.0/tests/test_lexicon.py +434 -0
- mathema-0.6.0/tests/test_lifted_persistence.py +76 -0
- mathema-0.6.0/tests/test_lim_direction.py +160 -0
- mathema-0.6.0/tests/test_linalg.py +198 -0
- mathema-0.6.0/tests/test_live_function_binding.py +78 -0
- mathema-0.6.0/tests/test_locks.py +308 -0
- mathema-0.6.0/tests/test_marker_domains_in_family_probes.py +44 -0
- mathema-0.6.0/tests/test_mathema.py +827 -0
- mathema-0.6.0/tests/test_matrices.py +94 -0
- mathema-0.6.0/tests/test_matrix_derive.py +358 -0
- mathema-0.6.0/tests/test_matrix_family.py +131 -0
- mathema-0.6.0/tests/test_matrix_space_notation.py +111 -0
- mathema-0.6.0/tests/test_matrix_valued_and_dict.py +143 -0
- mathema-0.6.0/tests/test_mcp_tools.py +584 -0
- mathema-0.6.0/tests/test_method_lifting.py +145 -0
- mathema-0.6.0/tests/test_min_max_interval_bounds.py +78 -0
- mathema-0.6.0/tests/test_moved_function_reconcile.py +350 -0
- mathema-0.6.0/tests/test_multifunction.py +229 -0
- mathema-0.6.0/tests/test_nan_results_falsify.py +59 -0
- mathema-0.6.0/tests/test_negated_predicate_claims.py +28 -0
- mathema-0.6.0/tests/test_normalize.py +207 -0
- mathema-0.6.0/tests/test_notation_spellings.py +32 -0
- mathema-0.6.0/tests/test_operational_infinity_example.py +50 -0
- mathema-0.6.0/tests/test_ordering_tolerance_and_exact_disproof.py +123 -0
- mathema-0.6.0/tests/test_output_invariants.py +134 -0
- mathema-0.6.0/tests/test_output_routes.py +72 -0
- mathema-0.6.0/tests/test_overflow_is_a_raise_region.py +102 -0
- mathema-0.6.0/tests/test_packaging_metadata.py +70 -0
- mathema-0.6.0/tests/test_partiality_walk_coverage.py +130 -0
- mathema-0.6.0/tests/test_per_claim_domains.py +115 -0
- mathema-0.6.0/tests/test_power_tower_sign.py +162 -0
- mathema-0.6.0/tests/test_prime_notation.py +51 -0
- mathema-0.6.0/tests/test_probe_algorithmic_families.py +158 -0
- mathema-0.6.0/tests/test_probe_constants.py +71 -0
- mathema-0.6.0/tests/test_probe_samples_stay_in_domain.py +85 -0
- mathema-0.6.0/tests/test_probe_tries_domain_corners.py +39 -0
- mathema-0.6.0/tests/test_probe_tries_guard_points.py +70 -0
- mathema-0.6.0/tests/test_probing.py +348 -0
- mathema-0.6.0/tests/test_probing_extensive_mode.py +150 -0
- mathema-0.6.0/tests/test_project_root_inference.py +83 -0
- mathema-0.6.0/tests/test_provenance_surface_author.py +95 -0
- mathema-0.6.0/tests/test_providers.py +58 -0
- mathema-0.6.0/tests/test_pseudo_infinity_sugar.py +102 -0
- mathema-0.6.0/tests/test_raises_call_arity.py +39 -0
- mathema-0.6.0/tests/test_range_loop_trip_counts.py +133 -0
- mathema-0.6.0/tests/test_reason_codes.py +360 -0
- mathema-0.6.0/tests/test_record_slim_review.py +121 -0
- mathema-0.6.0/tests/test_recurrence.py +190 -0
- mathema-0.6.0/tests/test_registered_safety_predicates.py +75 -0
- mathema-0.6.0/tests/test_render_claim_text.py +448 -0
- mathema-0.6.0/tests/test_reproducible.py +64 -0
- mathema-0.6.0/tests/test_residues.py +252 -0
- mathema-0.6.0/tests/test_review_store_delta.py +100 -0
- mathema-0.6.0/tests/test_route_attempt_log.py +45 -0
- mathema-0.6.0/tests/test_route_capabilities.py +67 -0
- mathema-0.6.0/tests/test_runtime_protocol.py +107 -0
- mathema-0.6.0/tests/test_safety_family.py +97 -0
- mathema-0.6.0/tests/test_safety_probe_halves.py +90 -0
- mathema-0.6.0/tests/test_section_parsing.py +231 -0
- mathema-0.6.0/tests/test_shape_certificates.py +91 -0
- mathema-0.6.0/tests/test_shrink.py +35 -0
- mathema-0.6.0/tests/test_sign_certificates.py +95 -0
- mathema-0.6.0/tests/test_signals.py +41 -0
- mathema-0.6.0/tests/test_smt_rung.py +134 -0
- mathema-0.6.0/tests/test_space_domains_round_trip.py +43 -0
- mathema-0.6.0/tests/test_spec_domain.py +104 -0
- mathema-0.6.0/tests/test_stamp_license.py +134 -0
- mathema-0.6.0/tests/test_store_layers.py +414 -0
- mathema-0.6.0/tests/test_stratum.py +182 -0
- mathema-0.6.0/tests/test_strict_edges.py +74 -0
- mathema-0.6.0/tests/test_strict_relations.py +53 -0
- mathema-0.6.0/tests/test_string_params.py +193 -0
- mathema-0.6.0/tests/test_substitution_soundness.py +98 -0
- mathema-0.6.0/tests/test_suggest_claims.py +405 -0
- mathema-0.6.0/tests/test_sum_index_binding.py +91 -0
- mathema-0.6.0/tests/test_sum_prod_and_reserved.py +172 -0
- mathema-0.6.0/tests/test_summary_line_vocabulary.py +62 -0
- mathema-0.6.0/tests/test_symbolic.py +2057 -0
- mathema-0.6.0/tests/test_symbology_provider.py +161 -0
- mathema-0.6.0/tests/test_target_resolvers.py +136 -0
- mathema-0.6.0/tests/test_targets.py +117 -0
- mathema-0.6.0/tests/test_timeout_propagation.py +121 -0
- mathema-0.6.0/tests/test_tolerance_epsilon.py +112 -0
- mathema-0.6.0/tests/test_tuple_returns.py +86 -0
- mathema-0.6.0/tests/test_types.py +236 -0
- mathema-0.6.0/tests/test_undeclared_names.py +110 -0
- mathema-0.6.0/tests/test_variable_pipeline.py +57 -0
- mathema-0.6.0/tests/test_verdict_vocabulary.py +127 -0
- mathema-0.6.0/tests/test_verified_claim_reauthoring.py +369 -0
- mathema-0.6.0/tests/test_verified_record_integrity.py +377 -0
- mathema-0.6.0/tests/test_verified_store_roundtrip.py +302 -0
- mathema-0.6.0/tests/test_verify_record_is_stable.py +46 -0
- mathema-0.6.0/tests/test_verify_sweep_reporting.py +152 -0
- mathema-0.6.0/tests/test_wall_clock.py +205 -0
mathema-0.6.0/LICENSE.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Tetrion Ltd
|
|
6
|
+
|
|
7
|
+
Licensed Work: mathema 0.6.0
|
|
8
|
+
The Licensed Work is (c) 2026 Tetrion Ltd.
|
|
9
|
+
|
|
10
|
+
Additional Use Grant:
|
|
11
|
+
|
|
12
|
+
1. Grant. You may make production use of the Licensed Work, without
|
|
13
|
+
charge, if at the time of that use any of the following applies:
|
|
14
|
+
|
|
15
|
+
(a) Revenue. The total revenue of your Organisation in its most
|
|
16
|
+
recently completed financial year was less than USD 10,000,000
|
|
17
|
+
(or the equivalent in any other currency at the exchange rate
|
|
18
|
+
prevailing at the end of that year); or
|
|
19
|
+
|
|
20
|
+
(b) Repositories. The Licensed Work is used in connection with no
|
|
21
|
+
more than three Repositories across your Organisation in
|
|
22
|
+
aggregate; or
|
|
23
|
+
|
|
24
|
+
(c) Non-commercial use. Your use is for research, teaching, personal,
|
|
25
|
+
or other non-commercial purposes, and not for the benefit of any
|
|
26
|
+
commercial product, service or operation; or
|
|
27
|
+
|
|
28
|
+
(d) Evaluation. Your use is for the purpose of evaluating the Licensed Work, for a single period of no more than 90 days beginning on the date your Organisation first uses the Licensed Work for evaluation.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
2. Scope. Whether or not any of paragraphs 1(a) to 1(d) applies, this
|
|
32
|
+
Additional Use Grant does not extend to making the Licensed Work
|
|
33
|
+
available to any third party, whether or not for a fee, as part of or
|
|
34
|
+
in support of a Competing Product.
|
|
35
|
+
|
|
36
|
+
3. Use on behalf of others. Where you use the Licensed Work on behalf
|
|
37
|
+
of, or for the benefit of, another person or entity, the Organisation
|
|
38
|
+
of that person or entity is treated as your Organisation for the
|
|
39
|
+
purposes of paragraphs 1(a) and 1(b), and the Repositories of that
|
|
40
|
+
person or entity count toward the limit in paragraph 1(b).
|
|
41
|
+
|
|
42
|
+
4. Definitions. In this Additional Use Grant:
|
|
43
|
+
|
|
44
|
+
"Organisation" means the legal entity you act for, together with
|
|
45
|
+
every entity that controls it, is controlled by it, or is under
|
|
46
|
+
common control with it, and where you act for no legal entity, means
|
|
47
|
+
you.
|
|
48
|
+
|
|
49
|
+
"Repository" means a distinct source-code repository, under any version-control system, whose contents the Licensed Work reads, analyses, or produces output about. For purposes of paragraph 1(b), a single Repository containing multiple independently deployable applications, products, or services will be treated as a separate Repository for each such application, product, or service that uses the Licensed Work, regardless of whether they are maintained within the same version-control repository.
|
|
50
|
+
|
|
51
|
+
"Competing Product" means a product or service, made available to
|
|
52
|
+
third parties, whose primary function is (i) the adjudication,
|
|
53
|
+
verification or certification of claims about the behaviour or
|
|
54
|
+
correctness of software, including software produced with the
|
|
55
|
+
assistance of artificial intelligence; or (ii) substantially the same as the primary function of a product or service that the Licensor makes commercially available using the Licensed Work.
|
|
56
|
+
|
|
57
|
+
"Production Use" means use of the Licensed Work in connection with the development, testing, verification, analysis, build, deployment, maintenance, or assurance of software or systems intended for production or other real-world use. Production Use applies regardless of whether the Licensed Work itself is run in a production environment, development environment, CI/CD system, or other environment.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
5. Commercial licences. Production use outside the scope of this
|
|
61
|
+
Additional Use Grant requires a commercial licence from the Licensor.
|
|
62
|
+
Enquiries: licensing@tetrion.co.
|
|
63
|
+
|
|
64
|
+
Change Date: 2030-09-24
|
|
65
|
+
(four years from the 2026-09-24
|
|
66
|
+
release of version 0.6.0)
|
|
67
|
+
|
|
68
|
+
Change License: GNU Affero General Public License v3.0 or
|
|
69
|
+
later (AGPL-3.0-or-later)
|
|
70
|
+
|
|
71
|
+
For information about alternative licensing arrangements for the
|
|
72
|
+
Licensed Work, please contact licensing@tetrion.co.
|
|
73
|
+
|
|
74
|
+
-----------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
License text copyright © 2024 MariaDB plc, All Rights Reserved. “Business Source License” is a trademark of MariaDB plc.
|
|
77
|
+
|
|
78
|
+
Terms
|
|
79
|
+
|
|
80
|
+
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
|
|
81
|
+
|
|
82
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
|
|
83
|
+
|
|
84
|
+
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
|
|
85
|
+
|
|
86
|
+
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
|
|
87
|
+
|
|
88
|
+
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
|
|
89
|
+
|
|
90
|
+
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
|
91
|
+
|
|
92
|
+
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
|
|
93
|
+
|
|
94
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark “Business Source License”, as long as you comply with the Covenants of Licensor below.
|
|
95
|
+
|
|
96
|
+
Covenants of Licensor
|
|
97
|
+
|
|
98
|
+
In consideration of the right to use this License’s text and the “Business Source License” name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
|
|
99
|
+
|
|
100
|
+
To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where “compatible” means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
|
|
101
|
+
|
|
102
|
+
To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text “None” to specify a Change Date. Not to modify this License in any other way.
|
|
103
|
+
|
|
104
|
+
Notice
|
|
105
|
+
|
|
106
|
+
The Business Source License (this document, or the “License”) is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
|
|
107
|
+
|
|
108
|
+
For more information on the use of the Business Source License for MariaDB products, please visit the MariaDB Business Source License FAQ. For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Licensing
|
|
2
|
+
|
|
3
|
+
mathema is source-available under the [Business Source License
|
|
4
|
+
1.1](LICENSE.md), copyright Tetrion Ltd. This page is a plain-language
|
|
5
|
+
restatement plus Tetrion's licensing policy; the license text in
|
|
6
|
+
[LICENSE.md](LICENSE.md) is what governs (including its Additional
|
|
7
|
+
Use Grant, where the free-use permissions below actually live) and
|
|
8
|
+
wins if the two ever disagree.
|
|
9
|
+
|
|
10
|
+
That covers the software. The **documentation prose and examples are
|
|
11
|
+
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)**: quote them,
|
|
12
|
+
adapt them and republish them, commercially or not, with attribution.
|
|
13
|
+
|
|
14
|
+
## Free production use: who qualifies
|
|
15
|
+
|
|
16
|
+
The Additional Use Grant in LICENSE.md permits production use without
|
|
17
|
+
charge when **any** of these applies to your Organisation (your legal
|
|
18
|
+
entity together with everything that controls it, is controlled by
|
|
19
|
+
it, or is under common control with it):
|
|
20
|
+
|
|
21
|
+
- **Revenue floor**: total Organisation revenue under **USD
|
|
22
|
+
10,000,000** in your most recently completed fiscal year; or
|
|
23
|
+
- **Repository floor**: mathema is used in connection with **no more
|
|
24
|
+
than three code repositories** across the Organisation; or
|
|
25
|
+
- **Non-commercial**: research, teaching, personal, or other
|
|
26
|
+
non-commercial use; or
|
|
27
|
+
- **Evaluation**: up to **90 days** from the Organisation's first
|
|
28
|
+
use.
|
|
29
|
+
|
|
30
|
+
Whatever your size: the grant never permits providing third parties a
|
|
31
|
+
product or service that substantially does what mathema does, or what
|
|
32
|
+
any Tetrion product built on mathema does.
|
|
33
|
+
|
|
34
|
+
Everything short of production use (copying, modifying, creating
|
|
35
|
+
derivative works, redistributing, non-production use) is granted to
|
|
36
|
+
everyone by the license's own Terms, no grant needed.
|
|
37
|
+
|
|
38
|
+
## Above the floor
|
|
39
|
+
|
|
40
|
+
If none of the grant's conditions applies to you, production use
|
|
41
|
+
requires a commercial license, contact licensing@tetrion.co.
|
|
42
|
+
|
|
43
|
+
## Cure policy
|
|
44
|
+
|
|
45
|
+
If your Organisation drifts out of the grant (crosses the revenue
|
|
46
|
+
floor at a fiscal year end, exceeds the three-repository floor, or an
|
|
47
|
+
evaluation runs past 90 days), you have **60 days** from the date the
|
|
48
|
+
condition ceased to apply to either obtain a commercial license or
|
|
49
|
+
end production use. Tetrion treats good-faith use during that window
|
|
50
|
+
as licensed; rights under the license terminate only after the window
|
|
51
|
+
closes without either happening.
|
|
52
|
+
|
|
53
|
+
## Conversion schedule
|
|
54
|
+
|
|
55
|
+
Every released version of mathema converts to the **GNU Affero
|
|
56
|
+
General Public License v3.0 or later** on its Change Date: **four
|
|
57
|
+
years after that version's release**, computed at release and written
|
|
58
|
+
into the release's own LICENSE.md. After conversion the version is
|
|
59
|
+
under an OSI-approved copyleft licence and the restrictions above stop
|
|
60
|
+
applying to it entirely.
|
|
61
|
+
|
|
62
|
+
## The policy document
|
|
63
|
+
|
|
64
|
+
The operative statement of the cure policy, the floors, and the
|
|
65
|
+
conversion schedule is published at
|
|
66
|
+
[docs/licensing-policy.md](docs/licensing-policy.md); this page
|
|
67
|
+
restates it alongside the license summary.
|
mathema-0.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mathema
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: A Python verification engine for Claim-Driven Development: state explicit mathematical claims about code and adjudicate them against symbolic and empirical evidence.
|
|
5
|
+
Author-email: Tetrion Ltd <contact@tetrion.co>
|
|
6
|
+
License-Expression: BUSL-1.1
|
|
7
|
+
Project-URL: Homepage, https://mathema.tetrionlabs.com
|
|
8
|
+
Project-URL: Documentation, https://mathema.tetrionlabs.com
|
|
9
|
+
Project-URL: Repository, https://github.com/tetrionlabs/mathema
|
|
10
|
+
Project-URL: Issues, https://github.com/tetrionlabs/mathema/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/tetrionlabs/mathema/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: claims,verification,property-based-testing,symbolic-mathematics,sympy,proof,static-analysis,specification,testing
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE.md
|
|
28
|
+
License-File: LICENSING.md
|
|
29
|
+
Requires-Dist: sympy<2,>=1.12
|
|
30
|
+
Requires-Dist: pyyaml>=6
|
|
31
|
+
Provides-Extra: docs
|
|
32
|
+
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
33
|
+
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
|
|
34
|
+
Requires-Dist: mkdocstrings[python]>=0.25; extra == "docs"
|
|
35
|
+
Requires-Dist: mkdocs-llmstxt>=0.2; extra == "docs"
|
|
36
|
+
Provides-Extra: numpy
|
|
37
|
+
Requires-Dist: numpy; extra == "numpy"
|
|
38
|
+
Provides-Extra: test
|
|
39
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
40
|
+
Requires-Dist: pytest-xdist>=3; extra == "test"
|
|
41
|
+
Requires-Dist: pytest-cov>=7; extra == "test"
|
|
42
|
+
Requires-Dist: mathema[coverage,numpy]; extra == "test"
|
|
43
|
+
Requires-Dist: tomli>=2; python_version < "3.11" and extra == "test"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
46
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
47
|
+
Requires-Dist: pre-commit>=3; extra == "dev"
|
|
48
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
49
|
+
Requires-Dist: mypy>=1.8; extra == "dev"
|
|
50
|
+
Provides-Extra: mcp
|
|
51
|
+
Requires-Dist: mcp<3,>=1.2; extra == "mcp"
|
|
52
|
+
Provides-Extra: smt
|
|
53
|
+
Requires-Dist: z3-solver>=4.12; extra == "smt"
|
|
54
|
+
Provides-Extra: coverage
|
|
55
|
+
Requires-Dist: coverage>=7; extra == "coverage"
|
|
56
|
+
Provides-Extra: symbology
|
|
57
|
+
Requires-Dist: mathema-symbology; extra == "symbology"
|
|
58
|
+
Provides-Extra: all
|
|
59
|
+
Requires-Dist: mathema[coverage,mcp,numpy,smt]; extra == "all"
|
|
60
|
+
Dynamic: license-file
|
|
61
|
+
|
|
62
|
+
# mathema
|
|
63
|
+
|
|
64
|
+
*Know what your code actually guarantees.*
|
|
65
|
+
|
|
66
|
+
AI has changed the cost of producing code without changing the cost of knowing
|
|
67
|
+
whether that code is correct, and so more of it now arrives than anyone can
|
|
68
|
+
review line by line. **mathema** adds a verification layer between AI-assisted
|
|
69
|
+
code and trusted systems: you state what a function is supposed to do as an
|
|
70
|
+
explicit claim, and mathema checks it against the real function, proving it
|
|
71
|
+
outright where the mathematics permits and gathering reported evidence where
|
|
72
|
+
it does not. What comes back is a durable record of what has been established,
|
|
73
|
+
how, and whether it still applies to the code in front of you.
|
|
74
|
+
|
|
75
|
+
Nothing is asserted and nothing is quietly upgraded. Evidence remains
|
|
76
|
+
evidence, proof remains proof, and a claim that nothing could settle remains
|
|
77
|
+
unresolved and says so.
|
|
78
|
+
|
|
79
|
+
mathema is a System 0 engine: a verification engine with zero models between
|
|
80
|
+
the code and its verdict. Every result comes from mathematics and from running
|
|
81
|
+
the real code, never from a model's judgement, so there are no LLM tokens to
|
|
82
|
+
pay for, no account or API key, and your code never leaves your machine.
|
|
83
|
+
|
|
84
|
+
The name is Greek: μάθημα, a thing learned.
|
|
85
|
+
|
|
86
|
+
Why it matters: [The bottleneck moved](https://tetrionlabs.com/why/), on how
|
|
87
|
+
AI moves the bottleneck from writing code to reviewing it, and what mathema
|
|
88
|
+
does about it.
|
|
89
|
+
|
|
90
|
+
## See it in action
|
|
91
|
+
|
|
92
|
+
Here is a European call minus a European put on the same strike, both legs
|
|
93
|
+
priced by Black-Scholes, with a square root, a logarithm, an exponential and
|
|
94
|
+
the Gaussian CDF expressed through `math.erf`:
|
|
95
|
+
|
|
96
|
+
<!-- example: parity file=options.py -->
|
|
97
|
+
```python
|
|
98
|
+
import math
|
|
99
|
+
|
|
100
|
+
def put_call_parity_gap(s: float, k: float, r: float, t: float,
|
|
101
|
+
sigma: float) -> float:
|
|
102
|
+
"""A European call minus a European put on the same strike."""
|
|
103
|
+
root_t = math.sqrt(t)
|
|
104
|
+
d1 = (math.log(s / k) + (r + 0.5 * sigma * sigma) * t) / (sigma * root_t)
|
|
105
|
+
d2 = d1 - sigma * root_t
|
|
106
|
+
phi = lambda z: 0.5 * (1.0 + math.erf(z / math.sqrt(2.0)))
|
|
107
|
+
call = s * phi(d1) - k * math.exp(-r * t) * phi(d2)
|
|
108
|
+
put = k * math.exp(-r * t) * phi(-d2) - s * phi(-d1)
|
|
109
|
+
return call - put
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Put-call parity says that difference collapses to `S - K*exp(-r*T)`, whatever
|
|
113
|
+
the volatility, which is a surprising thing to say about a function where
|
|
114
|
+
`sigma` appears five times. State it as a claim over the region it should hold
|
|
115
|
+
on:
|
|
116
|
+
|
|
117
|
+
<!-- example: parity run -->
|
|
118
|
+
```bash
|
|
119
|
+
mathema check options.py --claim "for s in [50,150], k in [50,150], \
|
|
120
|
+
r in [0.0,0.1], t in [0.1,2], sigma in [0.05,0.8], \
|
|
121
|
+
f(s,k,r,t,sigma) == s - k*exp(-r*t)"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
<!-- example: parity output -->
|
|
125
|
+
```text
|
|
126
|
+
ok options.put_call_parity_gap: source, no side effects; claims 2/2 adjudicated (1 proven, 1 holds, 0 falsified)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Everything before the last comma is the domain and everything after it is the
|
|
130
|
+
law, with `f` standing for the function under test. `[0.1,2]` is a
|
|
131
|
+
mathematical interval rather than a two-element Python list, so the claim
|
|
132
|
+
covers every real value in it, and mathema lifted the body to a symbolic
|
|
133
|
+
expression in which both Gaussian terms cancel and `sigma` disappears,
|
|
134
|
+
establishing the identity for the whole region at once. The second row is
|
|
135
|
+
that proof's `[float]` companion, a separate claim that runs the same identity
|
|
136
|
+
through the real code in floating point at the region's corners and across its
|
|
137
|
+
interior, because a proof is about the mathematics and whether the
|
|
138
|
+
implementation keeps up with it in f64 is a different question, answered here
|
|
139
|
+
by `holds`. The [claim grammar](https://mathema.tetrionlabs.com/grammar/) has
|
|
140
|
+
the full notation.
|
|
141
|
+
|
|
142
|
+
The domain is doing real work: drop it and the same claim comes back
|
|
143
|
+
`falsified`, with a counterexample at a negative maturity where `math.sqrt(t)`
|
|
144
|
+
raises, because a claim with no domain covers every real input, including ones
|
|
145
|
+
the function was never meant to take. A claim without its domain is a
|
|
146
|
+
different claim, and mathema says so rather than assuming the range you had in
|
|
147
|
+
mind.
|
|
148
|
+
|
|
149
|
+
## Proof is not the same as testing
|
|
150
|
+
|
|
151
|
+
A test demonstrates behaviour at the inputs you chose, and a property-based
|
|
152
|
+
test at many inputs you did not, but neither can say anything about the
|
|
153
|
+
uncountably many points of `[0.1,2]` it never visited. mathema keeps its
|
|
154
|
+
verdicts apart so you always know which kind of answer you have:
|
|
155
|
+
|
|
156
|
+
| Verdict | Means |
|
|
157
|
+
|---|---|
|
|
158
|
+
| `proven` | established mathematically over the claim's stated domain |
|
|
159
|
+
| `holds (n=...)` | survived exactly `n` behavioural trials, which is evidence, not proof |
|
|
160
|
+
| `falsified` | a counterexample was found by running the function, and is kept |
|
|
161
|
+
| `invalidated` | was `proven` or `holds` in the previous record, and the current code no longer supports it |
|
|
162
|
+
| `unknown` | nothing was decided, and the record keeps the reason |
|
|
163
|
+
| `skipped` | the claim could not be adjudicated as stated, and the record says why |
|
|
164
|
+
|
|
165
|
+
[Guarantees and limits](https://mathema.tetrionlabs.com/guarantees/) states what each
|
|
166
|
+
verdict establishes and what it does not, in one place.
|
|
167
|
+
|
|
168
|
+
The same distinction reaches claims no amount of test-running could establish.
|
|
169
|
+
Four defining properties of the logistic function include a limit at infinity and an
|
|
170
|
+
improper integral over the whole real line, and all four come back proven, with a
|
|
171
|
+
fifth row for the symmetry identity's `[float]` companion (the calculus claims
|
|
172
|
+
spawn none, having no point to execute). The two identities carry a range
|
|
173
|
+
because this code overflows below about `x = -709.78`, and stated over the
|
|
174
|
+
whole line mathema falsifies them there:
|
|
175
|
+
|
|
176
|
+
<!-- example: sigmoid file=sigmoid.py -->
|
|
177
|
+
```python
|
|
178
|
+
import math
|
|
179
|
+
|
|
180
|
+
def logistic(x: float) -> float:
|
|
181
|
+
return 1.0 / (1.0 + math.exp(-x))
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
<!-- example: sigmoid run -->
|
|
185
|
+
```bash
|
|
186
|
+
mathema check sigmoid.py \
|
|
187
|
+
--claim "for x in [-700, 700], d(f(x), x) == f(x)*(1 - f(x))" \
|
|
188
|
+
--claim "for x in [-700, 700], f(-x) == 1 - f(x)" \
|
|
189
|
+
--claim "lim(f(x), x -> oo) == 1" \
|
|
190
|
+
--claim "∫(d(f(x), x), x, -oo, oo) == 1"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
<!-- example: sigmoid output -->
|
|
194
|
+
```text
|
|
195
|
+
ok sigmoid.logistic: source, no side effects; claims 5/5 adjudicated (4 proven, 1 holds, 0 falsified)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## When the code is wrong
|
|
199
|
+
|
|
200
|
+
Proving a good function correct is the easy half, and the question that
|
|
201
|
+
matters more is whether a bad one gets caught. Here is a discount factor with a
|
|
202
|
+
pole hiding in it, checked with no claims at all, only mathema's built-in laws:
|
|
203
|
+
|
|
204
|
+
<!-- example: pole run -->
|
|
205
|
+
```python
|
|
206
|
+
import mathema
|
|
207
|
+
|
|
208
|
+
def discount_factor(x: float) -> float:
|
|
209
|
+
"""A discount factor that divides by one minus the rate."""
|
|
210
|
+
return 1 / (1 - x)
|
|
211
|
+
|
|
212
|
+
print(mathema.check(discount_factor))
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
<!-- example: pole output match=subset -->
|
|
216
|
+
```text
|
|
217
|
+
mathema.Record(discount_factor) · source, no side effects · form ebb4c9b87847
|
|
218
|
+
FALSIFY monotonic_increasing[x]: d(f(x), x) >= 0
|
|
219
|
+
counterexample x = 1
|
|
220
|
+
FALSIFY even: f(-x) = f(x)
|
|
221
|
+
counterexample x = -1
|
|
222
|
+
proven is_deterministic: f(x) = f(x)
|
|
223
|
+
proven is_defined: 1 - x != 0
|
|
224
|
+
FALSIFY is_pole_safe[x]: is_pole_safe(x)
|
|
225
|
+
counterexample x = 1 is admitted by the declared domain but sits at or beside a pole: the call raised ZeroDivisionError
|
|
226
|
+
FALSIFY is_representation_safe[x]: is_representation_safe(x)
|
|
227
|
+
counterexample x = 1 (the int spelling) is admitted by the declared domain but the call raised ZeroDivisionError
|
|
228
|
+
[implementation:representation]
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
(trimmed from fourteen claims). The pole was not found by luck: uniform random
|
|
232
|
+
sampling lands exactly on `x == 1` with probability zero, so a property-based
|
|
233
|
+
run can pass a thousand trials here and report nothing, whereas mathema solves
|
|
234
|
+
the lifted expression for where the denominator vanishes and makes sure that
|
|
235
|
+
point is tried. Every falsification rests on an executed witness, never on a
|
|
236
|
+
symbolic argument alone, and the bracketed tag marks an implementation that
|
|
237
|
+
fell over (the integer `1` raising where the domain admits it). `is_defined`
|
|
238
|
+
reads the other way round: it states the region on which `f` returns, and
|
|
239
|
+
`1 - x != 0` is exactly that region.
|
|
240
|
+
|
|
241
|
+
## Built for AI-assisted development
|
|
242
|
+
|
|
243
|
+
An agent can write the code and propose the claims, but mathema reserves the
|
|
244
|
+
decisions that turn a verdict into an accepted fact for a person, so the agent
|
|
245
|
+
never gets to mark its own homework:
|
|
246
|
+
|
|
247
|
+
<!-- illustration -->
|
|
248
|
+
```text
|
|
249
|
+
agent proposes a claim
|
|
250
|
+
↓
|
|
251
|
+
mathema adjudicates it against the real function
|
|
252
|
+
↓
|
|
253
|
+
a person accepts the verdict (mathema accept)
|
|
254
|
+
↓
|
|
255
|
+
the function is locked (mathema lock)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
No tool exposed over MCP accepts a verdict from its caller, and claim
|
|
259
|
+
expressions are validated against a strict AST whitelist before they run, so
|
|
260
|
+
a claim from an untrusted source can do no more than evaluate mathematics over
|
|
261
|
+
the function (the function itself runs as it would in its own tests; see
|
|
262
|
+
[Security and execution](https://mathema.tetrionlabs.com/security/)). `mathema accept` prints the
|
|
263
|
+
exact write before making it, and lets a person accept evidence as sufficient,
|
|
264
|
+
own a residual risk explicitly, or correct a claim the falsification showed
|
|
265
|
+
was wrong (the correction is itself adjudicated first). An agent may lock a
|
|
266
|
+
function it has finished; only a person can unlock one, behind a prompt and
|
|
267
|
+
optionally a PIN, with deliberately no `--yes` flag.
|
|
268
|
+
|
|
269
|
+
## Verification that survives code changes
|
|
270
|
+
|
|
271
|
+
Every verdict binds to the exact code that earned it, through two identity
|
|
272
|
+
hashes: `form`, over the AST structure with names and formatting normalised
|
|
273
|
+
away, and `sig`, over the parameter shape. `mathema.write_spec` writes the
|
|
274
|
+
record as standalone YAML under `.mathema/verified/`, and `mathema verify`
|
|
275
|
+
later re-checks every record whose function, or a function it depends on, has
|
|
276
|
+
changed since, so a verification result cannot quietly outlive the
|
|
277
|
+
implementation it describes the way a test result does the moment nobody
|
|
278
|
+
re-runs it. A locked
|
|
279
|
+
function fails verification the moment its body changes, though docstring
|
|
280
|
+
edits stay allowed.
|
|
281
|
+
|
|
282
|
+
mathema is fully offline: nothing in checking, verifying or recording makes a
|
|
283
|
+
network call, so none of this sends your source or your claims anywhere. The
|
|
284
|
+
one command that fetches anything is the explicit, opt-in `mathema init
|
|
285
|
+
--agents`, which clones the skills repository.
|
|
286
|
+
|
|
287
|
+
## Audit a codebase you didn't write
|
|
288
|
+
|
|
289
|
+
`mathema audit` reads a whole package without running anything and gives every
|
|
290
|
+
function a row: its location as a ready-made `sed -n` line range, its
|
|
291
|
+
branching, whether it carries claims, whether the derive route could prove
|
|
292
|
+
things about it, the state outside its parameters it reads or writes, whether
|
|
293
|
+
a test report covers it, and how well its docstring states its intent.
|
|
294
|
+
|
|
295
|
+
`mathema audit --index` writes the same map to `.mathema/index.yaml`, with each
|
|
296
|
+
module's stated intent and every function's file, line and span, which is the
|
|
297
|
+
fastest way to hand an agent a codebase without letting it grep its way around.
|
|
298
|
+
|
|
299
|
+
## Beyond tests
|
|
300
|
+
|
|
301
|
+
| | Unit tests | Property-based testing | Symbolic execution (CrossHair) | Proof assistants and SMT solvers | mathema |
|
|
302
|
+
|---|:-:|:-:|:-:|:-:|:-:|
|
|
303
|
+
| Checks the examples you chose | ✓ | ✓ | | | ✓ |
|
|
304
|
+
| Checks many generated inputs | | ✓ | ✓ | | ✓ |
|
|
305
|
+
| Proves a claim over its whole domain | | | when every path is explored | ✓ | ✓ where the function lifts |
|
|
306
|
+
| Works on ordinary Python, no separate specification language | ✓ | ✓ | ✓ | | ✓ |
|
|
307
|
+
| Keeps a record bound to the exact code it verified | | | | ✓ | ✓ |
|
|
308
|
+
| Routes each claim to whatever method can settle it | | | | | ✓ |
|
|
309
|
+
|
|
310
|
+
None of these replaces the others, and mathema complements your test suite
|
|
311
|
+
rather than replacing it: the lines your tests already reach count toward the
|
|
312
|
+
implementation score. mathema's probe route is the same idea as
|
|
313
|
+
Hypothesis, CrossHair's symbolic execution is the nearest thing in Python to
|
|
314
|
+
its derive route, and contract libraries such as icontract and deal check
|
|
315
|
+
pre- and postconditions as the code runs, which complements a claim rather
|
|
316
|
+
than competing with it. What mathema adds is the place where a property check,
|
|
317
|
+
a real proof attempt and a durable record meet on the same claim, with the
|
|
318
|
+
claim routed automatically to whichever method the function's shape can
|
|
319
|
+
support, and `skipped` reported plainly the moment none can.
|
|
320
|
+
|
|
321
|
+
## Measuring a codebase
|
|
322
|
+
|
|
323
|
+
A codebase can have every line exercised by tests while having very little of
|
|
324
|
+
its intent stated or verified, so mathema measures those separately rather
|
|
325
|
+
than folding them into one coverage number. `mathema badges` reports three
|
|
326
|
+
scores, each measured on its own so a strength in one can't hide a gap in
|
|
327
|
+
another:
|
|
328
|
+
|
|
329
|
+
- **implementation**, coverage that counts proofs: the share of statements
|
|
330
|
+
reached by a test, a probe or a derive proof, taken together, so code proven
|
|
331
|
+
symbolically counts even where no test calls it;
|
|
332
|
+
- **intent**, what the code is meant to do, stated: how much of what each
|
|
333
|
+
function is meant to do is explicitly specified and up to date, so intent
|
|
334
|
+
that lives only in someone's head, or in a prompt that was thrown away,
|
|
335
|
+
shows up as a gap;
|
|
336
|
+
- **clarity**, how much of the behaviour is pinned down: of everything
|
|
337
|
+
knowable about a function, how much its verified claims have settled, where
|
|
338
|
+
a proof counts for more than a sample and a failure found is still
|
|
339
|
+
knowledge.
|
|
340
|
+
|
|
341
|
+
They are drawn as a triangle whose area is the overall score, so it falls
|
|
342
|
+
toward zero when any one of them is empty instead of averaging politely over
|
|
343
|
+
the gap. An illustrative example:
|
|
344
|
+
|
|
345
|
+
<!-- illustration -->
|
|
346
|
+
```text
|
|
347
|
+
CLARITY 50
|
|
348
|
+
◆
|
|
349
|
+
· ·
|
|
350
|
+
· ·
|
|
351
|
+
· ·
|
|
352
|
+
· ·
|
|
353
|
+
· ·
|
|
354
|
+
· ·
|
|
355
|
+
· ● ·
|
|
356
|
+
· ··· ·
|
|
357
|
+
· ······ ·
|
|
358
|
+
· ········ ·
|
|
359
|
+
· ··········· ·
|
|
360
|
+
· ············· ·
|
|
361
|
+
················· ·
|
|
362
|
+
●·············+···●·········◆
|
|
363
|
+
IMPL 100 INTENT 26
|
|
364
|
+
overall 32
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Every line is exercised and intent is a quarter specified, which the area
|
|
368
|
+
shows as 32 where the mean of the three would have said 59. The [badges reference](https://mathema.tetrionlabs.com/modes/badges/)
|
|
369
|
+
covers how each score is computed and what to expect of them.
|
|
370
|
+
|
|
371
|
+
## API
|
|
372
|
+
|
|
373
|
+
```python
|
|
374
|
+
import mathema
|
|
375
|
+
|
|
376
|
+
def ema(x: list, alpha: float) -> float:
|
|
377
|
+
"""Exponentially weighted moving average."""
|
|
378
|
+
y = x[0]
|
|
379
|
+
for v in x[1:]:
|
|
380
|
+
y = alpha * v + (1 - alpha) * y
|
|
381
|
+
return y
|
|
382
|
+
|
|
383
|
+
bounds = {"x": (-1e6, 1e6), "alpha": (-10, 10)}
|
|
384
|
+
mathema.check(ema, domain=bounds) # built-in laws, inside a stated domain
|
|
385
|
+
mathema.check(ema, claims=["f(x, 1.0) == x[-1]"]) # your own claim
|
|
386
|
+
mathema.check(ema, domain={"alpha": (0, 1)}) # narrow the domain
|
|
387
|
+
mathema.write_spec(ema, claims=[...]) # check, then write the record
|
|
388
|
+
mathema.status() # fresh or stale, per tracked function
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Without anyone reading the code, the first call proves that the result is
|
|
392
|
+
deterministic and that scaling or shifting every element of `x` scales or
|
|
393
|
+
shifts the result the same way, with the `[float]` companions of those proofs
|
|
394
|
+
holding across the stated domain, and it finds that reordering `x` does *not*
|
|
395
|
+
leave the result unchanged, with the counterexample kept. Leave the domain out
|
|
396
|
+
and every claim ranges over all of the reals, where the companions report the
|
|
397
|
+
overflow at `1e+308` instead. The
|
|
398
|
+
[API reference](https://mathema.tetrionlabs.com/api/) has the rest.
|
|
399
|
+
|
|
400
|
+
## CI
|
|
401
|
+
|
|
402
|
+
A gate, not a dashboard:
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
mathema verify # the gate: re-checks what changed, fails on what broke
|
|
406
|
+
mathema review origin/main # what a pull request changed, as claims and verdicts
|
|
407
|
+
mathema check model.py --format junit --output claims.xml # reports for the CI UI
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
A failing claim exits 1 and a broken invocation exits 2, so a pipeline can
|
|
411
|
+
tell a real finding from a broken run. `mathema init --ci` scaffolds the
|
|
412
|
+
GitHub Actions or GitLab step, `--format github`, `junit` and `json` feed each
|
|
413
|
+
platform's own reports, and fuller pipelines are in
|
|
414
|
+
[examples/ci/](https://github.com/tetrionlabs/mathema/tree/main/examples/ci).
|
|
415
|
+
|
|
416
|
+
## Intent
|
|
417
|
+
|
|
418
|
+
mathema exists to make the behaviour of a function something that can be
|
|
419
|
+
checked rather than assumed, namely a claim about what the function does,
|
|
420
|
+
stated precisely enough that the code can be held to it, with the result
|
|
421
|
+
recorded as proof, as evidence, or as an open question, whichever is true,
|
|
422
|
+
and kept honest as the code changes underneath it.
|
|
423
|
+
|
|
424
|
+
## Install
|
|
425
|
+
|
|
426
|
+
mathema needs Python 3.10 or newer. Install it inside an active virtual
|
|
427
|
+
environment (`python3 -m venv .venv && source .venv/bin/activate`, or your
|
|
428
|
+
usual equivalent) rather than against a system Python:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
pip install mathema # core: the derive route and the spec store
|
|
432
|
+
pip install "mathema[all]" # numpy, z3, MCP server, coverage
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
The extras can also be taken one at a time: `mcp` exposes mathema's tools to
|
|
436
|
+
an agent, `smt` adds z3 as a fallback decision procedure, `numpy` enables
|
|
437
|
+
array-shaped claims, `coverage` reads a native `.coverage` report and
|
|
438
|
+
`symbology` adds conventional notation.
|
|
439
|
+
|
|
440
|
+
## Documentation
|
|
441
|
+
|
|
442
|
+
- [The bottleneck moved](https://tetrionlabs.com/why/): why verification, not
|
|
443
|
+
generation, is now the hard part of shipping AI-assisted code.
|
|
444
|
+
- **[Quick start](https://mathema.tetrionlabs.com/quickstart/)**: five minutes,
|
|
445
|
+
one function, and a claim that goes from falsified to proven.
|
|
446
|
+
- [Claim-driven development](https://mathema.tetrionlabs.com/cdd/): the
|
|
447
|
+
vocabulary every mode assumes, including what separates `proven` from `holds`.
|
|
448
|
+
- [The claim grammar](https://mathema.tetrionlabs.com/grammar/): everything you
|
|
449
|
+
can say in a claim, with a runnable example of each.
|
|
450
|
+
- [The derive route](https://mathema.tetrionlabs.com/derive-route/): which
|
|
451
|
+
function shapes can reach `proven`, and what happens to the ones that cannot.
|
|
452
|
+
- [Case studies](https://mathema.tetrionlabs.com/case-studies/): put-call
|
|
453
|
+
parity, the Greeks, and the sigmoid worked end to end.
|
|
454
|
+
|
|
455
|
+
The full documentation, including the command reference, is at
|
|
456
|
+
**[mathema.tetrionlabs.com](https://mathema.tetrionlabs.com)**.
|
|
457
|
+
|
|
458
|
+
mathema is at 0.6.0 and pre-1.0, feature-complete for its current scope and
|
|
459
|
+
covered by over 3,500 tests; the claim grammar and record format are settled by
|
|
460
|
+
the spec, but the Python API is likely to change before 1.0.
|
|
461
|
+
|
|
462
|
+
## Related projects
|
|
463
|
+
|
|
464
|
+
[claim-driven-development](https://github.com/aaronbyrnephd/claim-driven-development)
|
|
465
|
+
is the specification mathema implements (v0.2: the claim tuple, the claim
|
|
466
|
+
families and the YAML record schema), maintained independently under
|
|
467
|
+
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), so anything
|
|
468
|
+
that reads or writes that shape interoperates with mathema's records without
|
|
469
|
+
importing it. `mathema.SPEC_VERSION` states the targeted version and every
|
|
470
|
+
record stamps it. [mathema-symbology](https://github.com/tetrionlabs/mathema-symbology)
|
|
471
|
+
renders claims in a field's conventional notation, and
|
|
472
|
+
[mathema-agents](https://github.com/tetrionlabs/mathema-agents) teaches coding
|
|
473
|
+
agents to drive the claim loop properly, vendored by an explicit, opt-in
|
|
474
|
+
`mathema init --agents`.
|
|
475
|
+
|
|
476
|
+
See also [CHANGELOG.md](https://github.com/tetrionlabs/mathema/blob/main/CHANGELOG.md), [CONTRIBUTING.md](https://github.com/tetrionlabs/mathema/blob/main/CONTRIBUTING.md),
|
|
477
|
+
[SECURITY.md](https://github.com/tetrionlabs/mathema/blob/main/SECURITY.md) and [SUPPORT.md](https://github.com/tetrionlabs/mathema/blob/main/SUPPORT.md).
|
|
478
|
+
|
|
479
|
+
## Licensing
|
|
480
|
+
|
|
481
|
+
mathema is source-available under the [Business Source License
|
|
482
|
+
1.1](https://github.com/tetrionlabs/mathema/blob/main/LICENSE.md). Production use is free when any one of these applies:
|
|
483
|
+
your organisation's revenue is under USD 10 million, mathema is used in no
|
|
484
|
+
more than three of its repositories, the use is research, teaching, personal
|
|
485
|
+
or otherwise non-commercial, or it is within a 90-day evaluation. Every
|
|
486
|
+
released version converts to AGPL-3.0-or-later four years after its release.
|
|
487
|
+
See [LICENSING.md](https://github.com/tetrionlabs/mathema/blob/main/LICENSING.md) for the plain-language version.
|