Executable Formal Semantics for the POSIX Shell

被引:9
|
作者
Greenberg, Michael [1 ]
Blatt, Austin J. [1 ,2 ]
机构
[1] Pomona Coll, Dept Comp Sci, Claremont, CA 91711 USA
[2] Puppet Labs, Portland, OR USA
关键词
command line interfaces; POSIX; formalization; small-step semantics;
D O I
10.1145/3371111
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The POSIX shell is a widely deployed, powerful tool for managing computer systems. The shell is the expert's control panel, a necessary tool for configuring, compiling, installing, maintaining, and deploying systems. Even though it is powerful, critical infrastructure, the POSIX shell is maligned and misunderstood. Its power and its subtlety are a dangerous combination. We define a formal, mechanized, executable small-step semantics for the POSIX shell, which we call Smoosh. We compared Smoosh against seven other shells that aim for some measure of POSIX compliance (bash, dash, zsh, OSH, mksh, ksh93, and yash). Using three test suites-the POSIX test suite, the Modernish test suite and shell diagnostic, and a test suite of our own device-we found Smoosh's semantics to be the most conformant to the POSIX standard. Modemish judges Smoosh to have the fewest bugs (just one, from using dash's parser) and no quirks. To show that our semantics is useful beyond yielding a conformant, executable shell, we also implemented a symbolic stepper to illuminate the subtle behavior of the shell. Smoosh will serve as a foundation for formal study of the POSIX shell, supporting research on and development of new shells, new tooling for shells, and new shell designs.
引用
收藏
页数:30
相关论文
共 50 条
  • [1] An Executable Formal Semantics of PHP
    Filaretti, Daniele
    Maffeis, Sergio
    [J]. ECOOP 2014 - OBJECT-ORIENTED PROGRAMMING, 2014, 8586 : 567 - 592
  • [2] KRust: A Formal Executable Semantics of Rust
    Wang, Feng
    Song, Fu
    Zhang, Min
    Zhu, Xiaoran
    Zhang, Jun
    [J]. PROCEEDINGS 2018 12TH INTERNATIONAL SYMPOSIUM ON THEORETICAL ASPECTS OF SOFTWARE ENGINEERING (TASE 2018), 2018, : 44 - 51
  • [3] An Executable Formal Semantics of C with Applications
    Ellison, Chucky
    Rosu, Grigore
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (01) : 533 - 544
  • [4] An Executable Formal Semantics of C with Applications
    Ellison, Chucky
    Rosu, Grigore
    [J]. POPL 12: PROCEEDINGS OF THE 39TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2012, : 533 - 544
  • [5] A Formal Framework for Prototyping Executable Semantics in ATL
    Boronat, Artur
    [J]. THEORY AND PRACTICE OF MODEL TRANSFORMATION, ICMT 2018, 2018, 10888 : 157 - 172
  • [6] An executable formal semantics for UML-RT
    Posse, Ernesto
    Dingel, Juergen
    [J]. SOFTWARE AND SYSTEMS MODELING, 2016, 15 (01): : 179 - 217
  • [7] A formal executable semantics of the Java']JavaCard platform
    Barthe, G
    Dufay, G
    Jakubiec, L
    Serpette, B
    de Sousa, SM
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2001, 2028 : 302 - 319
  • [8] Formal executable semantics for conformance in the MDE framework
    Egea, Marina
    Rusu, Vlad
    [J]. INNOVATIONS IN SYSTEMS AND SOFTWARE ENGINEERING, 2010, 6 (1-2) : 73 - 81
  • [9] An executable formal semantics for UML-RT
    Ernesto Posse
    Juergen Dingel
    [J]. Software & Systems Modeling, 2016, 15 : 179 - 217
  • [10] Formal and Executable Semantics of the Ethereum Virtual Machine in Dafny
    Cassez, Franck
    Fuller, Joanne
    Ghale, Milad K.
    Pearce, David J.
    Quiles, Horacio M. A.
    [J]. FORMAL METHODS, FM 2023, 2023, 14000 : 571 - 583