var(V) lists the valid variable indices; lookup(A, V, B) reads variable V’s value out of an assignment:
var(V)
lookup(A, V, B)
V