qute

A software analysis framework built around the QBE intermediate language

git clone https://git.8pit.net/qute.git

  1cabal-version:      3.4
  2name:               qute
  3version:            0.1.0
  4synopsis:           A software analysis framework built around the QBE intermediate language.
  5description:
  6  This library provides formal semantics for the [QBE intermediate language](https://c9x.me/compile/)
  7  by providing [modular monadic semantics](https://doi.org/10.1007/3-540-61055-3_39) implemented using
  8  an [abstract monad](https://doi.org/10.1145/3607833). The package refers to this abstract monad as
  9  the 'Language.QBE.Simulator.State.Simulator' monad. It provides several primitives that are used by
 10  the "Language.QBE.Simulator" to /abstractly/ describe the semantics of QBE instructions. The
 11  'Language.QBE.Simulator.State.Simulator' can then be instantiated with /concrete/ semantics. For
 12  example, the "Language.QBE.Simulator.Default.State" module provides an instantiation using a
 13  'Control.Monad.State' monad. This instantiation, and the 'Language.QBE.Simulator.State.Simulator'
 14  itself, are parameterized over the representation of QBE instruction operand values.
 15
 16  To abstractly describe operations on values passed to QBE instructions, this library additionally
 17  provides an expression language abstraction in the "Language.QBE.Simulator.Expression" module.
 18  Further, an implementation of this expression language based on fixed-width integer values is
 19  available in the "Language.QBE.Simulator.Default.Expression" module.
 20
 21  A separate [qute-symex](https://hackage.haskell.org/package/qute-symex) package provides an
 22  implementation of the expression abstraction and the 'Language.QBE.Simulator.State.Simulator'
 23  monad for formal reasoning about a software under test using
 24  [symbolic execution](https://en.wikipedia.org/wiki/Symbolic_execution).
 25  Similar dynamic software testing techniques can be implemented using this library. Additionally,
 26  there is some preliminary support for static analysis as well through the
 27  "Language.QBE.Analysis.CFG" module.
 28
 29  More information on the underlying idea and vision behind Qute is available in a
 30  [separate paper](https://www.ibr.cs.tu-bs.de/vss/Publications/2026/tempel_26_qute.pdf).
 31license:            GPL-3.0-only AND MIT AND BSD-3-Clause
 32-- license-file:
 33author:             Sören Tempel
 34maintainer:         soeren+hackage@soeren-tempel.net
 35-- copyright:
 36category:           Language
 37build-type:         Simple
 38homepage:           https://git.8pit.net/qute
 39bug-reports:        https://github.com/nmeum/qute/issues
 40
 41source-repository head
 42    type: git
 43    location: https://git.8pit.net/qute.git
 44
 45common warnings
 46    -- -Wall-missed-specializations can be useful too
 47    ghc-options: -Wall
 48
 49common opts
 50    ghc-options: -fspecialise-aggressively
 51
 52library
 53    import:           warnings, opts
 54    -- other-modules:
 55    hs-source-dirs:   src
 56    default-language: GHC2021
 57
 58    build-depends:
 59      base,
 60      array,
 61      deepseq,
 62      template-haskell,
 63      qute-syntax,
 64      containers,
 65      exceptions,
 66      parsec,
 67      mtl
 68
 69    other-modules:
 70      Language.QBE.Simulator.Default.Generator
 71
 72    exposed-modules:
 73      Language.QBE.Analysis.CFG,
 74      Language.QBE.Analysis.CDG,
 75      Language.QBE.Analysis.Graph,
 76      Language.QBE.Simulator,
 77      Language.QBE.Simulator.State,
 78      Language.QBE.Simulator.Error,
 79      Language.QBE.Simulator.Memory,
 80      Language.QBE.Simulator.Expression,
 81      Language.QBE.Simulator.Default.State,
 82      Language.QBE.Simulator.Default.Funcs,
 83      Language.QBE.Simulator.Default.Expression
 84
 85benchmark qute
 86    import:           warnings, opts
 87    default-language: GHC2021
 88    type:             exitcode-stdio-1.0
 89    hs-source-dirs:   bench
 90    main-is:          Main.hs
 91
 92    build-depends:
 93      base,
 94      criterion ^>= 1.6.4.0,
 95      qute,
 96      qute-syntax
 97
 98test-suite qute-test
 99    import:           warnings
100    default-language: GHC2021
101    type:             exitcode-stdio-1.0
102    hs-source-dirs:   test
103    main-is:          Main.hs
104    -- Prevent GHGC from optimizing float2Double calls.
105    ghc-options:      -O0
106
107    other-modules:
108      Analysis,
109      Simulator,
110      Expression,
111      Memory,
112      State
113
114    build-depends:
115        base,
116        array,
117        parsec,
118        filepath,
119        qute,
120        qute-syntax,
121        containers,
122        exceptions,
123        mtl,
124        tasty        >=1.4.3,
125        tasty-hunit  >=0.10