refactor: implement Display for Term, add environment methods, and enhance solution handlers #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces several enhancements and refactors across the project, focusing on improving code readability, functionality, and output handling.
Changes
Cargo.toml
AST Module (
rulog_core/src/types/ast.rs
)Display
trait for theTerm
enum to enable formatted string representations of terms.Environment Module (
rulog_vm/src/environment.rs
)is_empty
method to check if the environment has no bindings.iter
method to iterate over environment bindings, facilitating better access and manipulation.Interpreter Module (
rulog_vm/src/interpreter.rs
)PrintSolutionHandler
withConsoleSolutionHandler
for better naming consistency.WriteSolutionHandler
, allowing solutions to be written to anyWrite
implementor.WriteSolutionHandler
can now format and print solutions or indicate when no solution is found.