add tests, remove extraneous instructions.

This commit is contained in:
Mark Thom
2017-08-03 11:28:15 -06:00
parent 0050c1d4cb
commit 28018c0d43
2 changed files with 2 additions and 2 deletions

View File

@@ -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.");

View File

@@ -97,8 +97,7 @@ impl Index<CodePtr> 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)