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

Pass the knowlegde base space as an argument #5

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

tanksha
Copy link
Contributor

@tanksha tanksha commented Aug 27, 2024

I modified the chainer to take kb as an argument, for consistency

Faced some issues with asserting results containing variables, I using match for now. Here is a minimal example:


!(bind! &kb (new-space))
!(add-atom &kb (: test (implies $p $q)))
!(assertEqualToResult (get-atoms &kb) ((: test (implies $p $q))))

Results with assertion error, because the variables $p and $q in first and second expression are not the same?

My work around:


!(bind! &kb (new-space))
!(add-atom &kb (: test (implies $p $q)))
!(assertEqualToResult (match &kb (: test (implies $p $q)) asserted) (asserted))

@ngeiswei ngeiswei merged commit c12fab6 into trueagi-io:main Aug 28, 2024
@ngeiswei
Copy link
Collaborator

ngeiswei commented Aug 28, 2024

Thanks @tanksha, something else I've been changing is to have the query as last argument, that way the other arguments can be seen as parameters of what really matters, which is to fulfill the query.

Regarding the problem with assert I've created a issue about that while ago trueagi-io/hyperon-experimental#744

@tanksha
Copy link
Contributor Author

tanksha commented Aug 28, 2024

Sure. I will make the query the last argument. BTW, I can work on converting this into a module, do you have any preferences on the module structure?

@ngeiswei
Copy link
Collaborator

I can't think of anything special.

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