Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/tests for Minimal MeTTa functions #164

Merged
merged 2 commits into from
Oct 19, 2024
Merged

Conversation

AdrickTench
Copy link
Collaborator

I've updated docstrings for several Minimal MeTTa functions to offer more insight on their behavior at least as documented in https://github.com/trueagi-io/hyperon-experimental/blob/main/docs/minimal-metta.md and as explained by Vitaly on the Mattermost.

minimal_metta_tests.metta I intend to include basic, if you will minimal test cases that both provide behavioral coverage and augment the documentation. (I have not completed it for all of Minimal MeTTa yet, but the current tests are a good start.) They are based on my understanding of the Minimal MeTTa specification above and the Hyperon implementation's behavior. The Hyperon implementation currently passes all of these tests save for some of the collapse-bind tests, which appears to be an issue with equality checking for assertEqualToResult rather than an issue with the test: the results returned match the test specification exactly. For example, in the Metta playground this fails but should succeed:

(= (bar A) (input A))
(= (bar B) (input B))
(= (foo $x) (bar $x))

!(assertEqualToResult (chain (collapse-bind (foo $x)) $a (quote $a)) ((quote (((foo $x) {  })))))

[(Error (assertEqualToResult (chain (collapse-bind (foo $x)) $a (quote $a)) ((quote (((foo $x) { }))))) 
Expected: [(quote (((foo $x) { })))]
Got: [(quote (((foo $x) {  })))]
Missed result: (quote (((foo $x) { }))))]

Still, all in all the Hyperon implementation is currently doing quite well on test body I've created. Mettalog is not doing so well, only passing 10/36 of these new tests atm.

@AdrickTench
Copy link
Collaborator Author

See also #165

@TeamSPoon TeamSPoon merged commit 7b9396b into trueagi-io:main Oct 19, 2024
1 check passed
TeamSPoon added a commit that referenced this pull request Dec 4, 2024
docs/tests for Minimal MeTTa functions
TeamSPoon added a commit that referenced this pull request Dec 4, 2024
docs/tests for Minimal MeTTa functions
TeamSPoon added a commit that referenced this pull request Dec 4, 2024
docs/tests for Minimal MeTTa functions
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.

2 participants