Commit 1169979f by Michael Hanus

### Tools updated

parent 5a5d0e87
 ... ... @@ -10,6 +10,7 @@ optimize/.cpm/packages/cass-2.0.0 optimize/.cpm/packages/cass-analysis-2.0.0 optimize/.cpm/packages/csv-1.0.0 optimize/.cpm/packages/currypath-0.0.1 optimize/.cpm/packages/finite-map-0.0.1 optimize/.cpm/packages/flatcurry-2.0.0 optimize/.cpm/packages/frontend-exec-0.0.1 optimize/.cpm/packages/propertyfile-0.0.1 ... ...
 ------------------------------------------------------------------------------ --- Library defining natural numbers in Peano representation and --- some operations on this representation. --- --- @author Michael Hanus --- @version May 2017 --- @category general ------------------------------------------------------------------------------ module Nat ( Nat(..), fromNat, toNat, add, sub, mul, leq ) where --- Natural numbers defined in Peano representation. data Nat = Z | S Nat deriving (Eq,Show) --- Transforms a natural number into a standard integer. fromNat :: Nat -> Int fromNat Z = 0 fromNat (S n) = 1 + fromNat n --- Transforms a standard integer into a natural number. toNat :: Int -> Nat toNat n | n == 0 = Z | n > 0 = S (toNat (n-1)) --- Addition on natural numbers. add :: Nat -> Nat -> Nat add Z n = n add (S m) n = S(add m n) --- Subtraction defined by reversing addition. sub :: Nat -> Nat -> Nat sub x y | add y z == x = z where z free --- Multiplication on natural numbers. mul :: Nat -> Nat -> Nat mul Z _ = Z mul (S m) n = add n (mul m n) -- less-or-equal predicated on natural numbers: leq :: Nat -> Nat -> Bool leq Z _ = True leq (S _) Z = False leq (S x) (S y) = leq x y
 ... ... @@ -32,8 +32,10 @@ readAndTestEqualFcy mod = do renameFile modbak modcurry let abstractequal = prog1 == prog2 unless abstractequal \$ do putStrLn \$ "Original AbstractCurry program: " ++ show prog1 putStrLn \$ "Pretty printed AbstractCurry program: " ++ show prog2 putStrLn \$ unlines [ "Differences in programs occurred:" , "Original AbstractCurry program:", show prog1 , "Pretty printed AbstractCurry program:", show prog2 ] return abstractequal -- Strictly read a AbstractCurry program in order to avoid race conditions ... ... @@ -47,4 +49,4 @@ testAbstractCurryPretty_rev = (readAndTestEqualFcy "Rev") `returns` True testAbstractCurryPretty_TestAbstractCurry = (readAndTestEqualFcy "TestAbstractCurry") `returns` True (readAndTestEqualFcy "Nat") `returns` True
 ... ... @@ -9,6 +9,7 @@ "dependencies": { "base" : ">= 1.0.0, < 2.0.0", "currypath" : ">= 0.0.1", "finite-map": ">= 0.0.1", "flatcurry" : ">= 2.0.0", "scc" : ">= 0.0.1" }, ... ...
 ... ... @@ -2,7 +2,7 @@ --- This module defines a datatype to represent the analysis information. --- --- @author Heiko Hoffmann, Michael Hanus --- @version January 2015 --- @version January 2019 ----------------------------------------------------------------------- module Analysis.ProgInfo ... ... @@ -14,8 +14,9 @@ module Analysis.ProgInfo ) where import Directory (removeFile) import FiniteMap import FilePath ((<.>)) import Data.FiniteMap import FlatCurry.Types import XML ... ...
 ... ... @@ -10,6 +10,7 @@ "base" : ">= 1.0.0, < 2.0.0", "cass-analysis" : ">= 2.0.0", "currypath" : ">= 0.0.1", "finite-map" : ">= 0.0.1", "flatcurry" : ">= 2.0.0", "propertyfile" : ">= 0.0.1", "redblacktree" : ">= 0.0.1", ... ...
 ... ... @@ -3,12 +3,11 @@ --- In particular, it contains some simple fixpoint computations. --- --- @author Heiko Hoffmann, Michael Hanus --- @version December 2018 --- @version January 2019 -------------------------------------------------------------------------- module CASS.WorkerFunctions where import FiniteMap import IOExts import List ( partition ) import Maybe ( fromJust ) ... ... @@ -21,6 +20,7 @@ import Analysis.Types ( Analysis(..), isSimpleAnalysis, isCombinedAnalysis import Analysis.ProgInfo ( ProgInfo, combineProgInfo, emptyProgInfo , publicProgInfo, lookupProgInfo, lists2ProgInfo , equalProgInfo, publicListFromProgInfo, showProgInfo ) import Data.FiniteMap import FlatCurry.Types import FlatCurry.Files import FlatCurry.Goodies ... ...