7 research outputs found
Verifying Programs via Intermediate Interpretation
We explore an approach to verification of programs via program transformation applied to an interpreter of a programming language. A specialization technique known as Turchin's supercompilation is used to specialize some interpreters with respect to the program models. We show that several safety properties of functional programs modeling a class of cache coherence protocols can be proved by a supercompiler and compare the results with our earlier work on direct verification via supercompilation not using intermediate interpretation. Our approach was in part inspired by an earlier work by De E. Angelis et al. (2014-2015) where verification via program transformation and intermediate interpretation was studied in the context of specialization of constraint logic programs
ΠΡΠΎΡΡΠΎΠΉ Π°Π»Π³ΠΎΡΠΈΡΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΡ Π·Π°Π΄Π°ΡΠΈ ΠΏΠΎΠΊΡΡΡΠΈΡ Π΄Π»Ρ ΠΌΠΎΠ½ΠΎΡΠΎΠ½Π½ΡΡ ΡΡΠ΅ΡΡΠΈΠΊΠΎΠ²ΡΡ ΡΠΈΡΡΠ΅ΠΌ
An algorithm for solving the coverability problem for monotonic counter systems is presented. The solvability of this problem is well-known, but the algorithm is interesting due to its simplicity. The algorithm has emerged as a simplification of a certain procedure of a supercompiler application (a program specializer based on V.F. Turchin's supercompilation) to a program encoding a monotonic counter system along with initial and target sets of states and from the proof that under some conditions the procedure terminates and solves the coverability problem.ΠΡΠ΅Π΄Π»ΠΎΠΆΠ΅Π½ Π°Π»Π³ΠΎΡΠΈΡΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΡ Π·Π°Π΄Π°ΡΠΈ ΠΏΠΎΠΊΡΡΡΠΈΡ Π΄Π»Ρ ΠΌΠΎΠ½ΠΎΡΠΎΠ½Π½ΡΡ
ΡΡΠ΅ΡΡΠΈΠΊΠΎΠ²ΡΡ
ΡΠΈΡΡΠ΅ΠΌ. Π Π°Π·ΡΠ΅ΡΠΈΠΌΠΎΡΡΡ ΡΡΠΎΠΉ Π·Π°Π΄Π°ΡΠΈ Ρ
ΠΎΡΠΎΡΠΎ ΠΈΠ·Π²Π΅ΡΡΠ½Π°, Π½ΠΎ Π΄Π°Π½Π½ΡΠΉ Π°Π»Π³ΠΎΡΠΈΡΠΌ ΠΈΠ½ΡΠ΅ΡΠ΅ΡΠ΅Π½ ΡΠ²ΠΎΠ΅ΠΉ ΠΏΡΠΎΡΡΠΎΡΠΎΠΉ. ΠΠ½ Π²ΠΎΠ·Π½ΠΈΠΊ ΠΈΠ· ΡΠΏΡΠΎΡΠ΅Π½ΠΈΡ Π½Π΅ΠΊΠΎΡΠΎΡΠΎΠΉ ΠΈΡΠ΅ΡΠ°ΡΠΈΠ²Π½ΠΎΠΉ ΠΏΡΠΎΡΠ΅Π΄ΡΡΡ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΡ ΡΡΠΏΠ΅ΡΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΎΡΠ° (ΡΠΏΠ΅ΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΎΡΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ, ΠΎΡΠ½ΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ Π½Π° ΠΌΠ΅ΡΠΎΠ΄Π΅ ΡΡΠΏΠ΅ΡΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΠΈ Π.Π€. Π’ΡΡΡΠΈΠ½Π°) ΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅, ΠΊΠΎΠ΄ΠΈΡΡΡΡΠ΅ΠΉ ΡΡΠ΅ΡΡΠΈΠΊΠΎΠ²ΡΡ ΡΠΈΡΡΠ΅ΠΌΡ ΠΈ Π½Π°ΡΠ°Π»ΡΠ½ΠΎΠ΅ ΠΈ ΡΠ΅Π»Π΅Π²ΠΎΠ΅ ΠΌΠ½ΠΎΠΆΠ΅ΡΡΠ²Π° ΡΠΎΡΡΠΎΡΠ½ΠΈΠΉ, ΠΈ ΠΈΠ· Π΄ΠΎΠΊΠ°Π·Π°ΡΠ΅Π»ΡΡΡΠ²Π°, ΡΡΠΎ ΠΏΡΠΈ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π½ΡΡ
ΡΡΠ»ΠΎΠ²ΠΈΡΡ
ΡΡΠ° ΠΏΡΠΎΡΠ΅Π΄ΡΡΠ° Π·Π°Π²Π΅ΡΡΠ°Π΅ΡΡΡ ΠΈ ΡΠ΅ΡΠ°Π΅Ρ Π·Π°Π΄Π°ΡΡ ΠΏΠΎΠΊΡΡΡΠΈΡ
Recommended from our members
Collapsing towers of interpreters
Given a tower of interpreters, i.e., a sequence of multiple interpreters interpreting one another as input programs, we aim to collapse this tower into a compiler that removes all interpretive overhead and runs in a single pass. In the real world, a use case might be Python code executed by an x86 runtime, on a CPU emulated in a JavaScript VM, running on an ARM CPU. Collapsing such a tower can not only exponentially improve runtime performance, but also enable the use of base-language tools for interpreted programs, e.g., for analysis and verification. In this paper, we lay the foundations in an idealized but realistic setting.
We present a multi-level lambda calculus that features staging constructs and stage polymorphism: based on runtime parameters, an evaluator either executes source code (thereby acting as an interpreter) or generates code (thereby acting as a compiler). We identify stage polymorphism, a programming model from the domain of high-performance program generators, as the key mechanism to make such interpreters compose in a collapsible way.
We present Pink, a meta-circular Lisp-like evaluator on top of this calculus, and demonstrate that we can collapse arbitrarily many levels of self-interpretation, including levels with semantic modifications. We discuss several examples: compiling regular expressions through an interpreter to base code, building program transformers from modi ed interpreters, and others. We develop these ideas further to include reflection and reification, culminating in Purple, a reflective language inspired by Brown, Blond, and Black, which realizes a conceptually infinite tower, where every aspect of the semantics can change dynamically. Addressing an open challenge, we show how user programs can be compiled and recompiled under user-modified semantics.Parts of this research were supported by ERC grant 321217, NSF awards 1553471 and 1564207, and DOE award DE-SC0018050
Recommended from our members
A SQL to C compiler in 500 lines of code
AbstractWe present the design and implementation of a SQL query processor that outperforms existing database systems and is written in just about 500 lines of Scala code β a convincing case study that high-level functional programming can handily beat C for systems-level programming where the last drop of performance matters. The key enabler is a shift in perspective toward generative programming. The core of the query engine is an interpreter for relational-algebra operations, written in Scala. Using the open-source lightweight modular staging framework, we turn this interpreter into a query compiler with very low effort. To do so, we capitalize on an old and widely known result from partial evaluation: the first Futamura projection, which states that a process that can specialize an interpreter to any given input program is equivalent to a compiler. In this context, we discuss lightweight modular staging programming patterns such as mixed-stage data structures (e.g., data records with static schema and dynamic field components) and techniques to generate low-level C code, including specialized data structures and data loading primitives.</jats:p