func BenchmarkMaplist(b *testing.B) {
	m := NewMachine().Consult(`
        always_a(_, a).
        maplist(C, A, B) :-
            maplist_(A, B, C).
        maplist_([], [], _).
        maplist_([B|D], [C|E], A) :-
            call(A, B, C),
            maplist_(D, E, A).
    `)
	g := read.Term_(`maplist(always_a, [1,2,3,4,5], As).`)
	for i := 0; i < b.N; i++ {
		_ = m.ProveAll(g)
	}
}
test performance of a standard maplist implementation
package golog
import "fmt"
import "strconv"
import "testing"
import "github.com/mndrix/golog/read"
import "github.com/mndrix/golog/term"
func BenchmarkTrue(b *testing.B) {
	m := NewMachine()
	g := read.Term_(`true.`)
	for i := 0; i < b.N; i++ {
		_ = m.ProveAll(g)
	}
}
func BenchmarkAppend(b *testing.B) {
	m := NewMachine().Consult(`
        append([], A, A).   % test same variable name as other clauses
        append([A|B], C, [A|D]) :-
            append(B, C, D).
    `)
	g := read.Term_(`append([a,b,c], [d,e], List).`)
	for i := 0; i < b.N; i++ {
		_ = m.ProveAll(g)
	}
}
func BenchmarkUnifyDeep(b *testing.B) {
	x := read.Term_(`a(b(c(d(e(f(g(h(i(j))))))))).`)
	y := read.Term_(`a(b(c(d(e(f(g(h(i(X))))))))).`)
	env := term.NewBindings()
	for i := 0; i < b.N; i++ {
		_, _ = x.Unify(env, y)
	}
}
func BenchmarkUnifyDeepFail(b *testing.B) {
	x := read.Term_(`a(b(c(d(e(f(g(h(i(j))))))))).`)
	y := read.Term_(`a(b(c(d(e(f(g(h(i(x))))))))).`)
	env := term.NewBindings()
	for i := 0; i < b.N; i++ {
		_, _ = x.Unify(env, y)
	}
}
func BenchmarkUnificationHash(b *testing.B) {
	x := read.Term_(`a(b(c(d(e(f(g(h(i(j))))))))).`)
	for i := 0; i < b.N; i++ {
		_ = term.UnificationHash([]term.Term{x}, 64, true)
	}
}