[arch-commits] Commit in cryptol/trunk (PKGBUILD sbv-8.8.patch)
Felix Yan
felixonmars at archlinux.org
Sat Nov 21 12:36:32 UTC 2020
Date: Saturday, November 21, 2020 @ 12:36:31
Author: felixonmars
Revision: 758479
upgpkg: cryptol 2.10.0-1
Added:
cryptol/trunk/sbv-8.8.patch
Modified:
cryptol/trunk/PKGBUILD
---------------+
PKGBUILD | 22 +++++++-----
sbv-8.8.patch | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 115 insertions(+), 8 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-11-21 12:34:21 UTC (rev 758478)
+++ PKGBUILD 2020-11-21 12:36:31 UTC (rev 758479)
@@ -1,8 +1,8 @@
# Maintainer: Felix Yan <felixonmars at archlinux.org>
pkgname=cryptol
-pkgver=2.9.1
-pkgrel=44
+pkgver=2.10.0
+pkgrel=1
pkgdesc="The Language of Cryptography"
url="https://www.cryptol.net"
license=("BSD")
@@ -9,14 +9,20 @@
arch=('x86_64')
depends=('ghc-libs' 'z3' 'haskell-async' 'haskell-base-compat' 'haskell-bv-sized'
'haskell-cryptohash-sha1' 'haskell-exceptions' 'haskell-gitrev' 'haskell-graphscc'
- 'haskell-heredoc' 'haskell-libbf' 'haskell-monad-control' 'haskell-monadlib'
- 'haskell-parameterized-utils' 'haskell-panic' 'haskell-random' 'haskell-sbv8.7'
- 'haskell-simple-smt' 'haskell-strict' 'haskell-tf-random' 'haskell-transformers-base'
- 'haskell-what4' 'haskell-ansi-terminal' 'haskell-blaze-html')
+ 'haskell-heredoc' 'haskell-libbf' 'haskell-memotrie' 'haskell-monad-control'
+ 'haskell-monadlib' 'haskell-parameterized-utils' 'haskell-panic' 'haskell-random'
+ 'haskell-sbv' 'haskell-simple-smt' 'haskell-strict' 'haskell-tf-random'
+ 'haskell-transformers-base' 'haskell-what4' 'haskell-ansi-terminal' 'haskell-blaze-html')
makedepends=('ghc' 'alex' 'happy')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/GaloisInc/cryptol/archive/$pkgver.tar.gz")
-sha512sums=('42c9058035f30e27dc30a17e901df87072939a84867cd2723ecf9e67e51cc53a308c38369dd7353bd2df043baa5f9f94c34a94ac52bcd6b45bfad8a67810f975')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/GaloisInc/cryptol/archive/$pkgver.tar.gz"
+ sbv-8.8.patch)
+sha512sums=('efb5f048a23de2040716d210b3d59071744d97989920266206590320585850a84de989851ed94687995874d74a3e6986d2e735e636aaa9f70f8949604ab62904'
+ 'da4ac99c538a935eed9efd98dd6c57f24ad12d8effe328a814661ed02395445d28c8b4f43b48492171dc0bd65c6568fe7641de94e32765d51ab208a38f09d2d2')
+prepare() {
+ patch -d $pkgname-$pkgver -p1 < sbv-8.8.patch
+}
+
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
Added: sbv-8.8.patch
===================================================================
--- sbv-8.8.patch (rev 0)
+++ sbv-8.8.patch 2020-11-21 12:36:31 UTC (rev 758479)
@@ -0,0 +1,101 @@
+diff --git a/cryptol.cabal b/cryptol.cabal
+index 24eb2929..e65d3ed7 100644
+--- a/cryptol.cabal
++++ b/cryptol.cabal
+@@ -65,7 +65,7 @@ library
+ pretty >= 1.1,
+ process >= 1.2,
+ random >= 1.0.1,
+- sbv >= 8.6 && < 8.8,
++ sbv >= 8.6 && < 8.10,
+ simple-smt >= 0.7.1,
+ stm >= 2.4,
+ strict,
+diff --git a/src/Cryptol/Backend/SBV.hs b/src/Cryptol/Backend/SBV.hs
+index 6a4d8b00..50e4e087 100644
+--- a/src/Cryptol/Backend/SBV.hs
++++ b/src/Cryptol/Backend/SBV.hs
+@@ -6,6 +6,7 @@
+ -- Stability : provisional
+ -- Portability : portable
+
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveFunctor #-}
+ {-# LANGUAGE FlexibleInstances #-}
+ {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+@@ -73,17 +74,24 @@ unpackSBV x = [ svTestBit x i | i <- reverse [0 .. intSizeOf x - 1] ]
+ literalSWord :: Int -> Integer -> SWord SBV
+ literalSWord w i = svInteger (KBounded False w) i
+
++svMkSymVar_ :: Maybe Quantifier -> Kind -> Maybe String -> SBV.State -> IO SVal
++#if MIN_VERSION_sbv(8,8,0)
++svMkSymVar_ a b c = svMkSymVar (SBV.NonQueryVar a) b c
++#else
++svMkSymVar_ a b c = svMkSymVar a b c
++#endif
++
+ freshBV_ :: SBV -> Int -> IO (SWord SBV)
+ freshBV_ (SBV stateVar _) w =
+- withMVar stateVar (svMkSymVar Nothing (KBounded False w) Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing (KBounded False w) Nothing)
+
+ freshSBool_ :: SBV -> IO (SBit SBV)
+ freshSBool_ (SBV stateVar _) =
+- withMVar stateVar (svMkSymVar Nothing KBool Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing KBool Nothing)
+
+ freshSInteger_ :: SBV -> IO (SInteger SBV)
+ freshSInteger_ (SBV stateVar _) =
+- withMVar stateVar (svMkSymVar Nothing KUnbounded Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing KUnbounded Nothing)
+
+
+ -- SBV Evaluation monad -------------------------------------------------------
+diff --git a/src/Cryptol/Symbolic/SBV.hs b/src/Cryptol/Symbolic/SBV.hs
+index 2f97100e..7421db91 100644
+--- a/src/Cryptol/Symbolic/SBV.hs
++++ b/src/Cryptol/Symbolic/SBV.hs
+@@ -6,6 +6,7 @@
+ -- Stability : provisional
+ -- Portability : portable
+
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE ImplicitParams #-}
+ {-# LANGUAGE LambdaCase #-}
+@@ -124,7 +125,11 @@ proverNames = map fst proverConfigs
+ setupProver :: String -> IO (Either String ([String], SBVProverConfig))
+ setupProver nm
+ | nm `elem` ["any","sbv-any"] =
++#if MIN_VERSION_sbv(8,9,0)
++ do ps <- SBV.getAvailableSolvers
++#else
+ do ps <- SBV.sbvAvailableSolvers
++#endif
+ case ps of
+ [] -> pure (Left "SBV could not find any provers")
+ _ -> let msg = "SBV found the following solvers: " ++ show (map (SBV.name . SBV.solver) ps) in
+@@ -155,7 +160,11 @@ satSMTResults :: SBV.SatResult -> [SBV.SMTResult]
+ satSMTResults (SBV.SatResult r) = [r]
+
+ allSatSMTResults :: SBV.AllSatResult -> [SBV.SMTResult]
++#if MIN_VERSION_sbv(8,8,0)
++allSatSMTResults (SBV.AllSatResult {allSatResults = rs}) = rs
++#else
+ allSatSMTResults (SBV.AllSatResult (_, _, _, rs)) = rs
++#endif
+
+ thmSMTResults :: SBV.ThmResult -> [SBV.SMTResult]
+ thmSMTResults (SBV.ThmResult r) = [r]
+@@ -389,7 +398,11 @@ processResults ProverCommand{..} ts results =
+
+ -- otherwise something is wrong
+ _ -> return $ ProverError (rshow results)
++#if MIN_VERSION_sbv(8,8,0)
++ where rshow | isSat = show . (SBV.AllSatResult False False False False)
++#else
+ where rshow | isSat = show . SBV.AllSatResult . (False,False,False,)
++#endif
+ | otherwise = show . SBV.ThmResult . head
+
+ where
More information about the arch-commits
mailing list