Unifying AI Algorithms with Probabilistic Programming using Implicitly Defined Representations