Affiliation:
1. RWTH Aachen University, Germany
2. Saarland University, Germany / University College London, UK
Abstract
We study weighted programming, a programming paradigm for specifying mathematical models. More specifically, the weighted programs we investigate are like usual imperative programs with two additional features: (1) nondeterministic branching and (2) weighting execution traces. Weights can be numbers but also other objects like words from an alphabet, polynomials, formal power series, or cardinal numbers. We argue that weighted programming as a paradigm can be used to specify mathematical models beyond probability distributions (as is done in probabilistic programming). We develop weakest-precondition- and weakest-liberal-precondition-style calculi à la Dijkstra for reasoning about mathematical models specified by weighted programs. We present several case studies. For instance, we use weighted programming to model the ski rental problem — an optimization problem. We model not only the optimization problem itself, but also the best deterministic online algorithm for solving this problem as weighted programs. By means of weakest-precondition-style reasoning, we can determine the competitive ratio of the online algorithm on source code level.
Funder
European Research Council
German Research Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference63 articles.
1. Samson Abramsky . 1994. Handbook of Logic in Computer Science. 3 , Clarendon Press . http://www.cs.bham.ac.uk/~axj/papers.html Samson Abramsky. 1994. Handbook of Logic in Computer Science. 3, Clarendon Press. http://www.cs.bham.ac.uk/~axj/papers.html
2. Weakest Preconditions in Fibrations
3. Reasoning about Online Algorithms with Weighted Automata
4. Reasoning about online algorithms with weighted automata
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Programmatic Strategy Synthesis: Resolving Nondeterminism in Probabilistic Programs;Proceedings of the ACM on Programming Languages;2024-01-05
2. Kleene Algebra of Weighted Programs with Domain;Lecture Notes in Computer Science;2024
3. A Deductive Verification Infrastructure for Probabilistic Programs;Proceedings of the ACM on Programming Languages;2023-10-16
4. Weighted Refinement Types for Counterpoint Composition;Proceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design;2023-08-30
5. Kleene Algebra With Tests for Weighted Programs;2023 IEEE 53rd International Symposium on Multiple-Valued Logic (ISMVL);2023-05