Context term calculus for rewriting systems

R.S. Shevchenko


In this paper, a calculus of context-full terms is proposed. Calculus extends the traditional algebraic signatures, used in term rewriting systems, by so-called constructions, that works with context: context constructor, resolving a context value and binding term to context with compatibility checking. Such extension allows to refining algorithms connected with analysis and transformations of source code in the more natural form, because f the structure of the sense in the modern programming language defined in hierarchical contexts, which can be directly mapped to context-full term in rewriting rule. Type analysis for a programming language can be implemented as checking for context compatibility. In such way, relative simple mechanism, which unites term rewriting and context analysis can be received. The approach is illustrated by defining rules for typing in context-full term formalism.

Problems in programming 2018; 2-3: 021-030



software development automation; term rewriting; type systems; programming languages; code analysis; termware


Jan Willem Klop and Vincent van Oostrom and Femke van Raamsdonk. Combinatory Reduction Systems: introduction and survey. Theoretical Computer Science. Vol. 121. 1993. P. 279-308.

Doroshenko A., Shevchenko R. A rewriting framework for rule-based programming dynamic applications. Fundamenta Informaticae. 2006. Vol. 72. N 1-3. P. 95-108.

Dan Dougherty, Pierre Lescanne, Luigi Liquori, Frédéric Lang. Addressed Term Rewriting Systems: Syntax, Semantics, and Pragmatics. Electronic Notes in Theoretical Computer Science. Vol. 127, Issue 5, 27 May 2005. P. 57-82.

Cirstea, Horatiu and Kirchner, Claude and Liquori, Luigi. Rewriting Calculus with(out) Types. Proceedings of the fourth workshop on rewriting logic and applications. Electronic Notes in Theoretical Computer Science, Sep. 2002.

C. Barry Jay and Delia Kesner. Pure Pattern Calculus. ACM Trans. Program. Lang. Syst. 2005. P. 263-274.

Martin Bravenboer and Karl Trygve Kalleberg and Rob Vermaas and Eelco Visser. {Stratego/XT 0.17}. {A} language and toolset for program transformation. Science of Computer Programming. Vol. 72. 2008. P. 52-70.

Pfenning, F. and Elliott, C., Higher-order Abstract Syntax. Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation. PLDI-88. 1998. P. 199-208.

Bove, Ana; Peter Dybjer . Dependent Types at Work. LerNet ALFA Summer School. 2008: P. 57-99.

Rinus Plasmeijer and Marko van Eekelen, Keep it Clean: A unique approach to functional programming. ACM Sigplan Notices, June 1999.

Eric Reed. Patina: A Formalization of the Rust Programming Language. University of Washington. Technical Report. 2015.

Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, Andy McNeil, Deny Capabilities for Safe, Fast Actors. Causality Ltd., Imperial College London, 2015.

Nada Amin and Tiark Rompf. Collapsing Towers of Interpreters. Proc. ACM Program. Lang. 2, POPL, Article 33 (January 2018). 33 p.



  • There are currently no refbacks.