🤖 AI Summary
This paper addresses the lack of formal semantic foundations for the Variable Elimination (VE) algorithm in probabilistic graphical models. We propose a structured modeling approach based on linear simply typed lambda calculus, characterizing VE as a resource-sensitive syntactic rewriting process: global variables are equivalently transformed into local definitions via commuting and nesting rules for let-in expressions. To our knowledge, this is the first work to rigorously capture the essence of VE within a linear type system—revealing VE not as numerical computation, but as a type-constrained program transformation. The established correspondence between VE and linear lambda calculus provides a provably correct theoretical framework for semantic verification, automated optimization, and trustworthy compilation of probabilistic programs.
📝 Abstract
Variable Elimination (VE) is a classical exact inference algorithm for probabilistic graphical models such as Bayesian Networks, computing the marginal distribution of a subset of the random variables in the model. Our goal is to understand Variable Elimination as an algorithm acting on programs, here expressed in an idealized probabilistic functional language -- a linear simply-typed $lambda$-calculus suffices for our purpose. Precisely, we express VE as a term rewriting process, which transforms a global definition of a variable into a local definition, by swapping and nesting let-in expressions. We exploit in an essential way linear types.