Skip to content

Commit

Permalink
chore: simplify QuerySolver initialization and comment out function i…
Browse files Browse the repository at this point in the history
…n resolver.rs.
  • Loading branch information
pluveto committed Nov 21, 2024
1 parent dbf99e1 commit 92602bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rulog_vm/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Interpreter {
) -> Result<(), InterpretingError> {
log::trace!("handle query: {:?}", query);
let handler = handler.unwrap_or(&PrintSolutionHandler);
let mut query_solver = QuerySolver::new(self.clauses.clone(), query);
let query_solver = QuerySolver::new(self.clauses.clone(), query);

let mut has_solution = false;
for solution in query_solver {
Expand Down
16 changes: 8 additions & 8 deletions rulog_vm/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ fn apply_env_terms(terms: &[Term], env: &Environment) -> Vec<Term> {
terms.iter().map(|t| apply_env(t, env)).collect()
}

fn unify(term1: &Term, term2: &Term) -> Option<Environment> {
let mut env = Environment::default();
if unify_helper(term1, term2, &mut env) {
Some(env)
} else {
None
}
}
// fn unify(term1: &Term, term2: &Term) -> Option<Environment> {
// let mut env = Environment::default();
// if unify_helper(term1, term2, &mut env) {
// Some(env)
// } else {
// None
// }
// }

fn unify_terms(terms1: &[Term], terms2: &[Term]) -> Option<Environment> {
let mut env = Environment::default();
Expand Down

0 comments on commit 92602bd

Please sign in to comment.