Weighted programs generalize probabilistic programs and offer a framework for specifying and encoding mathematical models by means of an algorithmic representation. Kleene algebra with tests is an algebraic formalism based on regular expressions with applications in proving program equivalence. We extend the language of Kleene algebra with tests so that it is sufficient to formalize reasoning about a simplified version weighted programs. We introduce relational semantics for the extended language, and we generalize the relational semantics to an appropriate extension of Kleene algebra with tests, called Kleene algebra with weights and tests. We demonstrate by means of an example that Kleene algebra with weights and tests offers a simple algebraic framework for reasoning about equivalence and optimal runs of weighted programs.
翻译:加权程序一般化概率程序,并提供一个框架,以便通过算法代表来具体和编码数学模型。 Kleene代数与测试是基于常规表达式的代数形式,以证明程序等同性的应用为基础。我们通过测试来扩展Kleene代数语言,这样就足以使简化版加权程序推理正规化。我们为扩展语言引入了关系语义,并将关系语义与Kleene代数进行测试的适当延伸(称为Kleene代数与重量和测试)。我们通过一个例子来证明,带有重量和测试的Kleene 代数提供了一个简单的代数框架,用于对等性和加权程序的最佳运行进行推理。</s>