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

refactor: implement Display for Term, add environment methods, and enhance solution handlers #5

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

pluveto
Copy link
Owner

@pluveto pluveto commented Nov 22, 2024

Summary

This pull request introduces several enhancements and refactors across the project, focusing on improving code readability, functionality, and output handling.

Changes

Cargo.toml

  • Updated the workspace resolver to version "2" for improved dependency resolution.

AST Module (rulog_core/src/types/ast.rs)

  • Implemented the Display trait for the Term enum to enable formatted string representations of terms.
  • This enhancement allows for more readable output when terms are printed.

Environment Module (rulog_vm/src/environment.rs)

  • Added is_empty method to check if the environment has no bindings.
  • Introduced an iter method to iterate over environment bindings, facilitating better access and manipulation.

Interpreter Module (rulog_vm/src/interpreter.rs)

  • Replaced PrintSolutionHandler with ConsoleSolutionHandler for better naming consistency.
  • Added WriteSolutionHandler, allowing solutions to be written to any Write implementor.
  • The WriteSolutionHandler can now format and print solutions or indicate when no solution is found.

@pluveto pluveto merged commit 477ad88 into master Nov 22, 2024
1 check passed
@pluveto pluveto deleted the refactor/solution branch November 22, 2024 02:33
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.

1 participant