name:                copilot
version:             4.4
cabal-version:       >= 1.10
license:             BSD3
license-file:        LICENSE
author:              Frank Dedden, Nis Nordby Wegmann, Lee Pike, Robin Morisset, Sebastian Niller, Alwyn Goodloe, Ivan Perez
synopsis:            A stream DSL for writing embedded C programs.
build-type:          Simple
maintainer:          Ivan Perez <ivan.perezdominguez@nasa.gov>
category:            Language, Embedded
homepage:            https://copilot-language.github.io
bug-reports:         https://github.com/Copilot-Language/copilot/issues
stability:           Experimental
description:
  Copilot is a stream-based runtime verification framework implemented as an
  embedded domain-specific language (EDSL) in Haskell. Programs can be
  interpreted for testing, or translated into C99 code to be incorporated in a
  project, or as a standalone application. The C99 backend output is constant
  in memory and time, making it suitable for systems with hard realtime
  requirements.
  .
  This package is the main entry-point for using Copilot.
  .
  A tutorial, examples, and other information are available at
  <https://copilot-language.github.io>.

x-curation: uncurated

extra-source-files:
  README.md
  CHANGELOG

source-repository head
    type:       git
    location:   https://github.com/Copilot-Language/copilot.git
    subdir:     copilot

flag examples
    description: Enable examples
    default: False
    manual: True

library
    hs-source-dirs: src
    default-language:  Haskell2010
    ghc-options:
      -Wall
      -fno-warn-orphans
    build-depends:
                       base                  >= 4.9  && < 5
                     , optparse-applicative  >= 0.14 && < 0.19
                     , directory             >= 1.3  && < 1.4
                     , filepath              >= 1.4  && < 1.6

                     , copilot-core          >= 4.4 && < 4.5
                     , copilot-theorem       >= 4.4 && < 4.5
                     , copilot-language      >= 4.4 && < 4.5
                     , copilot-libraries     >= 4.4 && < 4.5
                     , copilot-c99           >= 4.4 && < 4.5
                     , copilot-prettyprinter >= 4.4 && < 4.5


    exposed-modules: Language.Copilot, Language.Copilot.Main

executable what4-propositional
    main-is:                Propositional.hs
    hs-source-dirs:         examples/what4
    build-depends:          base
                          , copilot
                          , copilot-theorem
    default-language:       Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable what4-arithmetic
    main-is:                Arithmetic.hs
    hs-source-dirs:         examples/what4
    build-depends:          base
                          , copilot
                          , copilot-theorem
    default-language:       Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable what4-arithmetic-counterexamples
    main-is:                ArithmeticCounterExamples.hs
    hs-source-dirs:         examples/what4
    build-depends:          base
                          , containers
                          , copilot
                          , copilot-theorem
    default-language:       Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable what4-structs
    main-is:                Structs.hs
    hs-source-dirs:         examples/what4
    build-depends:          base
                          , copilot
                          , copilot-theorem
    default-language:       Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable wcv
    main-is:            WCV.hs
    hs-source-dirs:     examples
    build-depends:      base        >= 4.9  && < 5
                      , copilot
                      , copilot-core
                      , copilot-theorem
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable addmult
    main-is:            AddMult.hs
    hs-source-dirs:     examples
    build-depends:      base        >= 4.9  && < 5
                      , copilot
                      , copilot-core
                      , copilot-theorem
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable array
    main-is:            Array.hs
    hs-source-dirs:     examples
    build-depends:      base        >= 4.9  && < 5
                      , copilot
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable cast
    main-is:            Cast.hs
    hs-source-dirs:     examples
    build-depends:      base        >= 4.9  && < 5
                      , copilot
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable clock
    main-is:            Clock.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
                      , copilot-libraries
                      , copilot-core
                      , copilot-theorem
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable counter
    main-is:            Counter.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
                      , copilot-c99
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable engine
    main-is:            Engine.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable heater
    main-is:            Heater.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
                      , copilot-c99
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable structs
    main-is:            Structs.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
                      , copilot-c99
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable structs-update-field
    main-is:            StructsUpdateField.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
                      , copilot-c99
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False

executable voting
    main-is:            Voting.hs
    hs-source-dirs:     examples
    build-depends:      base              >= 4.9  && < 5
                      , copilot
    default-language:   Haskell2010
    if flag(examples)
      buildable: True
    else
      buildable: False