The backend of amb.
amb wraps all its parameters into thunks and passes a list of them into this procedure.