Memory-Amortized Inference: A Topological Unification of Search, Closure, and Structure