packages feed

copilot-language 3.9 → 3.10

raw patch · 5 files changed

+51/−30 lines, 5 filesdep ~copilot-coredep ~copilot-theoremPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: copilot-core, copilot-theorem

API changes (from Hackage documentation)

Files

CHANGELOG view
@@ -1,3 +1,11 @@+2022-07-07+        * Version bump (3.10). (#356)+        * Fix error in test case generation; enable CLI args in tests. (#337)+        * Remove duplicated compiler option. (#328)+        * Adjust imports due to deprecation. (#330)+        * Fix typos in Copilot.Language.Interpret. (#331)+        * Update repo info in cabal file. (#333)+ 2022-05-06         * Version bump (3.9). (#320)         * Compliance with style guide (partial). (#316)
copilot-language.cabal view
@@ -1,6 +1,6 @@ cabal-version:       >=1.10 name:                copilot-language-version:             3.9+version:             3.10 synopsis:            A Haskell-embedded DSL for monitoring hard real-time                      distributed systems. description:@@ -30,7 +30,7 @@ source-repository head     type:       git     location:   https://github.com/Copilot-Language/copilot.git-    subdir:     lib/copilot-language+    subdir:     copilot-language  library   default-language: Haskell2010@@ -42,8 +42,8 @@                , data-reify      >= 0.6 && < 0.7                , mtl             >= 2.0 && < 3 -               , copilot-core    >= 3.9 && < 3.10-               , copilot-theorem >= 3.9 && < 3.10+               , copilot-core    >= 3.10 && < 3.11+               , copilot-theorem >= 3.10 && < 3.11    exposed-modules: Copilot.Language                  , Copilot.Language.Operators.BitWise@@ -71,7 +71,6 @@                  , System.Mem.StableName.Map                  , Copilot.Language.Error   ghc-options:-    -fwarn-tabs     -Wall  test-suite unit-tests
src/Copilot/Language/Interpret.hs view
@@ -1,8 +1,8 @@ -- Copyright (c) 2011 National Institute of Aerospace / Galois, Inc. --- | This module implements two interpreters, which may be used to simulated or--- executed Copilot specifications on a computer to understand their behavior--- to debug possible errors.+-- | This module implements two interpreters, which may be used to simulate or+-- execute Copilot specifications on a computer to understand their behavior to+-- debug possible errors. -- -- The interpreters included vary in how the present the results to the user. -- One of them uses a format (csv) that may be more machine-readable, while the
tests/Main.hs view
@@ -2,15 +2,14 @@ module Main where  -- External imports-import Data.Monoid    (mempty)-import Test.Framework (Test, defaultMainWithOpts)+import Test.Framework (Test, defaultMain)  -- Internal imports import qualified Test.Copilot.Language.Reify  -- | Run all unit tests on copilot-language. main :: IO ()-main = defaultMainWithOpts tests mempty+main = defaultMain tests  -- | All unit tests in copilot-language. tests :: [Test.Framework.Test]
tests/Test/Copilot/Language/Reify.hs view
@@ -36,8 +36,8 @@ import qualified Copilot.Language.Stream             as Copilot  -- Internal imports: functions needed to test after reification-import Copilot.Core.Type.Show      (ShowType (Haskell))-import Copilot.Core.Interpret.Eval (ExecTrace (interpObservers), eval)+import Copilot.Core.Interpret.Eval (ExecTrace (interpObservers),+                                    ShowType (Haskell), eval)  -- Internal imports: auxiliary functions import Test.Extra (apply1, apply2, apply3)@@ -459,27 +459,42 @@ arbitraryBitsIntegralExpr :: (Arbitrary t, Typed t, Bits t, Integral t)                           => Gen (Stream t, [t]) arbitraryBitsIntegralExpr =-  -- We use frequency instead of oneof because the random expression generator-  -- seems to generate expressions that are too large and the test fails due-  -- to running out of memory.-  frequency-    [ (10, arbitraryConst)+      -- We use frequency instead of oneof because the random expression+      -- generator seems to generate expressions that are too large and the+      -- test fails due to running out of memory.+      frequency+        [ (10, arbitraryConst) -    , (2, apply1 <$> arbitraryNumOp1 <*> arbitraryBitsIntegralExpr)+        , (2, apply1 <$> arbitraryNumOp1 <*> arbitraryBitsIntegralExpr) -    , (1, apply2 <$> arbitraryNumOp2-                 <*> arbitraryBitsIntegralExpr-                 <*> arbitraryBitsIntegralExpr)+        , (1, apply2 <$> arbitraryNumOp2+                     <*> arbitraryBitsIntegralExpr+                     <*> arbitraryBitsIntegralExpr) -    , (5, apply2 <$> arbitraryBitsIntegralOp2-                 <*> arbitraryBitsIntegralExpr-                 <*> arbitraryBitsIntegralExpr)+        , (5, apply2 <$> arbitraryBitsIntegralOp2+                     <*> arbitraryBitsIntegralExpr+                     <*> arbitraryBitsIntegralExprConstPos) -    , (1, apply3 <$> arbitraryITEOp3-                 <*> arbitraryBoolExpr-                 <*> arbitraryBitsIntegralExpr-                 <*> arbitraryBitsIntegralExpr)-    ]+        , (1, apply3 <$> arbitraryITEOp3+                     <*> arbitraryBoolExpr+                     <*> arbitraryBitsIntegralExpr+                     <*> arbitraryBitsIntegralExpr)+        ]+  where++    -- Generator for constant bit integral expressions that, when converted to+    -- type 't', result in a positive number. We use a constant generator, as+    -- opposed to a generator based on the more comprehensive+    -- arbitraryBitsIntegralExpr, because the latter runs out of memory easily+    -- when nested and filtered with suchThat.+    arbitraryBitsIntegralExprConstPos =+        (\v -> (Copilot.constant v, repeat v)) <$> intThatFits+      where+        -- In this context:+        --+        -- intThatFits :: Gen t+        intThatFits =+          suchThat arbitrary ((> 0) . (\x -> (fromIntegral x) :: Int))  -- ** Operators