Skip to content

Conversation

@eyobderese
Copy link
Collaborator

This pull request introduces several improvements and refactorings across the empirical probability, surprisingness, and truth value estimation code. The changes focus on standardizing utility function names (e.g., replacing min/max with min-of-two/max-of-two), improving code clarity, updating type signatures, and enhancing test coverage. Additionally, the pull request updates test files to use local utility imports and adds a comprehensive new test suite for the surprisingness module.

Utility function standardization and usage updates:

  • Replaced all occurrences of min/max with min-of-two/max-of-two (and corresponding min-atom/max-atom in some places) throughout the codebase for consistency, including in emp-tv.metta, isurp-old.metta, isurp.metta, TruthValue.metta, and beta-dist.metta. [1] [2] [3] [4] [5]

Empirical probability and surprisingness logic improvements:

  • Refactored empirical probability and bootstrapping logic in emp-prob.metta:

    • Updated function signatures and types for clarity.
    • Improved conditional logic in emp_prob_subsmp and emp_prob_bs.
    • Added debug print statements in emp-prob-pbs for better traceability. [1] [2] [3] [4] [5] [6]
  • Changed partitioning logic in surprisingness and truth value estimation:

    • Replaced calls to generet-partition-without-pattern with the more general partitions function in isurp.metta and est-tv.metta. [1] [2]

Type signature and documentation clean-up:

  • Removed or commented out unused and redundant type signatures and documentation blocks in emp-prob.metta, isurp.metta, and emp-tv.metta to streamline code and improve readability. [1] [2] [3] [4] [5]

Test infrastructure improvements:

  • Added a comprehensive test file petta-test.metta for the surprisingness module, including extensive commented-out test cases and utility imports for future expansion.
  • Updated test-blk-abstractness.metta to use local utility imports instead of commented-out global imports, improving modularity and maintainability.

These changes collectively improve code consistency, maintainability, and testability across the surprisingness and truth value modules.

@eyobderese eyobderese requested a review from tezena November 28, 2025 06:31
@eyobderese eyobderese marked this pull request as draft November 28, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants