From 28018c0d43beae1cf109cb03ccade3bb62caed59 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 3 Aug 2017 11:28:15 -0600 Subject: [PATCH] add tests, remove extraneous instructions. --- src/main.rs | 1 + src/prolog/machine.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a4df500c..e11b6fb7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -655,6 +655,7 @@ mod tests { assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p)), X, Y)."), true); assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p(X))), Y)."), true); assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p(X))), X, Y)."), false); + assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p(X))), X)."), true); submit(&mut wam, "f(call(f, undefined)). f(undefined)."); submit(&mut wam, "call_var(P) :- P."); diff --git a/src/prolog/machine.rs b/src/prolog/machine.rs index f0ea0c5b..2f42b631 100644 --- a/src/prolog/machine.rs +++ b/src/prolog/machine.rs @@ -97,8 +97,7 @@ impl Index for Machine { impl Machine { pub fn new() -> Self { let mut code_dir = HashMap::new(); - let code = vec![Line::BuiltIn(BuiltInInstruction::InternalCallN), - Line::Control(ControlInstruction::Proceed)]; + let code = vec![Line::BuiltIn(BuiltInInstruction::InternalCallN)]; // there are 64 registers in the VM, so call/N is defined for all 0 <= N <= 63 // (an extra register is needed for the predicate name) -- 2.54.0