skip to main content
10.1145/3479394.3479404acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Static analysis of pattern-free properties

Published: 07 October 2021 Publication History

Abstract

Rewriting is a widely established formalism with major applications in computer science. It is indeed a staple of many formal verification applications as it is especially well suited to describe program semantics and transformations. In particular, constructor based term rewriting systems are generally used to illustrate the behaviour of functional programs.
In the context of formal verification, it is often necessary to characterize the shape of the reducts of such rewrite systems and, in a typed context, the underlying type system provides syntactic guarantees on the form of these terms by exhibiting, among others, the constructor symbols that they can contain. On the other hand, when performing (program) transformations we often want to eliminate some symbols and, more generally, to ensure that some patterns are absent from the result of the transformation.
We propose in this paper an approach to statically verify the absence of specified patterns from the reachable terms of constructor based term rewriting systems. The proposed approach consists in annotating the function symbols with a set of profiles outlining pre- and post-conditions that must be verified by the rewrite relation, and using a rewrite based method to statically verify that the rewrite system is indeed consistent with the respective annotations.

References

[1]
Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. 1994. Soft Typing with Conditional Types. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1994, Hans-Juergen Boehm, Bernard Lang, and Daniel M. Yellin(Eds.). ACM Press, 163–173. https://doi.org/10.1145/174675.177847
[2]
Thomas Arts and Jürgen Giesl. 2000. Termination of term rewriting using dependency pairs. Theoretical Computer Science 236, 1-2 (2000), 133–178. https://doi.org/10.1016/S0304-3975(99)00207-8
[3]
Franz Baader and Tobias Nipkow. 1998. Term Rewriting and All That.Cambridge University Press.
[4]
Emilie Balland, Paul Brauner, Radu Kopetz, Pierre-Etienne Moreau, and Antoine Reilles. 2007. Tom: Piggybacking Rewriting on Java. In International Conference on Term Rewriting and Applications, RTA 2007(Lecture Notes in Computer Science, Vol. 4533). Springer, 36–47. https://doi.org/10.1007/978-3-540-73449-9_5
[5]
Gilles Barthe and Maria João Frade. 1999. Constructor Subtyping. In European Symposium on Programming Languages and Systems, ESOP’99(Lecture Notes in Computer Science, Vol. 1576). Springer, 109–127. https://doi.org/10.1007/3-540-49099-X_8
[6]
Françoise Bellegarde. 1991. Program Transformation and Rewriting. In International Conference on Rewriting Techniques and Applications, RTA-91(Lecture Notes in Computer Science, Vol. 488). Springer, 226–239. https://doi.org/10.1007/3-540-53904-2_99
[7]
Véronique Benzaken, Giuseppe Castagna, and Alain Frisch. 2003. CDuce: an XML-centric general-purpose language. In ACM SIGPLAN International Conference on Functional Programming, ICFP 2003, Colin Runciman and Olin Shivers (Eds.). ACM, 51–63. https://doi.org/10.1145/944705.944711
[8]
Ahmed Bouajjani, Peter Habermehl, Adam Rogalewicz, and Tomás Vojnar. 2005. Abstract Regular Tree Model Checking. In International Workshop on Verification of Infinite-State Systems, INFINITY 2005(Electronic Notes in Theoretical Computer Science, Vol. 149), Jirí Srba and Scott A. Smolka (Eds.). Elsevier, 37–48. https://doi.org/10.1016/j.entcs.2005.11.015
[9]
Horatiu Cirstea, Pierre Lermusiaux, and Pierre-Etienne Moreau. 2020. Pattern Eliminating Transformations. In International Symposium on Logic-Based Program Synthesis and Transformation, LOPSTR 2020(Lecture Notes in Computer Science, Vol. 12561), Maribel Fernández (Ed.). Springer, 74–92. https://doi.org/10.1007/978-3-030-68446-4_4
[10]
Horatiu Cirstea and Pierre-Etienne Moreau. 2019. Generic Encodings of Constructor Rewriting Systems. In International Symposium on Principles and Practice of Programming Languages, PPDP 2019. ACM, 8:1–8:12. https://doi.org/10.1145/3354166.3354173
[11]
Manuel Clavel, Francisco Durán, Steven Eker, Patrick Lincoln, Narciso Martí-Oliet, José Meseguer, and Carolyn L. Talcott. 2003. The Maude 2.0 System. In International Conference on Rewriting Techniques and Applications, RTA 2003(Lecture Notes in Computer Science, Vol. 2706). Springer, 76–87. https://doi.org/10.1007/3-540-44881-0_7
[12]
Timothy S. Freeman and Frank Pfenning. 1991. Refinement Types for ML. In ACM SIGPLAN’91 Conference on Programming Language Design and Implementation (PLDI). ACM, 268–277. https://doi.org/10.1145/113445.113468
[13]
Alain Frisch, Giuseppe Castagna, and Véronique Benzaken. 2002. Semantic Subtyping. In IEEE Symposium on Logic in Computer Science, (LICS 2002). IEEE Computer Society, 137–146. https://doi.org/10.1109/LICS.2002.1029823
[14]
Thomas Genet. 2014. Towards Static Analysis of Functional Programs Using Tree Automata Completion. In International Workshop on Rewriting Logic and Its Applications, WRLA 2014(Lecture Notes in Computer Science, Vol. 8663). Springer, 147–161. https://doi.org/10.1007/978-3-319-12904-4_8
[15]
Thomas Genet. 2016. Termination criteria for tree automata completion. Journal of Logical and Algebraic Methods in Programming 85, 1(2016), 3–33. https://doi.org/10.1016/j.jlamp.2015.05.003
[16]
Jürgen Giesl, René Thiemann, Peter Schneider-Kamp, and Stephan Falke. 2006. Mechanizing and Improving Dependency Pairs. Journal of Automatic Reasoning 37, 3 (2006), 155–203. https://doi.org/10.1007/s10817-006-9057-7
[17]
Timothée Haudebourg, Thomas Genet, and Thomas P. Jensen. 2020. Regular language type inference with term rewriting. Proceedings of the ACM on Programming Languages 4, ICFP(2020), 112:1–112:29. https://doi.org/10.1145/3408994
[18]
Nao Hirokawa and Aart Middeldorp. 2005. Automating the dependency pair method. Information and Computation 199, 1-2 (2005), 172–199. https://doi.org/10.1016/j.ic.2004.10.004
[19]
Haruo Hosoya and Benjamin C. Pierce. 2003. XDuce: A statically typed XML processing language. ACM Trans. Internet Techn. 3, 2 (2003), 117–148. https://doi.org/10.1145/767193.767195
[20]
Naoki Kobayashi. 2009. Types and higher-order recursion schemes for verification of higher-order programs. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009. ACM, 416–428. https://doi.org/10.1145/1480881.1480933
[21]
Naoki Kobayashi, Naoshi Tabuchi, and Hiroshi Unno. 2010. Higher-order multi-parameter tree transducers and recursion schemes for program verification. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010. ACM, 495–508. https://doi.org/10.1145/1706299.1706355
[22]
David Lacey and Oege de Moor. 2001. Imperative Program Transformation by Rewriting. In International Conference on Compiler Construction, CC 2001(Lecture Notes in Computer Science, Vol. 2027), Reinhard Wilhelm (Ed.). Springer, 52–68. https://doi.org/10.1007/3-540-45306-7_5
[23]
Tova Milo, Dan Suciu, and Victor Vianu. 2003. Typechecking for XML transformers. J. Comput. Syst. Sci. 66, 1 (2003), 66–97. https://doi.org/10.1016/S0022-0000(02)00030-2
[24]
C.-H. Luke Ong and Steven J. Ramsay. 2011. Verifying higher-order functional programs with pattern-matching algebraic data types. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011. ACM, 587–598. https://doi.org/10.1145/1926385.1926453
[25]
Patrick Maxim Rondon, Ming Kawaguchi, and Ranjit Jhala. 2008. Liquid types. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2008, Rajiv Gupta and Saman P. Amarasinghe (Eds.). ACM, 159–169. https://doi.org/10.1145/1375581.1375602
[26]
Grigore Rosu and Traian-Florin Serbanuta. 2010. An overview of the K semantic framework. Journal of Logic and Algebraic Programming 79, 6 (2010), 397–434. https://doi.org/10.1016/j.jlap.2010.03.012
[27]
Toshinori Takai. 2004. A Verification Technique Using Term Rewriting Systems and Abstract Interpretation. In International Conference on Rewriting Techniques and Applications, RTA 2004(Lecture Notes in Computer Science, Vol. 3091). Springer, 119–133. https://doi.org/10.1007/978-3-540-25979-4_9
[28]
Terese. 2003. Term Rewriting Systems. Cambridge University Press. M. Bezem, J. W. Klop and R. de Vrijer, eds.
[29]
Akihiko Tozawa. 2006. XML Type Checking Using High-Level Tree Transducer. In International Symposium on Functional and Logic Programming, FLOPS 2006(Lecture Notes in Computer Science, Vol. 3945), Masami Hagiya and Philip Wadler (Eds.). Springer, 81–96. https://doi.org/10.1007/11737414_7
[30]
Niki Vazou, Eric L. Seidel, and Ranjit Jhala. 2014. LiquidHaskell: experience with refinement types in the real world. In ACM SIGPLAN symposium on Haskell, Wouter Swierstra (Ed.). ACM, 39–51. https://doi.org/10.1145/2633357.2633366
[31]
Eelco Visser. 1999. Strategic Pattern Matching. In International Conference on Rewriting Techniques and Applications, RTA-99(Lecture Notes in Computer Science, Vol. 1631). Springer, 30–44. https://doi.org/10.1007/3-540-48685-2_3

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPDP '21: Proceedings of the 23rd International Symposium on Principles and Practice of Declarative Programming
September 2021
277 pages
ISBN:9781450386890
DOI:10.1145/3479394
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 October 2021

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Pattern semantics
  2. Pattern-matching
  3. Rewriting
  4. Static analysis

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Funding Sources

Conference

PPDP 2021

Acceptance Rates

Overall Acceptance Rate 230 of 486 submissions, 47%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)1
Reflects downloads up to 07 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media