{"title":"Proving Cutoff Bounds for Safety Properties in First-Order Logic","authors":"Raz Lotan, Eden Frenkel, Sharon Shoham","doi":"arxiv-2408.10685","DOIUrl":"https://doi.org/arxiv-2408.10685","url":null,"abstract":"First-order logic has been established as an important tool for modeling and\u0000verifying intricate systems such as distributed protocols and concurrent\u0000systems. These systems are parametric in the number of nodes in the network or\u0000the number of threads, which is finite in any system instance, but unbounded.\u0000One disadvantage of first-order logic is that it cannot distinguish between\u0000finite and infinite structures, leading to spurious counterexamples. To\u0000mitigate this, we offer a verification approach that captures only finite\u0000system instances. Our approach is an adaptation of the cutoff method to systems\u0000modeled in first-order logic. The idea is to show that any safety violation in\u0000a system instance of size larger than some bound can be simulated by a safety\u0000violation in a system of a smaller size. The simulation provides an inductive\u0000argument for correctness in finite instances, reducing the problem to showing\u0000safety of instances with bounded size. To this end, we develop a framework to\u0000(i) encode such simulation relations in first-order logic and to (ii) validate\u0000the simulation relation by a set of verification conditions given to an SMT\u0000solver. We apply our approach to verify safety of a set of examples, some of\u0000which cannot be proven by a first-order inductive invariant.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223618","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"The Stable Model Semantics for Higher-Order Logic Programming","authors":"Bart Bogaerts, Angelos Charalambidis, Giannos Chatziagapis, Babis Kostopoulos, Samuele Pollaci, Panos Rondogiannis","doi":"arxiv-2408.10563","DOIUrl":"https://doi.org/arxiv-2408.10563","url":null,"abstract":"We propose a stable model semantics for higher-order logic programs. Our\u0000semantics is developed using Approximation Fixpoint Theory (AFT), a powerful\u0000formalism that has successfully been used to give meaning to diverse\u0000non-monotonic formalisms. The proposed semantics generalizes the classical\u0000two-valued stable model semantics of (Gelfond and Lifschitz 1988) as-well-as\u0000the three-valued one of (Przymusinski 1990), retaining their desirable\u0000properties. Due to the use of AFT, we also get for free alternative semantics\u0000for higher-order logic programs, namely supported model, Kripke-Kleene, and\u0000well-founded. Additionally, we define a broad class of stratified higher-order\u0000logic programs and demonstrate that they have a unique two-valued higher-order\u0000stable model which coincides with the well-founded semantics of such programs.\u0000We provide a number of examples in different application domains, which\u0000demonstrate that higher-order logic programming under the stable model\u0000semantics is a powerful and versatile formalism, which can potentially form the\u0000basis of novel ASP systems.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223619","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Extending the Quantitative Pattern-Matching Paradigm","authors":"Sandra Alves, Delia Kesner, Miguel Ramos","doi":"arxiv-2408.11007","DOIUrl":"https://doi.org/arxiv-2408.11007","url":null,"abstract":"We show how (well-established) type systems based on non-idempotent\u0000intersection types can be extended to characterize termination properties of\u0000functional programming languages with pattern matching features. To model such\u0000programming languages, we use a (weak and closed) $lambda$-calculus\u0000integrating a pattern matching mechanism on algebraic data types (ADTs).\u0000Remarkably, we also show that this language not only encodes Plotkin's CBV and\u0000CBN $lambda$-calculus as well as other subsuming frameworks, such as the\u0000bang-calculus, but can also be used to interpret the semantics of effectful\u0000languages with exceptions. After a thorough study of the untyped language, we\u0000introduce a type system based on intersection types, and we show through purely\u0000logical methods that the set of terminating terms of the language corresponds\u0000exactly to that of well-typed terms. Moreover, by considering non-idempotent\u0000intersection types, this characterization turns out to be quantitative, i.e.\u0000the size of the type derivation of a term t gives an upper bound for the number\u0000of evaluation steps from t to its normal form.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179573","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"ProgramAlly: Creating Custom Visual Access Programs via Multi-Modal End-User Programming","authors":"Jaylin Herskovitz, Andi Xu, Rahaf Alharbi, Anhong Guo","doi":"arxiv-2408.10499","DOIUrl":"https://doi.org/arxiv-2408.10499","url":null,"abstract":"Existing visual assistive technologies are built for simple and common use\u0000cases, and have few avenues for blind people to customize their\u0000functionalities. Drawing from prior work on DIY assistive technology, this\u0000paper investigates end-user programming as a means for users to create and\u0000customize visual access programs to meet their unique needs. We introduce\u0000ProgramAlly, a system for creating custom filters for visual information, e.g.,\u0000'find NUMBER on BUS', leveraging three end-user programming approaches: block\u0000programming, natural language, and programming by example. To implement\u0000ProgramAlly, we designed a representation of visual filtering tasks based on\u0000scenarios encountered by blind people, and integrated a set of on-device and\u0000cloud models for generating and running these programs. In user studies with 12\u0000blind adults, we found that participants preferred different programming\u0000modalities depending on the task, and envisioned using visual access programs\u0000to address unique accessibility challenges that are otherwise difficult with\u0000existing applications. Through ProgramAlly, we present an exploration of how\u0000blind end-users can create visual access programs to customize and control\u0000their experiences.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223620","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Daniel Jurjo-Rivas, Jose F. Morales, Pedro López-García, Manuel V. Hermenegildo
{"title":"Abstract Environment Trimming","authors":"Daniel Jurjo-Rivas, Jose F. Morales, Pedro López-García, Manuel V. Hermenegildo","doi":"arxiv-2408.09848","DOIUrl":"https://doi.org/arxiv-2408.09848","url":null,"abstract":"Variable sharing is a fundamental property in the static analysis of logic\u0000programs, since it is instrumental for ensuring correctness and increasing\u0000precision while inferring many useful program properties. Such properties\u0000include modes, determinacy, non-failure, cost, etc. This has motivated\u0000significant work on developing abstract domains to improve the precision and\u0000performance of sharing analyses. Much of this work has centered around the\u0000family of set-sharing domains, because of the high precision they offer.\u0000However, this comes at a price: their scalability to a wide set of realistic\u0000programs remains challenging and this hinders their wider adoption. In this\u0000work, rather than defining new sharing abstract domains, we focus instead on\u0000developing techniques which can be incorporated in the analyzers to address\u0000aspects that are known to affect the efficiency of these domains, such as the\u0000number of variables, without affecting precision. These techniques are inspired\u0000in others used in the context of compiler optimizations, such as expression\u0000reassociation and variable trimming. We present several such techniques and\u0000provide an extensive experimental evaluation of over 1100 program modules taken\u0000from both production code and classical benchmarks. This includes the\u0000Spectector cache analyzer, the s(CASP) system, the libraries of the Ciao\u0000system, the LPdoc documenter, the PLAI analyzer itself, etc. The experimental\u0000results are quite encouraging: we have obtained significant speed-ups, and,\u0000more importantly, the number of modules that require a timeout was cut in half.\u0000As a result, many more programs can be analyzed precisely in reasonable times.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179575","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Modernizing SMT-Based Type Error Localization","authors":"Max Kopinsky, Brigitte Pientka, Xujie Si","doi":"arxiv-2408.09034","DOIUrl":"https://doi.org/arxiv-2408.09034","url":null,"abstract":"Traditional implementations of strongly-typed functional programming\u0000languages often miss the root cause of type errors. As a consequence, type\u0000error messages are often misleading and confusing - particularly for students\u0000learning such a language. We describe Tyro, a type error localization tool\u0000which determines the optimal source of an error for ill-typed programs\u0000following fundamental ideas by Pavlinovic et al. : we first translate typing\u0000constraints into SMT (Satisfiability Modulo Theories) using an intermediate\u0000representation which is more readable than the actual SMT encoding; during this\u0000phase we apply a new encoding for polymorphic types. Second, we translate our\u0000intermediate representation into an actual SMT encoding and take advantage of\u0000recent advancements in off-the-shelf SMT solvers to effectively find optimal\u0000error sources for ill-typed programs. Our design maintains the separation of\u0000heuristic and search also present in prior and similar work. In addition, our\u0000architecture design increases modularity, re-usability, and trust in the\u0000overall architecture using an intermediate representation to facilitate the\u0000safe generation of the SMT encoding. We believe this design principle will\u0000apply to many other tools that leverage SMT solvers. Our experimental evaluation reinforces that the SMT approach finds accurate\u0000error sources using both expert-labeled programs and an automated method for\u0000larger-scale analysis. Compared to prior work, Tyro lays the basis for\u0000large-scale evaluation of error localization techniques, which can be\u0000integrated into programming environments and enable us to understand the impact\u0000of precise error messages for students in practice.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179576","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Sebastian Wolff, Ekanshdeep Gupta, Zafer Esen, Hossein Hojjat, Philipp Rümmer, Thomas Wies
{"title":"Arithmetizing Shape Analysis","authors":"Sebastian Wolff, Ekanshdeep Gupta, Zafer Esen, Hossein Hojjat, Philipp Rümmer, Thomas Wies","doi":"arxiv-2408.09037","DOIUrl":"https://doi.org/arxiv-2408.09037","url":null,"abstract":"Memory safety is an essential correctness property of software systems. For\u0000programs operating on linked heap-allocated data structures, the problem of\u0000proving memory safety boils down to analyzing the possible shapes of data\u0000structures, leading to the field of shape analysis. This paper presents a novel\u0000reduction-based approach to memory safety analysis that relies on two forms of\u0000abstraction: flow abstraction, representing global properties of the heap graph\u0000through local flow equations; and view abstraction, which enable verification\u0000tools to reason symbolically about an unbounded number of heap objects. In\u0000combination, the two abstractions make it possible to reduce memory-safety\u0000proofs to proofs about heap-less imperative programs that can be discharged\u0000using off-the-shelf software verification tools without built-in support for\u0000heap reasoning. Using an empirical evaluation on a broad range of programs, the\u0000paper shows that the reduction approach can effectively verify memory safety\u0000for sequential and concurrent programs operating on different kinds of linked\u0000data structures, including singly-linked, doubly-linked, and nested lists as\u0000well as trees.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223621","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"On the Expressivity of Typed Concurrent Calculi","authors":"Joseph William Neal Paulus","doi":"arxiv-2408.07915","DOIUrl":"https://doi.org/arxiv-2408.07915","url":null,"abstract":"This thesis embarks on a comprehensive exploration of formal computational\u0000models that underlie typed programming languages. We focus on programming\u0000calculi, both functional (sequential) and concurrent, as they provide a\u0000compelling rigorous framework for evaluating program semantics and for\u0000developing analyses and program verification techniques. This is the full\u0000version of the thesis containing appendices.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179577","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"The Semantics of Metapropramming in Prolog","authors":"David S. Warren","doi":"arxiv-2408.07652","DOIUrl":"https://doi.org/arxiv-2408.07652","url":null,"abstract":"This paper describes a semantics for pure Prolog programs with negation that\u0000provides meaning to metaprograms. Metaprograms are programs that construct and\u0000use data structures as programs. In Prolog a primary mataprogramming construct\u0000is the use of a variable as a literal in the body of a clause. The traditional\u0000Prolog 3-line metainterpreter is another example of a metaprogram. The account\u0000given here also supplies a meaning for clauses that have a variable as head,\u0000even though most Prolog systems do not support such clauses. This semantics\u0000naturally includes such programs, giving them their intuitive meaning. Ideas from M. Denecker and his colleagues form the basis of this approach.\u0000The key idea is to notice that if we give meanings to all propositional\u0000programs and treat Prolog rules with variables as the set of their ground\u0000instances, then we can give meanings to all programs. We must treat Prolog\u0000rules (which may be metarules) as templates for generating ground propositional\u0000rules, and not as first-order formulas, which they may not be. We use\u0000parameterized inductive definitions to give propositional models to Prolog\u0000programs, in which the propositions are expressions. Then the set of\u0000expressions of a propositional model determine a first-order Herbrand Model,\u0000providing a first-order logical semantics for all (pure) Prolog programs,\u0000including metaprograms. We give examples to show the applicability of this theory. We also\u0000demonstrate how this theory makes proofs of some important properties of\u0000metaprograms very straightforward.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179579","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Composing Automatic Differentiation with Custom Derivatives of Higher-Order Functions","authors":"Sam Estep","doi":"arxiv-2408.07683","DOIUrl":"https://doi.org/arxiv-2408.07683","url":null,"abstract":"Recent theoretical work on automatic differentiation (autodiff) has focused\u0000on characteristics such as correctness and efficiency while assuming that all\u0000derivatives are automatically generated by autodiff using program\u0000transformation, with the exception of a fixed set of derivatives for primitive\u0000operations. However, in practice this assumption is insufficient: the\u0000programmer often needs to provide custom derivatives for composite functions to\u0000achieve efficiency and numerical stability. In this work, we start from the\u0000untyped lambda calculus with a reverse-mode autodiff operator, extend it with\u0000an operator to attach manual derivatives, and demonstrate its utility via\u0000several examples.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179578","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}