diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..e1028a1ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: concat +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ghc: + - "8.10.7" + - "9.0.2" + - "9.2.4" + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + id: setup-haskell-cabal + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: "3.6.0.0" + - run: cabal v2-update + - run: cabal v2-freeze $CONFIG + - uses: actions/cache@v2 + with: + path: | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + - run: cabal new-build all + - run: cabal new-test gold-tests diff --git a/cabal.project b/cabal.project index 9115b3df6..b98dc1059 100644 --- a/cabal.project +++ b/cabal.project @@ -16,11 +16,6 @@ source-repository-package tag: master subdir: verilog -source-repository-package - type: git - location: https://github.com/expipiplus1/vector-sized.git - tag: master - packages: ./inline/concat-inline.cabal ./plugin/concat-plugin.cabal diff --git a/classes/concat-classes.cabal b/classes/concat-classes.cabal index 942a25556..e49267058 100644 --- a/classes/concat-classes.cabal +++ b/classes/concat-classes.cabal @@ -48,6 +48,7 @@ library ConCat.MinMax ConCat.Category ConCat.AltCat + ConCat.Oops ghc-options: -O2 -- -fobject-code here avoids error "mkPluginUsage: file not found" -- with GHCi. See https://gitlab.haskell.org/ghc/ghc/issues/16093. diff --git a/classes/src/ConCat/Additive.hs b/classes/src/ConCat/Additive.hs index 001bdfed2..e2c718fa6 100644 --- a/classes/src/ConCat/Additive.hs +++ b/classes/src/ConCat/Additive.hs @@ -26,6 +26,8 @@ import Data.Monoid (Monoid(..), Sum(..), Product(..)) import Data.Semigroup (Semigroup(..)) import Data.Complex hiding (magnitude) import Data.Ratio +import Data.Int +import Data.Word import Foreign.C.Types (CSChar, CInt, CShort, CLong, CLLong, CIntMax, CFloat, CDouble) import GHC.Generics (U1(..),Par1(..),(:*:)(..),(:.:)(..)) import GHC.TypeLits (KnownNat) @@ -73,6 +75,10 @@ instance Additive () where {-# INLINE (^+^) #-} } ScalarType(Int) +ScalarType(Int16) +ScalarType(Int32) +ScalarType(Int64) +ScalarType(Int8) ScalarType(Integer) ScalarType(Float) ScalarType(Double) @@ -84,6 +90,11 @@ ScalarType(CLLong) ScalarType(CIntMax) ScalarType(CDouble) ScalarType(CFloat) +ScalarType(Word) +ScalarType(Word16) +ScalarType(Word32) +ScalarType(Word64) +ScalarType(Word8) instance Integral a => Additive (Ratio a) where zero = 0 diff --git a/classes/src/ConCat/AltCat.hs b/classes/src/ConCat/AltCat.hs index 957ea0c11..c512bb9d8 100644 --- a/classes/src/ConCat/AltCat.hs +++ b/classes/src/ConCat/AltCat.hs @@ -23,9 +23,7 @@ {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE UndecidableInstances #-} -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) {-# LANGUAGE NoStarIsType #-} -#endif {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -Wno-inline-rule-shadowing #-} @@ -381,6 +379,7 @@ Op0(logC,FloatingCat k a => a `k` a) Op0(cosC,FloatingCat k a => a `k` a) Op0(sinC,FloatingCat k a => a `k` a) Op0(sqrtC,FloatingCat k a => a `k` a) +Op0(tanhC,FloatingCat k a => a `k` a) -- Op0(powC,FloatingCat k a => a `k` a) Op0(fromIntegralC,FromIntegralCat k a b => a `k` b) @@ -1064,9 +1063,24 @@ Catify(distribute, distributeC) Catify(tabulate , tabulateC) Catify(index , indexC) -traverseC :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) -traverseC f = sequenceA . fmap f --- traverseC f = sequenceAC . fmapC f +traverseC :: + forall k t f a b. + ( Category k, + FunctorCat k t, + OkFunctor k f, + TraversableCat k t f, + Ok k a, + Ok k b + ) => + a `k` f b -> + t a `k` f (t b) +traverseC f = + sequenceAC . fmapC f + <+ okFunctor @k @t @(f b) + <+ okFunctor @k @f @(t b) + <+ okFunctor @k @t @a + <+ okFunctor @k @t @b + <+ okFunctor @k @f @b {-# INLINE traverseC #-} Catify(traverse, traverseC) @@ -1141,6 +1155,12 @@ separateProd (unFinite \\ knownMul @m @n -> x) = #-} +{-# RULES + +"uncurry (,)" uncurry (,) = id + +#-} + -- type Strong k h a = (ProductCat k, ZipCat k h, PointedCat k h a) -- -- Functorial strength diff --git a/classes/src/ConCat/Category.hs b/classes/src/ConCat/Category.hs index 2176d8314..c6ae33840 100644 --- a/classes/src/ConCat/Category.hs +++ b/classes/src/ConCat/Category.hs @@ -25,10 +25,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecursiveDo #-} - -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) {-# LANGUAGE NoStarIsType #-} -#endif {-# OPTIONS_GHC -Wall #-} @@ -1368,6 +1365,7 @@ instance (FloatingCat k a, con a) => FloatingCat (Constrained con k) a where cosC = Constrained cosC sinC = Constrained sinC sqrtC = Constrained sqrtC + tanhC = Constrained tanhC instance (RealFracCat k a b, con a, con b) => RealFracCat (Constrained con k) a b where floorC = Constrained floorC @@ -1698,7 +1696,7 @@ instance (FractionalCat k a, FractionalCat k' a) => FractionalCat (k :**: k') a PINLINER(divideC) class Ok k a => FloatingCat k a where - expC, logC, cosC, sinC, sqrtC :: a `k` a + expC, logC, cosC, sinC, sqrtC, tanhC :: a `k` a -- powC :: (a :* a) `k` a -- ln :: Floating a => a -> a @@ -1710,12 +1708,14 @@ instance Floating a => FloatingCat (->) a where cosC = IC.inline cos sinC = IC.inline sin sqrtC = IC.inline sqrt + tanhC = IC.inline tanh -- powC = IC.inline (**) {-# OPINLINE expC #-} {-# OPINLINE logC #-} {-# OPINLINE cosC #-} {-# OPINLINE sinC #-} {-# OPINLINE sqrtC #-} + {-# OPINLINE tanhC #-} #ifdef KleisliInstances instance (Monad m, Floating a) => FloatingCat (Kleisli m) a where @@ -1724,6 +1724,7 @@ instance (Monad m, Floating a) => FloatingCat (Kleisli m) a where cosC = arr cosC sinC = arr sinC sqrtC = arr sqrtC + tanhC = arr tanh -- powC = arr powC #endif @@ -1733,6 +1734,7 @@ instance FloatingCat U2 a where cosC = U2 sinC = U2 sqrtC = U2 + tanhC = U2 -- powC = U2 instance (FloatingCat k a, FloatingCat k' a) => FloatingCat (k :**: k') a where @@ -1741,11 +1743,13 @@ instance (FloatingCat k a, FloatingCat k' a) => FloatingCat (k :**: k') a where cosC = cosC :**: cosC sinC = sinC :**: sinC sqrtC = sqrtC :**: sqrtC + tanhC = tanhC :**: tanhC PINLINER(expC) PINLINER(logC) PINLINER(cosC) PINLINER(sinC) PINLINER(sqrtC) + PINLINER(tanhC) -- powC = powC :**: powC -- PINLINER(powC) @@ -1815,7 +1819,7 @@ class BottomCat k a b where -- bottomC = bottomC &&& bottomC instance (BottomCat k a b, ClosedCat k, Ok4 k z b a (z -> b)) => BottomCat k a (z -> b) where - bottomC = curry (bottomC . exl) <+ okProd @k @a @ z + bottomC = curry (bottomC . exl) <+ okProd @k @a @z instance BottomCat (->) a b where bottomC = error "bottomC for (->) evaluated" @@ -2075,7 +2079,7 @@ class ({- Pointed h, -} OkFunctor k h, Ok k a) => PointedCat k h a where -- class (Ok k a, Num a) => SumCat k h a where -- sumC :: h a `k` a -class (Ok k a, Additive a) => AddCat k h a where +class Ok k a => AddCat k h a where sumAC :: h a `k` a -- class IxSummable n => IxSummableCat k n where @@ -2330,7 +2334,7 @@ instance OkIxProd (->) h where okIxProd = Entail (Sub Dict) instance Zip h => IxMonoidalPCat (->) h where crossF = zipWith id -- 2018-02-07 notes - {-# OPINLINE crossF #-} + {-# INLINE crossF #-} instance (Representable h, Zip h, Pointed h) => IxProductCat (->) h where exF = tabulate (flip index) diff --git a/classes/src/ConCat/Experimental/A.hs b/classes/src/ConCat/Experimental/A.hs index 846a12e4b..346afa19e 100644 --- a/classes/src/ConCat/Experimental/A.hs +++ b/classes/src/ConCat/Experimental/A.hs @@ -56,7 +56,7 @@ import Data.Constraint (Dict(..),(:-)(..),refl,trans,(\\)) -- import Data.Key -- import Data.IntMap () -import ConCat.Misc (Yes1,type (&+&),inNew,inNew2,oops,type (+->)(..)) +import ConCat.Misc (Yes1,type (&+&),inNew,inNew2,type (+->)(..)) -- import ConCat.Free.VectorSpace -- import ConCat.Free.LinearRow (lapplyL,OkLF,idL,compL,exlL,exrL,forkL,inlL,inrL,joinL,HasL(..)) -- import ConCat.Rep diff --git a/classes/src/ConCat/Misc.hs b/classes/src/ConCat/Misc.hs index 39ed8f016..5232a32e6 100644 --- a/classes/src/ConCat/Misc.hs +++ b/classes/src/ConCat/Misc.hs @@ -21,7 +21,7 @@ -- | Miscellany -module ConCat.Misc where +module ConCat.Misc(module ConCat.Misc, oops) where import GHC.Types (Constraint) @@ -34,12 +34,12 @@ import Data.Monoid (Endo(..)) import Data.Semigroup (Semigroup(..)) import Data.Complex (Complex) import GHC.Generics hiding (R) --- import Unsafe.Coerce (unsafeCoerce) -- for oops -import GHC.Stack (errorWithStackTrace) -- for oops import GHC.TypeLits import Control.Newtype.Generics +import ConCat.Oops + {-------------------------------------------------------------------- Type abbreviations ------------------------------------------------------------------- @@ -257,11 +257,6 @@ data PseudoFun = PseudoFun { pseudoArgs :: Int } deriving (Typeable,Data) -- pseudoFun :: Int -> PseudoFun -- pseudoFun = PseudoFun --- | Pseudo function to fool GHC's divergence checker. -oops :: String -> b -oops str = errorWithStackTrace ("Oops: "++str) -{-# NOINLINE oops #-} - -- In the use of ‘errorWithStackTrace’ (imported from GHC.Stack): -- Deprecated: "'error' appends the call stack now" diff --git a/classes/src/ConCat/Oops.hs b/classes/src/ConCat/Oops.hs new file mode 100644 index 000000000..f12c56b87 --- /dev/null +++ b/classes/src/ConCat/Oops.hs @@ -0,0 +1,11 @@ +{-# OPTIONS_GHC -O0 -fno-strictness #-} +module ConCat.Oops(oops) where + +-- Both -O0 -fno-strictness are necessary to keep ghc 9 from +-- discovering that this bombs. + +-- | Pseudo function to fool GHC's divergence checker. +oops :: String -> b +oops str = error ("Oops: "++str) +{-# NOINLINE oops #-} + diff --git a/examples/concat-examples.cabal b/examples/concat-examples.cabal index 60f6147be..a063bc135 100644 --- a/examples/concat-examples.cabal +++ b/examples/concat-examples.cabal @@ -61,7 +61,6 @@ library , concat-inline , concat-known , concat-classes - , concat-plugin if flag(smt) build-depends: z3 cpp-options: -DCONCAT_SMT @@ -114,70 +113,6 @@ library ghc-options: -O2 cpp-options: -DVectorSized --- Stack apparently only allows per-package flags, not per-component, so the --- whole library gets recompiled. For now, duplicate the test-suite. See --- - -Test-Suite misc-examples - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: Examples.hs - other-modules: Miscellany - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , distributive, adjunctions - , constraints >= 0.8 - -- Array/vector experiments - , finite-typelits, vector-sized >= 1.0.0.0 - ghc-options: -O2 - -fplugin=ConCat.Plugin - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - -Test-Suite misc-trace - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: Examples.hs - other-modules: Miscellany - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , keys - , distributive, adjunctions - , constraints >= 0.8 - -- Array/vector experiments - , finite-typelits, vector-sized - ghc-options: -O2 - -fplugin=ConCat.Plugin - -fplugin-opt=ConCat.Plugin:trace - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - -- Test-Suite testHasFins -- type: exitcode-stdio-1.0 -- default-language: Haskell98 @@ -189,58 +124,3 @@ Test-Suite misc-trace -- , concat-examples -- , concat-classes -- , ghc-typelits-knownnat - -Test-Suite gold-tests - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: GoldTests.hs - other-modules: BasicTests, Miscellany, Utils - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , vector - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , distributive, adjunctions - , constraints >= 0.8 - , bytestring - , tasty - , tasty-golden - -- Array/vector experiments - , finite-typelits, vector-sized >= 1.0.0.0 - ghc-options: -O2 - -fplugin=ConCat.Plugin --- -fplugin-opt=ConCat.Plugin:showCcc --- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - --- executable ad_rev --- hs-source-dirs: app --- main-is: ad_rev.lhs --- build-depends: base >= 4.7 && < 5 --- , optparse-generic --- , concat-classes --- , concat-examples --- , concat-plugin --- default-language: Haskell2010 --- ghc-options: -O2 --- -funbox-strict-fields --- -threaded --- -optc-ffast-math --- -optc-O3 --- -- -fplugin=ConCat.Plugin --- -- -fplugin-opt=ConCat.Plugin:trace --- -- -fplugin-opt=ConCat.Plugin:maxSteps=200 --- -- -fforce-recomp - diff --git a/examples/src/ConCat/ADFun.hs b/examples/src/ConCat/ADFun.hs index 4d0d4fb24..cf1b97d8d 100644 --- a/examples/src/ConCat/ADFun.hs +++ b/examples/src/ConCat/ADFun.hs @@ -31,7 +31,7 @@ import Data.Constraint hiding ((&&&),(***),(:=>)) import Data.Distributive (Distributive(..)) import Data.Functor.Rep (Representable(..)) -import ConCat.Misc ((:*),R,Yes1,oops,unzip,type (&+&),sqr,result) +import ConCat.Misc ((:*),R,Yes1,unzip,type (&+&),sqr,result) import ConCat.Rep (repr) import ConCat.Free.VectorSpace (HasV(..),inV,IsScalar) import ConCat.Free.LinearRow -- hiding (linear) diff --git a/examples/src/ConCat/Choice.hs b/examples/src/ConCat/Choice.hs index aae50a051..65d4d5510 100644 --- a/examples/src/ConCat/Choice.hs +++ b/examples/src/ConCat/Choice.hs @@ -39,7 +39,7 @@ import Data.Pointed (Pointed) import Data.Distributive (Distributive) import Data.Functor.Rep (Representable) -import ConCat.Misc ((:*),oops,inNew,inNew2) +import ConCat.Misc ((:*),inNew,inNew2) import ConCat.Category import ConCat.AltCat (toCcc,unCcc) diff --git a/examples/src/ConCat/Circuit.hs b/examples/src/ConCat/Circuit.hs index 7fe0e7825..813bc2d52 100644 --- a/examples/src/ConCat/Circuit.hs +++ b/examples/src/ConCat/Circuit.hs @@ -42,9 +42,7 @@ {-# LANGUAGE LiberalTypeSynonyms, ImpredicativeTypes, EmptyDataDecls #-} #endif -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) {-# LANGUAGE NoStarIsType #-} -#endif {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- for OkayArr @@ -361,7 +359,9 @@ type GS a = (GenBuses a, Show a) genBus :: (Source -> Buses a) -> Ty -> Template u v -> [Source] -> BusesM (Buses a) -genBus wrap t templ ins = seq (show t) $ -- * [Note seq] +-- Without this @seq (show t)@, I'm getting non-termination with +-- `id @(Vector 4 Bool :* Bool)`. I don't know why @seq t@ isn't enough. +genBus wrap t templ ins = seq (show t) $ -- seq t $ -- trace ("genBus " ++ show t) $ do o <- M.get @@ -369,8 +369,6 @@ genBus wrap t templ ins = seq (show t) $ -- * [Note seq] M.put (o+1) return (wrap src) --- [Note seq]: Without this seq, I'm getting non-termination with --- `id @(Vector 4 Bool :* Bool)`. I don't know why. seq t isn't enough. unflattenB :: GenBuses a => [Source] -> Buses a unflattenB sources | [] <- rest = a @@ -534,7 +532,7 @@ convertB a = mkConvertB a -- Make a ConvertB if source and target types differ; otherwise id mkConvertB :: forall a b. Ok2 (:>) a b => Buses a -> Buses b -mkConvertB a -- | Just Refl <- eqT @a @b = a +mkConvertB a -- \| Just Refl <- eqT @a @b = a | otherwise = ConvertB a {-------------------------------------------------------------------- diff --git a/examples/src/ConCat/Dual.hs b/examples/src/ConCat/Dual.hs index 1f16bcc15..3949ce093 100644 --- a/examples/src/ConCat/Dual.hs +++ b/examples/src/ConCat/Dual.hs @@ -1,5 +1,6 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TupleSections #-} @@ -224,7 +225,7 @@ instance (PointedCat k h a, Additive a) => AddCat (Dual k) h a where sumAC = abst pointC {-# INLINE sumAC #-} -instance (AddCat k h a, OkF k h) => PointedCat (Dual k) h a where +instance (AddCat k h a, Additive a, OkF k h) => PointedCat (Dual k) h a where pointC = abst sumAC {-# INLINE pointC #-} diff --git a/examples/src/ConCat/GAD.hs b/examples/src/ConCat/GAD.hs index 85bced341..8c2138a4b 100644 --- a/examples/src/ConCat/GAD.hs +++ b/examples/src/ConCat/GAD.hs @@ -248,12 +248,14 @@ instance (ScalarCat k s, Ok k s, Floating s) => FloatingCat (GD k) s where logC = scalarX log recip sinC = scalarX sin cos cosC = scalarX cos (negate . sin) - sqrtC = scalarX sqrt (recip . scale 2 . sqrt) + sqrtC = scalarR sqrt (recip . scale 2) + tanhC = scalarR tanh ((-) 1 . sqr) {-# INLINE expC #-} {-# INLINE sinC #-} {-# INLINE cosC #-} {-# INLINE logC #-} {-# INLINE sqrtC #-} + {-# INLINE tanhC #-} -- TODO: experiment with moving some of these dual derivatives to DualAdditive, -- in the style of addD, mulD, etc. diff --git a/examples/src/ConCat/Nat.hs b/examples/src/ConCat/Nat.hs index 83363d323..207020808 100644 --- a/examples/src/ConCat/Nat.hs +++ b/examples/src/ConCat/Nat.hs @@ -2,10 +2,8 @@ {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} -- see comment -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) -- Needed to define (*) as a type family {-# LANGUAGE NoStarIsType #-} -#endif {-# OPTIONS_GHC -Wall #-} diff --git a/examples/src/ConCat/StackVM.hs b/examples/src/ConCat/StackVM.hs index 92b5d2270..9ad118cd5 100644 --- a/examples/src/ConCat/StackVM.hs +++ b/examples/src/ConCat/StackVM.hs @@ -58,8 +58,8 @@ evalStackFun (SF f) = rcounit . f . runit instance Category StackFun where id = stackFun id - -- SF g . SF f = SF (g . f) - (.) = inSF2 (.) + SF g . SF f = SF (g . f) + -- (.) = inSF2 (.) {-# INLINE id #-} {-# INLINE (.) #-} @@ -70,9 +70,9 @@ instance AssociativePCat StackFun where {-# INLINE rassocP #-} instance MonoidalPCat StackFun where - first = inSF inRassocP -- okay + -- first = inSF inRassocP -- okay -- first (SF f) = SF (inRassocP f) - -- first (SF f) = SF (lassocP . f . rassocP) + first (SF f) = SF (lassocP . f . rassocP) -- first (SF f) = SF lassocP . SF f . SF rassocP -- doesn't type-check second = secondFirst f *** g = second g . first f diff --git a/examples/src/ConCat/TArr.hs b/examples/src/ConCat/TArr.hs index fea08629d..1c988c1a0 100644 --- a/examples/src/ConCat/TArr.hs +++ b/examples/src/ConCat/TArr.hs @@ -17,10 +17,7 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} - -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) {-# LANGUAGE NoStarIsType #-} -#endif {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -Wno-unused-imports #-} -- TEMP @@ -45,7 +42,9 @@ import Prelude hiding (id, (.), const, curry, uncurry) -- Coming from ConCat.Al import Data.Monoid import Data.Foldable import GHC.TypeLits +#if !MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) import GHC.Types (Nat) +#endif import GHC.Generics (U1(..),Par1(..),(:*:)(..),(:.:)(..)) import GHC.Exts (Coercible,coerce) diff --git a/examples/test/gold/add-adf-syn.golden b/examples/test/gold/add-adf-syn.golden deleted file mode 100644 index 9caeaff7a..000000000 --- a/examples/test/gold/add-adf-syn.golden +++ /dev/null @@ -1 +0,0 @@ -(addC *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/add-adr-syn.golden b/examples/test/gold/add-adr-syn.golden deleted file mode 100644 index 2fa401b56..000000000 --- a/examples/test/gold/add-adr-syn.golden +++ /dev/null @@ -1,2 +0,0 @@ -((exl . id *** coerce . exr . id) . dup) . -(addC *** coerce . coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/add-gradr-syn.golden b/examples/test/gold/add-gradr-syn.golden deleted file mode 100644 index d80989f5a..000000000 --- a/examples/test/gold/add-gradr-syn.golden +++ /dev/null @@ -1,4 +0,0 @@ -((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . - dup) . -(addC *** coerce . coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/complex-mul-a-dot.golden b/examples/test/gold/complex-mul-a-dot.golden deleted file mode 100644 index 35bf7958d..000000000 --- a/examples/test/gold/complex-mul-a-dot.golden +++ /dev/null @@ -1,31 +0,0 @@ -digraph complex_mul { - margin=0 - compound=true - rankdir=LR - node [shape=Mrecord] - edge [fontsize=8,fontcolor=indigo] - bgcolor=transparent - nslimit=20 - c0 [label="{In|{|||}}"] - c28 [label="{{|}|\|{}}"] - c29 [label="{{|}|\|{}}"] - c30 [label="{{|}|\|{}}"] - c31 [label="{{|}|\|{}}"] - c32 [label="{{|}|\|{}}"] - c33 [label="{{|}|+|{}}"] - c34 [label="{{|}|Out}"] - c0:Out0 -> c28:In0 [label="Double"] - c0:Out2 -> c28:In1 [label="Double"] - c0:Out1 -> c29:In0 [label="Double"] - c0:Out3 -> c29:In1 [label="Double"] - c28:Out0 -> c30:In0 [label="Double"] - c29:Out0 -> c30:In1 [label="Double"] - c0:Out0 -> c31:In0 [label="Double"] - c0:Out3 -> c31:In1 [label="Double"] - c0:Out1 -> c32:In0 [label="Double"] - c0:Out2 -> c32:In1 [label="Double"] - c31:Out0 -> c33:In0 [label="Double"] - c32:Out0 -> c33:In1 [label="Double"] - c30:Out0 -> c34:In0 [label="Double"] - c33:Out0 -> c34:In1 [label="Double"] -} diff --git a/examples/test/gold/complex-mul-a-syn.golden b/examples/test/gold/complex-mul-a-syn.golden deleted file mode 100644 index 3a2c72e13..000000000 --- a/examples/test/gold/complex-mul-a-syn.golden +++ /dev/null @@ -1,21 +0,0 @@ -apply . -(curry - (apply . - (curry - (abst . - ((subC . - (mulC . (exl . exr . exl *** exl . exr) . dup *** - mulC . (exr . exr . exl *** exr . exr) . dup) . - dup *** - addC . - (mulC . (exl . exr . exl *** exr . exr) . dup *** - mulC . (exr . exr . exl *** exl . exr) . dup) . - dup) . - dup) . - ((id *** repr . exr . exl) . dup) . (id *** repr . exl) . dup) . - exl *** - exr) . - dup) . - exl *** - exr) . -dup \ No newline at end of file diff --git a/examples/test/gold/cosSinProd-adr-dot.golden b/examples/test/gold/cosSinProd-adr-dot.golden deleted file mode 100644 index 20ff96c04..000000000 --- a/examples/test/gold/cosSinProd-adr-dot.golden +++ /dev/null @@ -1,46 +0,0 @@ -digraph cosSinProd_adr { - margin=0 - compound=true - rankdir=LR - node [shape=Mrecord] - edge [fontsize=8,fontcolor=indigo] - bgcolor=transparent - nslimit=20 - subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } - subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|\|{}}"] } - subgraph clusterc297 { label=""; color=white; margin=0; c297 [label="{{}|sin|{}}"] } - subgraph clusterc352 { label=""; color=white; margin=0; c352 [label="{{}|cos|{}}"] } - subgraph cluster_484 { - margin=8 - fontsize=20 - labeljust=r - color=DarkGreen - c482 [label="{{|}|\|{}}"] - c481 [label="{{|}|\|{}}"] - c477 [label="{{|}|\|{}}"] - c479 [label="{{|}|\|{}}"] - c480 [label="{{|}|\|{}}"] - c476 [label="{In|{|}}"] - c483 [label="{{|}|Out}"] - c0:Out0 -> c482:In0 [label="Double"] - c480:Out0 -> c482:In1 [label="Double"] - c0:Out1 -> c481:In0 [label="Double"] - c480:Out0 -> c481:In1 [label="Double"] - c297:Out0 -> c477:In0 [label="Double"] - c476:Out0 -> c477:In1 [label="Double"] - c352:Out0 -> c479:In0 [label="Double"] - c476:Out1 -> c479:In1 [label="Double"] - c479:Out0 -> c480:In0 [label="Double"] - c477:Out0 -> c480:In1 [label="Double"] - c481:Out0 -> c483:In0 [label="Double"] - c482:Out0 -> c483:In1 [label="Double"] - } - subgraph clusterc485 { label=""; color=white; margin=0; c485 [label="{{||}|Out}"] } - c0:Out0 -> c1:In0 [label="Double"] - c0:Out1 -> c1:In1 [label="Double"] - c1:Out0 -> c297:In0 [label="Double"] - c1:Out0 -> c352:In0 [label="Double"] - c352:Out0 -> c485:In0 [label="Double"] - c297:Out0 -> c485:In1 [label="Double"] - c483 -> c485:In2 [ltail=cluster_484,label="Double Double Double Double"] -} diff --git a/examples/test/gold/cosSinProd-adr-syn.golden b/examples/test/gold/cosSinProd-adr-syn.golden deleted file mode 100644 index ac798d448..000000000 --- a/examples/test/gold/cosSinProd-adr-syn.golden +++ /dev/null @@ -1,86 +0,0 @@ -((exl . id *** repr . exr . id) . dup) . -second repr . -apply . -((curry - ((exl . exr *** - apply . - (curry - (abst . - apply . - (curry (abst . apply . (exl *** repr . exr) . dup) . - curry - (curry - (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . repr . exr *** - exl) . - dup) . - repr . exr . exr *** - abst . - apply . - ((curry (abst . apply . (exl *** repr . exr) . dup) . - curry - (curry - (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . repr *** - abst . curry (addC . exr)) . - dup) . - exr . exl) . - dup) . - dup) *** - apply . - ((curry - (apply . - (curry - (((exr *** exr . exl) . dup *** - apply . - (curry (abst . apply . (exl *** repr . exr) . dup) . - curry (abst . apply . (exl *** repr . exr) . dup) . - curry - (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . - repr . - abst . - abst . - curry mulC . - apply . - (curry exl . negateC . sinC . exl . exl . exl *** exr) . dup *** - abst . - abst . - curry mulC . - apply . (curry exl . cosC . exr . exl . exl *** exr . exl) . dup) . - dup) . - dup) *** - cosC . exl . exl) . - dup) *** - sinC . exr) . - dup) . - dup . exl) . - dup) . -(mulC *** - apply . - (curry - (abst . - apply . - (curry (abst . apply . (exl *** repr . exr) . dup) . - curry - (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . - apply . - (curry (abst . apply . (exl *** repr . exr) . dup) . - curry - (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . repr . exl *** - repr . exr) . - dup *** - abst . curry (dup . exr)) . - dup) . - abst . abst . curry mulC . exr *** - abst . abst . curry mulC . exl) . - dup) . -dup \ No newline at end of file diff --git a/examples/test/gold/sin-adf-syn.golden b/examples/test/gold/sin-adf-syn.golden deleted file mode 100644 index a44bc2875..000000000 --- a/examples/test/gold/sin-adf-syn.golden +++ /dev/null @@ -1,8 +0,0 @@ -second coerce . -apply . -(curry - ((exr *** - coerce . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . - dup) *** - sinC) . -dup \ No newline at end of file diff --git a/examples/test/gold/sin-adr-syn.golden b/examples/test/gold/sin-adr-syn.golden deleted file mode 100644 index 3f3b4733a..000000000 --- a/examples/test/gold/sin-adr-syn.golden +++ /dev/null @@ -1,9 +0,0 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . -apply . -(curry - ((exr *** - coerce . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . - dup) *** - sinC) . -dup \ No newline at end of file diff --git a/examples/test/gold/sin-gradr-syn.golden b/examples/test/gold/sin-gradr-syn.golden deleted file mode 100644 index 98bc1f00e..000000000 --- a/examples/test/gold/sin-gradr-syn.golden +++ /dev/null @@ -1,11 +0,0 @@ -((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . - dup) . -second coerce . -apply . -(curry - ((exr *** - coerce . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . - dup) *** - sinC) . -dup \ No newline at end of file diff --git a/examples/test/gold/twice-adf-syn.golden b/examples/test/gold/twice-adf-syn.golden deleted file mode 100644 index 79a321f17..000000000 --- a/examples/test/gold/twice-adf-syn.golden +++ /dev/null @@ -1,3 +0,0 @@ -(addC . dup *** - coerce . coerce . curry (addC . apply) . coerce . coerce . curry (dup . exr)) . -dup \ No newline at end of file diff --git a/examples/test/gold/twice-adr-syn.golden b/examples/test/gold/twice-adr-syn.golden deleted file mode 100644 index adbeb5773..000000000 --- a/examples/test/gold/twice-adr-syn.golden +++ /dev/null @@ -1,24 +0,0 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . -apply . -((curry - ((exl . exr *** - apply . - (coerce . - curry - (apply . - (coerce . - curry (apply . (exl *** coerce . exr) . dup) . - curry - (curry - (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . - dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((addC *** coerce . coerce . curry (dup . exr)) . dup) . exl) . - dup) . -(dup *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/twice-gradr-syn.golden b/examples/test/gold/twice-gradr-syn.golden deleted file mode 100644 index dbc86ad3a..000000000 --- a/examples/test/gold/twice-gradr-syn.golden +++ /dev/null @@ -1,26 +0,0 @@ -((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . - dup) . -second coerce . -apply . -((curry - ((exl . exr *** - apply . - (coerce . - curry - (apply . - (coerce . - curry (apply . (exl *** coerce . exr) . dup) . - curry - (curry - (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . - dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((addC *** coerce . coerce . curry (dup . exr)) . dup) . exl) . - dup) . -(dup *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..87844c488 --- /dev/null +++ b/flake.lock @@ -0,0 +1,174 @@ +{ + "nodes": { + "bash-strict-mode": { + "inputs": { + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "shellcheck-nix-attributes": "shellcheck-nix-attributes" + }, + "locked": { + "lastModified": 1674014107, + "narHash": "sha256-UgrmDzeSp+li0/wtn0zRZicqy2595bUftW1bMBfP+5Y=", + "owner": "sellout", + "repo": "bash-strict-mode", + "rev": "da573e33174d7078e62eb2a9d9eb7d662e5b4913", + "type": "github" + }, + "original": { + "owner": "sellout", + "repo": "bash-strict-mode", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "bash-strict-mode", + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1672244468, + "narHash": "sha256-xaZb8AZqoXRCSqPusCk4ouf+fUNP8UJdafmMTF1Ltlw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "89a8ba0b5b43b3350ff2e3ef37b66736b2ef8706", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.11", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils_2" + }, + "locked": { + "lastModified": 1676257154, + "narHash": "sha256-eW3jymNLpdxS5fkp9NWKyNtgL0Gqtgg1vCTofKXDF1g=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2cb27c79117a2a75ff3416c3199a2dc57af6a527", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1676817468, + "narHash": "sha256-ovuJ1jQOC2/EEibufBkXmSN/O9mLx80Wh7aDmHmHAhA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cf4274b5d06325bd16dbf879a30981bc283e58a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "bash-strict-mode": "bash-strict-mode", + "flake-utils": "flake-utils_2", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs" + } + }, + "shellcheck-nix-attributes": { + "flake": false, + "locked": { + "lastModified": 1586929030, + "narHash": "sha256-a0WyWaz+nMYFWI43Ip9EUnPuBW0O4EIiTzYZKGqNjss=", + "owner": "Fuuzetsu", + "repo": "shellcheck-nix-attributes", + "rev": "51b49d5fe65ece69eb5e2003396bf096083ec281", + "type": "github" + }, + "original": { + "owner": "Fuuzetsu", + "repo": "shellcheck-nix-attributes", + "type": "github" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..e52d48212 --- /dev/null +++ b/flake.nix @@ -0,0 +1,203 @@ +{ + description = "Compiling to categories"; + + nixConfig = { + ## https://github.com/NixOS/rfcs/blob/master/rfcs/0045-deprecate-url-syntax.md + extra-experimental-features = ["no-url-literals"]; + extra-trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; + extra-trusted-substituters = ["https://cache.garnix.io"]; + ## Isolate the build. + registries = false; + sandbox = true; + }; + + outputs = inputs: let + pname = "concat"; + + defaultCompiler = "ghc902"; + supportedGhcVersions = [ + "ghc8107" + "ghc902" + "ghc924" + # These don’t work yet. + # "ghc942" + # "ghcHEAD" + ]; + # Haddock for `concat-inline` currently fails with + # + # During interactive linking, GHCi couldn't find the following symbol: + # concatzminlinezm0zi1zi0zi0zmLozzNZZOi9JbQLBJ6XV1cRbO_ConCatziInlineziPlugin_plugin_closure + noHaddockPackages = ["concat-inline"]; + + cabalPackages = pkgs: hpkgs: + inputs.nixpkgs.lib.concatMapAttrs + (name: value: { + "${name}" = + if builtins.elem name noHaddockPackages + then pkgs.haskell.lib.dontHaddock value + else value; + }) + (inputs.self.lib.cabalProject2nix ./cabal.project pkgs hpkgs (old: old)); + in + { + overlays = { + default = + inputs.self.lib.overlayHaskellPackages + supportedGhcVersions + inputs.self.overlays.haskell; + + haskell = inputs.self.lib.haskellOverlay cabalPackages; + + ## Only needed if you are using `concat-hardware`. + netlist-default = + inputs.self.lib.overlayHaskellPackages + supportedGhcVersions + inputs.self.overlays.netlist-haskell; + + netlist-haskell = import ./nix/netlist-overlay.nix; + }; + + homeConfigurations = + builtins.listToAttrs + (builtins.map + (system: { + name = "${system}-example"; + value = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [inputs.self.overlays.default]; + }; + + modules = [ + ({pkgs, ...}: { + home.packages = [ + (pkgs.haskellPackages.ghcWithPackages (hpkgs: [ + hpkgs.concat-plugin + ])) + ]; + + ## These attributes are simply required by home-manager. + home = { + homeDirectory = /tmp/${pname}-example; + stateVersion = "22.11"; + username = "${pname}-example-user"; + }; + }) + ]; + }; + }) + inputs.flake-utils.lib.defaultSystems); + + ## TODO: Pull this into its own flake, for use across Haskell projects. + lib = import ./nix/lib.nix {inherit (inputs) bash-strict-mode nixpkgs;}; + } + // inputs.flake-utils.lib.eachSystem inputs.flake-utils.lib.allSystems (system: let + pkgs = import inputs.nixpkgs { + inherit system; + ## NB: This uses `inputs.self.overlays.default` because packages need to + ## be able to find other packages in this flake as dependencies. + overlays = [ + inputs.self.overlays.netlist-default + inputs.self.overlays.default + ]; + }; + in { + packages = + {default = inputs.self.packages.${system}."${defaultCompiler}_all";} + // inputs.self.lib.mkPackages pkgs supportedGhcVersions cabalPackages; + + devShells = + {default = inputs.self.devShells.${system}.${defaultCompiler};} + // inputs.self.lib.mkDevShells pkgs supportedGhcVersions cabalPackages + (hpkgs: + [ + hpkgs.cabal-install + pkgs.graphviz + ] + # Haskell Language Server doesn’t support all GHC versions. + ++ pkgs.lib.optional + (!(builtins.elem hpkgs.ghc.version ["8107" "924"])) + hpkgs.haskell-language-server); + + checks = { + nix-fmt = + inputs.bash-strict-mode.lib.checkedDrv pkgs + (pkgs.stdenv.mkDerivation { + src = pkgs.lib.cleanSource ./.; + + name = "nix fmt"; + + nativeBuildInputs = [inputs.self.formatter.${system}]; + + buildPhase = '' + runHook preBuild + alejandra --check . + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out" + runHook preInstall + ''; + }); + }; + + ## TODO: Move these functions to the lib. + apps = let + ## Define a single entry for flake `apps` from the path in the Nix store + ## for a Cabal package and executable defined in that package. + cabalApp = package: executable: { + program = "${inputs.self.packages.${system}."${defaultCompiler}_${package}"}/bin/${executable}"; + type = "app"; + }; + + ## Given a path in the Nix store for a Cabal package and a list of + ## executables defined in the Cabal package, creates an AttrSet of apps, + ## one per listed executable. + ## + ## TODO: Somehow extract this, if possible, from `callCabal2nix` result. + cabalApps = package: executables: + builtins.listToAttrs + (map (exe: { + name = exe; + value = cabalApp package exe; + }) + executables); + + ## Given an AttrSet with the keys being paths in the Nix store for Cabal + ## packages and the values being lists of executables defined in that + ## Cabal package, creates an AttrSet of apps, one per listed executable. + ## + ## TODO: Somehow extract this, if possible, from `cabalProject2nix` + ## result. + cabalProjectApps = pkgs.lib.concatMapAttrs cabalApps; + in + cabalProjectApps { + concat-graphics = ["graphics-examples" "graphics-trace"]; + concat-hardware = ["hardware-examples" "hardware-trace"]; + concat-plugin = ["misc-examples" "misc-trace"]; + }; + + # Nix code formatter, https://github.com/kamadorueda/alejandra#readme + formatter = pkgs.alejandra; + }); + + inputs = { + bash-strict-mode = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:sellout/bash-strict-mode"; + }; + + flake-utils.url = "github:numtide/flake-utils"; + + home-manager = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:nix-community/home-manager/release-22.11"; + }; + + nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + }; +} diff --git a/garnix.yaml b/garnix.yaml new file mode 100644 index 000000000..90461e428 --- /dev/null +++ b/garnix.yaml @@ -0,0 +1,8 @@ +builds: + exclude: [] + include: + - '*.aarch64-darwin.*' + - '*.aarch64-darwin' + - '*.x86_64-linux.*' + - '*.x86_64-linux' + - 'nixosConfigurations.*' diff --git a/graphics/concat-graphics.cabal b/graphics/concat-graphics.cabal index 98f6e0154..fb4cd42c5 100644 --- a/graphics/concat-graphics.cabal +++ b/graphics/concat-graphics.cabal @@ -35,8 +35,7 @@ library , text >= 1.2.2.1 default-language: Haskell2010 -test-suite graphics-examples - type: exitcode-stdio-1.0 +executable graphics-examples hs-source-dirs: test main-is: Examples.hs build-depends: base @@ -54,8 +53,7 @@ test-suite graphics-examples default-language: Haskell2010 ghc-options: -fplugin=ConCat.Plugin -test-suite graphics-trace - type: exitcode-stdio-1.0 +executable graphics-trace hs-source-dirs: test main-is: Examples.hs build-depends: base diff --git a/graphics/src/ConCat/Graphics/Color.hs b/graphics/src/ConCat/Graphics/Color.hs index a85dff09a..e9f0fc7b2 100644 --- a/graphics/src/ConCat/Graphics/Color.hs +++ b/graphics/src/ConCat/Graphics/Color.hs @@ -1,6 +1,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -Wall #-} diff --git a/hardware/concat-hardware.cabal b/hardware/concat-hardware.cabal index a7181bc6c..2b2743067 100644 --- a/hardware/concat-hardware.cabal +++ b/hardware/concat-hardware.cabal @@ -40,8 +40,7 @@ library default-language: Haskell2010 cpp-options: -DVectorSized -test-suite hardware-examples - type: exitcode-stdio-1.0 +executable hardware-examples hs-source-dirs: test main-is: Examples.hs build-depends: base @@ -63,8 +62,7 @@ test-suite hardware-examples default-language: Haskell2010 ghc-options: -fplugin=ConCat.Plugin -test-suite hardware-trace - type: exitcode-stdio-1.0 +executable hardware-trace hs-source-dirs: test main-is: Examples.hs build-depends: base @@ -86,4 +84,3 @@ test-suite hardware-trace default-language: Haskell2010 ghc-options: -fplugin=ConCat.Plugin -fplugin-opt=ConCat.Plugin:trace - diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 000000000..3140911c4 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,24 @@ +cradle: + cabal: + - component: "lib:concat-classes" + path: "./classes/src" + - component: "lib:concat-examples" + path: "./examples/src" + - component: "lib:concat-graphics" + path: "./graphics/src" + - component: "test:graphics-examples" + path: "./graphics/test" + - component: "lib:concat-hardware" + path: "./hardware/src" + - component: "test:hardware-examples" + path: "./hardware/test" + - component: "lib:concat-inline" + path: "./inline/src" + - component: "lib:concat-known" + path: "./known/src" + - component: "lib:concat-plugin" + path: "./plugin/src" + - component: "test:misc-examples" + path: "./plugin/test" + - component: "lib:concat-satisfy" + path: "./satisfy/src" diff --git a/inline/src/ConCat/Inline/Plugin.hs b/inline/src/ConCat/Inline/Plugin.hs index df58c7184..90e25c4ce 100644 --- a/inline/src/ConCat/Inline/Plugin.hs +++ b/inline/src/ConCat/Inline/Plugin.hs @@ -12,16 +12,25 @@ import qualified ConCat.Inline.ClassOp as CO import Data.List (elemIndex) -- GHC API +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import qualified GHC.Driver.Backend as Backend +import GHC.Types.TyThing (lookupId, lookupTyCon) +#endif +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import GHC.Core.Class (classAllSelIds) +import GHC.Plugins +import GHC.Types.Id.Make (mkDictSelRhs) +import GHC.Runtime.Loader +#else import GhcPlugins import Class (classAllSelIds) import MkId (mkDictSelRhs) import DynamicLoading +#endif plugin :: Plugin plugin = defaultPlugin { installCoreToDos = install -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) , pluginRecompile = purePlugin -#endif } install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] @@ -29,13 +38,15 @@ install _opts todos = do dflags <- getDynFlags -- Unfortunately, the plugin doesn't work in GHCi. Until fixed, -- disable under GHCi, so we can at least type-check conveniently. +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + if backend dflags == Backend.Interpreter then + return todos +#else if hscTarget dflags == HscInterpreted then return todos - else - do -#if !MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) - reinitializeGlobals #endif + else + do -- pprTrace "Install inlineClassOpRule" empty (return ()) let addRule :: ModGuts -> CoreM ModGuts addRule guts = @@ -67,7 +78,7 @@ inlineClassOp (collectArgs -> (Var v,rest)) = -- pprTrace "inlineClassOp class" (ppr cls) $ ((`mkCoreApps` rest) . mkDictSelRhs cls) <$> elemIndex v (classAllSelIds cls) -- Experiment - -- | Just e' <- maybeUnfoldingTemplate (realIdUnfolding v) + -- \| Just e' <- maybeUnfoldingTemplate (realIdUnfolding v) -- = pprTrace "inlining non-class-op to" (ppr e') $ -- Just e' inlineClassOp e = pprTrace "inlineClassOp failed/unnecessary" (ppr e) $ @@ -90,13 +101,9 @@ lookupRdr modu mkOcc mkThing str = where err = "lookupRdr: couldn't find " ++ str ++ " in " ++ moduleNameString modu -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) -- In GHC 8.6, lookupRdrNameInModuleForPlugins returns a (Name, Module) -- where earlier it was just a Name mkThing' = mkThing . fst -#else - mkThing' = mkThing -#endif lookupTh :: (String -> OccName) -> (Name -> CoreM a) -> String -> String -> CoreM a diff --git a/nix/concat-overlay.nix b/nix/concat-overlay.nix index aa9b8862a..cf75ae782 100644 --- a/nix/concat-overlay.nix +++ b/nix/concat-overlay.nix @@ -1,48 +1,26 @@ -self: super: -let - netlistSrc = super.fetchFromGitHub { - owner = "ku-fpg"; - repo = "netlist"; - rev = "0f50a9cfd947885cac7fc392a5295cffe0b3ac31"; - sha256 = "tg0UMslWZin6EeUbOruC9jt1xsgYIuk9vGi7uBSOUCw="; - fetchSubmodules = true; - }; -in { - haskellPackages = super.haskellPackages.override (old: { - overrides = super.lib.composeExtensions (old.overrides or (_: _: { })) - (hself: hsuper: - let - defaultMod = drv: - super.haskell.lib.disableLibraryProfiling - (super.haskell.lib.dontHaddock drv); - callCabal2nix = hself.callCabal2nix; - in { - # Prerequisites - netlist = - defaultMod (callCabal2nix "netlist" (netlistSrc + /netlist) { }); - verilog = - defaultMod (callCabal2nix "netlist" (netlistSrc + /verilog) { }); - netlist-to-verilog = defaultMod - (callCabal2nix "netlist" (netlistSrc + /netlist-to-verilog) { }); - netlist-to-vhdl = defaultMod - (callCabal2nix "netlist" (netlistSrc + /netlist-to-vhdl) { }); - - # ConCat packages - concat-known = defaultMod (callCabal2nix "concat-known" ../known { }); - concat-satisfy = - defaultMod (callCabal2nix "concat-satisfy" ../satisfy { }); - concat-inline = - defaultMod (callCabal2nix "concat-inline" ../inline { }); - concat-classes = - defaultMod (callCabal2nix "concat-classes" ../classes { }); - concat-plugin = - defaultMod (callCabal2nix "concat-plugin" ../plugin { }); - concat-examples = - defaultMod (callCabal2nix "concat-examples" ../examples { }); - concat-graphics = - defaultMod (callCabal2nix "concat-graphics" ../graphics { }); - concat-hardware = - defaultMod (callCabal2nix "concat-hardware" ../hardware { }); - }); - }); +self: super: { + haskellPackages = super.haskellPackages.extend (self.lib.composeExtensions + (import ./nix/netlist-overlay.nix self super) + (hself: hsuper: let + defaultMod = drv: + super.haskell.lib.disableLibraryProfiling + (super.haskell.lib.dontHaddock drv); + callCabal2nix = hself.callCabal2nix; + in { + concat-known = defaultMod (callCabal2nix "concat-known" ../known {}); + concat-satisfy = + defaultMod (callCabal2nix "concat-satisfy" ../satisfy {}); + concat-inline = + defaultMod (callCabal2nix "concat-inline" ../inline {}); + concat-classes = + defaultMod (callCabal2nix "concat-classes" ../classes {}); + concat-plugin = + defaultMod (callCabal2nix "concat-plugin" ../plugin {}); + concat-examples = + defaultMod (callCabal2nix "concat-examples" ../examples {}); + concat-graphics = + defaultMod (callCabal2nix "concat-graphics" ../graphics {}); + concat-hardware = + defaultMod (callCabal2nix "concat-hardware" ../hardware {}); + })); } diff --git a/nix/lib.nix b/nix/lib.nix new file mode 100644 index 000000000..9c52427dc --- /dev/null +++ b/nix/lib.nix @@ -0,0 +1,122 @@ +{ + bash-strict-mode, + nixpkgs, +}: let + # Reads the set of local packages from a cabal.project provided at the call + # site. + # + # Ideally, parsing cabal.project should be done via official tools + # Related discussion at NixOS/cabal2nix#286 + parseCabalProject = cabalProject: let + content = builtins.readFile cabalProject; + lines = nixpkgs.lib.splitString "\n" content; + matches = + builtins.map (builtins.match "^[[:space:]]*([.].*)/(.*)[.]cabal$") lines; + in + builtins.listToAttrs + (builtins.concatMap + (match: + if builtins.isList match && builtins.length match == 2 + then [ + { + name = builtins.elemAt match 1; + value = builtins.elemAt match 0; + } + ] + else []) + matches); +in { + inherit parseCabalProject; + + # A “Haskell overlay” is a function that takes the usual overlay arguments, + # but also takes a GHC version and then Haskell-specific final and prev + # arguments (suitable for passing to `haskell.packages.${ghc}.extend`). + # + # This function takes a (final: ghc: AttrSet of Haskell packages) and returns + # a Haskell overlay. + haskellOverlay = packages: final: prev: hfinal: hprev: packages final hfinal; + + # Produces a devShell for each supported GHC version. + # `nativeBuildInputs` is a function from a Haskell package set for a + # particular GHC version to a list of packages to include as native build + # inputs. + mkDevShells = pkgs: ghcVersions: packages: nativeBuildInputs: + builtins.listToAttrs + (builtins.map + (ghcVer: let + hpkgs = pkgs.haskell.packages.${ghcVer}; + in { + name = ghcVer; + value = + bash-strict-mode.lib.drv pkgs + (hpkgs.shellFor { + packages = _: builtins.attrValues (packages pkgs hpkgs); + nativeBuildInputs = nativeBuildInputs hpkgs; + withHoogle = false; + }); + }) + ghcVersions); + + # Produces a set of packages for each supported GHC version. + # + # _ = A package with only the one Cabal package + # _all = A package containing GHC will all Cabal packages installed + mkPackages = pkgs: ghcVersions: packages: + nixpkgs.lib.foldr + (a: b: a // b) + {} + (builtins.map + (ghcVer: let + hpkgs = pkgs.haskell.packages.${ghcVer}; + + ghcPackages = packages pkgs hpkgs; + + individualPackages = + nixpkgs.lib.concatMapAttrs + (name: value: {"${ghcVer}_${name}" = value;}) + ghcPackages; + in + individualPackages + // { + "${ghcVer}_all" = pkgs.buildEnv { + name = "all-packages"; + paths = [ + (hpkgs.ghcWithPackages (_: builtins.attrValues ghcPackages)) + ]; + }; + }) + ghcVersions); + + # Creates an overlay with `haskellOverlay` installed in + # `haskell.packages.` for each supported GHC version. + # + # `haskellOverlay` should be a function: + # + # final: prev: finalHaskPkgs: prevHaskPkgs: AttrSet + overlayHaskellPackages = ghcVersions: haskellOverlay: final: prev: { + haskell = + prev.haskell + // { + packages = + prev.haskell.packages + // builtins.listToAttrs + (builtins.map + (ghcVer: { + name = ghcVer; + value = + prev.haskell.packages.${ghcVer}.extend + (haskellOverlay final prev); + }) + ghcVersions); + }; + }; + + cabalProject2nix = cabalProject: pkgs: hpkgs: overrides: + builtins.mapAttrs + (name: path: + bash-strict-mode.lib.shellchecked pkgs + ((hpkgs.callCabal2nix name "${builtins.dirOf cabalProject}/${path}" {}) + .overrideAttrs + overrides)) + (parseCabalProject cabalProject); +} diff --git a/nix/netlist-overlay.nix b/nix/netlist-overlay.nix new file mode 100644 index 000000000..d76667398 --- /dev/null +++ b/nix/netlist-overlay.nix @@ -0,0 +1,16 @@ +final: prev: hfinal: hprev: let + netlistSrc = final.fetchFromGitHub { + owner = "ku-fpg"; + repo = "netlist"; + rev = "0f50a9cfd947885cac7fc392a5295cffe0b3ac31"; + sha256 = "tg0UMslWZin6EeUbOruC9jt1xsgYIuk9vGi7uBSOUCw="; + fetchSubmodules = true; + }; +in { + netlist = hfinal.callCabal2nix "netlist" (netlistSrc + /netlist) {}; + verilog = hfinal.callCabal2nix "netlist" (netlistSrc + /verilog) {}; + netlist-to-verilog = + hfinal.callCabal2nix "netlist" (netlistSrc + /netlist-to-verilog) {}; + netlist-to-vhdl = + hfinal.callCabal2nix "netlist" (netlistSrc + /netlist-to-vhdl) {}; +} diff --git a/nix/nixpkgs-pin.json b/nix/nixpkgs-pin.json index 661883407..f3807e20d 100644 --- a/nix/nixpkgs-pin.json +++ b/nix/nixpkgs-pin.json @@ -1,9 +1,10 @@ { "url": "https://github.com/nixos/nixpkgs.git", - "rev": "2bb5ff0da2fc8a37ffb81ffe99b8552bbe5abf83", - "date": "2021-02-17T20:18:30-08:00", - "path": "/nix/store/0cxsz0m41i37zr5mzcn0kp653ca3x4g8-nixpkgs-2bb5ff0", - "sha256": "1dslxrwh6y3dcjqxbnrfdcfyddjzvldzy6i6kz0lhgyf4i20jybk", + "rev": "5770984a958f52e58cb8350d28825d813630e19d", + "date": "2023-01-17T17:41:41+00:00", + "path": "/nix/store/zbzi1n2zf08k41kc7fi2plhf414d1b6n-nixpkgs-5770984", + "sha256": "1pl8gq4a6iydq5w382id8dzl1jj1p110sk3hnq84cp0v3bf026wd", + "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/nix/pinned-nixpkgs.nix b/nix/pinned-nixpkgs.nix index 79b0d2079..bb85b68bb 100644 --- a/nix/pinned-nixpkgs.nix +++ b/nix/pinned-nixpkgs.nix @@ -1,7 +1,7 @@ let - bootstrapPkgs = import { }; + bootstrapPkgs = import {}; # We create this by using `nix-prefetch-git`, for instance: - # nix-prefetch-git --rev foogitrev123 https://github.com/nixos/nixpkgs.git > ./.pinned-nixpkgs.json + # nix-prefetch-git --rev foogitrev123 https://github.com/nixos/nixpkgs.git > ./nixpkgs-pin.json # The command `nix-prefetch-git` itself can be installed via Nix as well. json = builtins.readFile ./nixpkgs-pin.json; nixpkgs = builtins.fromJSON json; @@ -10,4 +10,5 @@ let repo = "nixpkgs"; inherit (nixpkgs) rev sha256; }; -in src +in + src diff --git a/nix/pkgs.nix b/nix/pkgs.nix index b7380b740..3faab6cd7 100644 --- a/nix/pkgs.nix +++ b/nix/pkgs.nix @@ -1,5 +1,6 @@ let concatOverlay = import ./concat-overlay.nix; nixpkgsSrc = import ./pinned-nixpkgs.nix; - pkgs = import nixpkgsSrc { overlays = [ concatOverlay ]; }; -in pkgs + pkgs = import nixpkgsSrc {overlays = [concatOverlay];}; +in + pkgs diff --git a/plugin/concat-plugin.cabal b/plugin/concat-plugin.cabal index baffe004f..ab2548847 100644 --- a/plugin/concat-plugin.cabal +++ b/plugin/concat-plugin.cabal @@ -18,6 +18,10 @@ source-repository head type: git location: git://github.com/conal/concat +Flag smt + Description: Enable SMT + Default: False + library default-language: Haskell2010 hs-source-dirs: src @@ -42,3 +46,119 @@ library -- Do I want to depend on integer-gmp? Maybe conditionally depend on integer-gmp -- or integer-simple. + +-- Stack apparently only allows per-package flags, not per-component, so the +-- whole library gets recompiled. For now, duplicate the test-suite. See +-- + +Executable misc-examples + default-language: Haskell98 + hs-Source-Dirs: test + main-is: Examples.hs + other-modules: Miscellany + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , distributive, adjunctions + , constraints >= 0.8 + -- Array/vector experiments + , finite-typelits, vector-sized >= 1.0.0.0 + ghc-options: -O2 + -fplugin=ConCat.Plugin + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +Executable misc-trace + default-language: Haskell98 + hs-Source-Dirs: test + main-is: Examples.hs + other-modules: Miscellany + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , keys + , distributive, adjunctions + , constraints >= 0.8 + -- Array/vector experiments + , finite-typelits, vector-sized + ghc-options: -O2 + -fplugin=ConCat.Plugin + -fplugin-opt=ConCat.Plugin:trace + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +Test-Suite gold-tests + type: exitcode-stdio-1.0 + default-language: Haskell98 + hs-Source-Dirs: test + main-is: GoldTests.hs + other-modules: BasicTests, Miscellany, Utils + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , vector + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , distributive, adjunctions + , constraints >= 0.8 + , bytestring + , tasty + , tasty-golden + -- Array/vector experiments + , finite-typelits, vector-sized >= 1.0.0.0 + ghc-options: -O2 + -fplugin=ConCat.Plugin +-- -fplugin-opt=ConCat.Plugin:showCcc +-- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +-- executable ad_rev +-- hs-source-dirs: app +-- main-is: ad_rev.lhs +-- build-depends: base >= 4.7 && < 5 +-- , optparse-generic +-- , concat-classes +-- , concat-examples +-- , concat-plugin +-- default-language: Haskell2010 +-- ghc-options: -O2 +-- -funbox-strict-fields +-- -threaded +-- -optc-ffast-math +-- -optc-O3 +-- -- -fplugin=ConCat.Plugin +-- -- -fplugin-opt=ConCat.Plugin:trace +-- -- -fplugin-opt=ConCat.Plugin:maxSteps=200 +-- -- -fforce-recomp diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 94d979acb..cebbd7c1f 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -36,53 +36,107 @@ import qualified Data.Sequence as Seq import qualified Data.Set as OrdSet --import qualified Data.Map (Map) as OrdMap import qualified Data.Map as OrdMap -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) -import qualified UniqDFM as DFMap -#endif import Text.Printf (printf) import System.IO.Unsafe (unsafePerformIO) import Data.IORef +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import GHC.Builtin.Names (leftDataConName,rightDataConName + ,floatTyConKey,doubleTyConKey,integerTyConKey + ,intTyConKey,boolTyConKey + ,typeRepTyConName) +import GHC.Builtin.Types.Prim (intPrimTyCon) +import GHC.Core.Class (classAllSelIds) +-- For normaliseType etc +import GHC.Core.FamInstEnv +import GHC.Core.Lint (lintExpr) +import GHC.Utils.Error (pprMessageBag) +import GHC.Core.Opt.Arity (etaExpand) +import GHC.Core.SimpleOpt (simpleOptExpr) +import GHC.Core.TyCo.Rep +import GHC.Core.Type (coreView) +import GHC.Core.Coercion.Axiom +import GHC.Core.Coercion.Opt (optCoercion) +import GHC.Core.TyCo.Subst (emptyTCvSubst) +import GHC.Data.Pair (Pair(..), swap) +import GHC.Driver.Backend (Backend(..)) +import GHC.Plugins as GHC hiding (substTy,cat) +import GHC.Runtime.Loader +import GHC.Tc.Utils.TcType (isFloatTy,isDoubleTy,isIntegerTy,isIntTy,isBoolTy,isUnitTy + ,tcSplitTyConApp_maybe) +import GHC.Types.Id.Make (mkDictSelRhs,coerceId) +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import GHC.Types.TyThing (MonadThings(..)) +import GHC.Unit.External (eps_rule_base) +import GHC.Driver.Config (initSimpleOpts) +import GHC.Builtin.Uniques (mkBuiltinUnique) +import GHC.Driver.Config (initOptCoercionOpts) +#else +import GHC.Driver.Types (eps_rule_base) +import GHC.Types.Unique (mkBuiltinUnique) +#endif +import qualified GHC.Types.Unique.DFM as DFMap +#else import GhcPlugins as GHC hiding (substTy,cat) import Class (classAllSelIds) import CoreArity (etaExpand) import CoreLint (lintExpr) import DynamicLoading import MkId (mkDictSelRhs,coerceId) -import Pair (Pair(..)) +import Pair (Pair(..), swap) import PrelNames (leftDataConName,rightDataConName ,floatTyConKey,doubleTyConKey,integerTyConKey - ,intTyConKey,boolTyConKey) + ,intTyConKey,boolTyConKey + ,typeRepTyConName) import Type (coreView) import TcType (isFloatTy,isDoubleTy,isIntegerTy,isIntTy,isBoolTy,isUnitTy ,tcSplitTyConApp_maybe) import TysPrim (intPrimTyCon) -import FamInstEnv (normaliseType) +-- For normaliseType etc +import FamInstEnv #if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) import CoreOpt (simpleOptExpr) +import qualified UniqDFM as DFMap #endif import TyCoRep -import GHC.Classes import Unique (mkBuiltinUnique) --- For normaliseType etc -import FamInstEnv +import CoAxiom (coAxiomNthBranch, coAxBranchTyVars, coAxBranchRHS) +import OptCoercion (optCoercion) +import TyCoSubst (emptyTCvSubst) +#endif +import GHC.Classes import ConCat.Misc (Unop,Binop,Ternop,PseudoFun(..),(~>)) import ConCat.BuildDictionary -- import ConCat.Simplify --- GHC 8.10 FunTy as an extra operand -#if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) -pattern FunTy' a r <- - FunTy _ a r - +pattern FunCo' :: Role -> Coercion -> Coercion -> Coercion +mkFunCo' :: Role -> Coercion -> Coercion -> Coercion +pattern FunTy' :: Type -> Type -> Type mkFunTy' :: Type -> Type -> Type -mkFunTy' a b = FunTy VisArg a b +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +pattern FunCo' r a b <- FunCo r _ a b +mkFunCo' r = FunCo r (multToCo Many) +pattern FunTy' a r <- FunTy _ _ a r +mkFunTy' = FunTy VisArg Many +-- GHC 8.10 FunTy as an extra operand #else -pattern FunTy' a r = FunTy a r +pattern FunCo' r a b = FunCo r a b +mkFunCo' = FunCo +pattern FunTy' a r <- FunTy _ a r +mkFunTy' = FunTy VisArg +#endif -mkFunTy' :: Type -> Type -> Type -mkFunTy' a b = FunTy a b +#if !MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +pattern Alt :: AltCon -> [b] -> (Expr b) -> (AltCon, [b], Expr b) +pattern Alt con bs rhs = (con, bs, rhs) +#endif + +splitFunTy_maybe' :: Type -> Maybe (Type, Type) +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +splitFunTy_maybe' = fmap (\(_, a, b) -> (a, b)) . splitFunTy_maybe +#else +splitFunTy_maybe' = splitFunTy_maybe #endif -- Information needed for reification. We construct this info in @@ -121,10 +175,10 @@ data CccEnv = CccEnv { dtrace :: forall a. String -> SDoc -> a -> a -- , hasRepFromAbstCo :: Coercion -> CoreExpr , prePostV :: Id -- , lazyV :: Id -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) - , boxers :: DFMap.UniqDFM {- TyCo-} Id -- to remove +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + , boxers :: DFMap.UniqDFM TyCon Id -- to remove #else - , boxers :: OrdMap.Map TyCon Id + , boxers :: DFMap.UniqDFM Id -- to remove #endif , tagToEnumV :: Id , bottomV :: Id @@ -191,10 +245,10 @@ ccc (CccEnv {..}) (Ops {..}) cat = Trying("top flipForkT") -- f | pprTrace "flipForkT tests" -- (ppr ( splitFunTy (exprType f) - -- , second splitFunTy_maybe (splitFunTy (exprType f)) + -- , second splitFunTy_maybe' (splitFunTy (exprType f)) -- , not catClosed)) False = undefined f | z `FunTy` (a `FunTy` b) <- exprType f - , not catClosed + , not catClosed -> Doing("top flipForkT") -- pprTrace "flipForkT type" (ppr (varType flipForkTV)) $ return (onDicts (varApps flipForkTV [cat,z,a,b] []) `App` f) @@ -211,7 +265,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- return (mkCcc (subst1 v rhs body)) else if -- dtrace "top Let tests" (ppr (not catClosed, substFriendly catClosed rhs, idOccs False v body)) $ - not (isMonoTy (varType v)) || + not (isMonoTy (varType v)) || not catClosed || -- experiment substFriendly catClosed rhs || idOccs False v body <= 1 then Doing("top Let float") @@ -239,7 +293,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = go e' -- See journal 2018-02-02. Trying("top Case of product") - Case scrut _ _rhsTy [(DataAlt dc, [b,c], rhs)] + Case scrut _ _rhsTy [Alt (DataAlt dc) [b,c] rhs] | isBoxedTupleTyCon (dataConTyCon dc) -- prevent infinite loop , not (isCast rhs) -> @@ -252,7 +306,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- perhaps I don't need to. Trying("top Case unfold") -- Case scrut@(unfoldMaybe -> Nothing) _wild _rhsTy _alts - -- | pprTrace "top Case failed to unfold scrutinee" (ppr scrut) False -> undefined + -- \| pprTrace "top Case failed to unfold scrutinee" (ppr scrut) False -> undefined Case scrut wild rhsTy alts | Just scrut' <- unfoldMaybe scrut -> Doing("top Case unfold") -- of dictionary @@ -269,7 +323,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- I think GHC is undoing this transformation, so continue eagerly -- (`Cast` co') <$> go e Trying("top const cast") - Cast (Lam v e) (FunCo _r _ co'@(coercionKind -> Pair b b')) + Cast (Lam v e) (FunCo' _r _ co'@(coercionKind -> Pair b b')) | not (v `isFreeIn` e) -- , dtrace "top const cast" (ppr (varWithType castConstTV)) True , Just mk <- onDictMaybe <=< onDictMaybe $ @@ -279,11 +333,15 @@ ccc (CccEnv {..}) (Ops {..}) cat = Trying("top representational cast") -- This version fails gracefully when we can't make the coercions. -- Then we can see further into the error. - e@(Cast e' (coercionRole -> Representational)) - | FunTy' a b <- exprType e - , FunTy' a' b' <- exprType e' - , Just coA <- mkCoerceC_maybe cat a a' - , Just coB <- mkCoerceC_maybe cat b' b + e@(Cast e' co@(coercionRole -> Representational)) + | dtrace "found representational cast" (ppr (exprType e, exprType e', co)) False -> undefined + -- \| FunTy' a b <- exprType e + -- \| FunTy' a' b' <- exprType e' + | FunCo' Representational co1 co2 <- optimizeCoercion co + --, Just coA <- mkCoerceC_maybe cat a a' + --, Just coB <- mkCoerceC_maybe cat b' b + , let coA = goCoercion True co1 [] -- a a' + , let coB = goCoercion True co2 [] -- b' b -> Doing("top representational cast") -- Will I get unnecessary coerceCs due to nominal-able sub-coercions? @@ -314,7 +372,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = return (mkCcc e') Trying("top App") e@(App u v) - -- | dtrace "top App tests" (ppr (exprType v,liftedExpr v, mkConst' cat dom v,mkUncurryMaybe cat (mkCcc u))) False -> undefined + -- \| dtrace "top App tests" (ppr (exprType v,liftedExpr v, mkConst' cat dom v,mkUncurryMaybe cat (mkCcc u))) False -> undefined | catClosed, liftedExpr v , Just v' <- mkConst' cat dom v -- , dtrace "top App --> " (pprWithType v') True @@ -327,7 +385,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- dtrace "top App result" (ppr (mkCompose cat uncU' (mkFork cat v' (mkId cat dom)))) $ return (mkCompose cat uncU' (mkFork cat v' (mkId cat dom))) where - Just (dom,_) = splitFunTy_maybe (exprType e) + Just (dom,_) = splitFunTy_maybe' (exprType e) Tick t e -> Doing("top tick") return $ Tick t (mkCcc e) _e -> Doing("top Unhandled") @@ -339,7 +397,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- goLam x body | dtrace ("goLam body constr: " ++ exprConstr body) (ppr (Lam x body)) False = undefined where catClosed = isClosed cat - goLam' x body = + goLam' x body = dtrace ("goLam "++pp x++" "++pp cat++":") (pprWithType body) $ goLam x body #if 0 @@ -380,7 +438,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = Trying("lam Pair") (collectArgs -> (PairVar,(Type a : Type b : rest))) -> - -- | dtrace "Pair" (ppr rest) False -> undefined + -- \| dtrace "Pair" (ppr rest) False -> undefined case rest of [] -> -- (,) == curry id -- Do we still need this case, or is it handled by catFun? @@ -408,12 +466,6 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- (\ x -> let y = f x in g y) --> g . f -- (\ x -> let y = RHS in BODY) --> (\ y -> BODY) . (\ x -> RHS) -- if x not free in B - Trying("lam Let compose") - Let (NonRec y rhs) body' - | not (x `isFreeIn` body') - , Just comp <- mkCompose' cat (mkCcc (Lam y body')) (mkCcc (Lam x rhs)) - -> Doing("lam Let compose") - return comp Trying("lam Let") -- TODO: refactor with top Let _e@(Let bind@(NonRec v rhs) body') -> @@ -446,6 +498,12 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- _e@(Let bind@(Rec [(v,rhs)]) body') -> -- Doing("lam letrec") -- undefined + Trying("lam Let compose") + Let (NonRec y rhs) body' + | not (x `isFreeIn` body') + , Just comp <- mkCompose' cat (mkCcc (Lam y body')) (mkCcc (Lam x rhs)) + -> Doing("lam Let compose") + return comp Trying("lam inner eta-reduce") (etaReduce_maybe -> Just e') -> Doing("lam inner eta-reduce") @@ -475,13 +533,9 @@ ccc (CccEnv {..}) (Ops {..}) cat = Doing("lam boxer") return (mkCcc (Lam x e')) Trying("lam Case of boxer") - e@(Case scrut wild _ty [(_dc,[unboxedV],rhs)]) + e@(Case scrut wild _ty [Alt _dc [unboxedV] rhs]) | Just (tc,[]) <- splitTyConApp_maybe (varType wild) -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) , Just boxV <- flip DFMap.lookupUDFM tc boxers -#else - , Just boxV <- OrdMap.lookup tc boxers -#endif -> Doing("lam Case of boxer") -- dtrace "boxV" (ppr boxV) $ let wild' = setIdOccInfo wild compatNoOccInfo @@ -490,24 +544,20 @@ ccc (CccEnv {..}) (Ops {..}) cat = pprPanic ("lam Case of boxer: bare unboxed var") (ppr e) tweak (App (Var f) (Var v)) | f == boxV, v == unboxedV = Var wild' tweak e' = e' -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) compatNoOccInfo = noOccInfo -#else - compatNoOccInfo = NoOccInfo -#endif in -- Note top-down (everywhere') instead of bottom-up (everywhere) -- so that we can find 'boxI v' before v. return (mkCcc (Lam x (Let (NonRec wild' scrut) (everywhere' (mkT tweak) rhs)))) Trying("lam Case hoist") - Case scrut wild ty [(dc,vs,rhs)] + Case scrut wild ty [Alt dc vs rhs] | not (x `isFreeIn` scrut) -> Doing("lam Case hoist") return $ - mkCcc (Case scrut wild (mkFunTy' xty ty) [(dc,vs, Lam x rhs)]) + mkCcc (Case scrut wild (mkFunTy' xty ty) [Alt dc vs (Lam x rhs)]) -- pprPanic ("lam Case hoist") empty Trying("lam Case to let") - Case scrut v@(isDeadBinder -> False) _rhsTy [(_, bs, rhs)] + Case scrut v@(isDeadBinder -> False) _rhsTy [Alt _ bs rhs] | isEmptyVarSet (mkVarSet bs `intersectVarSet` exprFreeVars rhs) -> Doing("lam Case to let") return (mkCcc (Lam x (Let (NonRec v scrut) rhs))) @@ -516,16 +566,16 @@ ccc (CccEnv {..}) (Ops {..}) cat = Doing("lam Case live wild") goLam' x e' Trying("lam Case default") - Case _scrut _ _rhsTy [(DEFAULT,[],rhs)] -> + Case _scrut _ _rhsTy [Alt DEFAULT [] rhs] -> Doing("lam case-default") return (mkCcc (Lam x rhs)) Trying("lam Case nullary") - Case _scrut _ _rhsTy [(_, [], rhs)] -> + Case _scrut _ _rhsTy [Alt _ [] rhs] -> Doing("lam Case nullary") return (mkCcc (Lam x rhs)) -- TODO: abstract return (mkCcc (Lam x ...)) Trying("lam Case of Bool") - Case scrut _ rhsTy [(DataAlt false, [], rhsF),(DataAlt true, [], rhsT)] + Case scrut _ rhsTy [Alt (DataAlt false) [] rhsF, Alt (DataAlt true) [] rhsT] | false == falseDataCon && true == trueDataCon -> -- To start, require v to be unused. Later, extend. -- if not (isDeadBinder wild) && wild `isFreeIns` [rhsF,rhsT] then @@ -536,10 +586,10 @@ ccc (CccEnv {..}) (Ops {..}) cat = mkIfC cat rhsTy (mkCcc (Lam x scrut)) (mkCcc (Lam x rhsT)) (mkCcc (Lam x rhsF)) Trying("lam Case of product") - Case scrut _ _rhsTy [(DataAlt dc, [a,b], rhs)] + Case scrut _ _rhsTy [Alt (DataAlt dc) [a,b] rhs] | isBoxedTupleTyCon (dataConTyCon dc) -> Doing("lam Case of product") - if -- | not (isDeadBinder wild) -> -- About to remove + if -- \| not (isDeadBinder wild) -> -- About to remove -- pprPanic "lam Case of product live wild binder" (ppr e) | not (b `isFreeIn` rhs) -> return $ mkCcc $ -- inlineE $ -- already inlines early @@ -564,7 +614,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- Trying("lam Case cast") Trying("lam Case unfold") Case scrut v altsTy alts - -- | pprTrace "lam Case unfold" (ppr (scrut,unfoldMaybe' scrut)) False -> undefined + -- \| pprTrace "lam Case unfold" (ppr (scrut,unfoldMaybe' scrut)) False -> undefined | Just scrut' <- unfoldMaybe' scrut -> Doing("lam Case unfold") return $ mkCcc $ Lam x $ @@ -590,7 +640,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = co'' = downgradeRole r r' co' -- same as co? in -- pprTrace "lam nominal Cast" (ppr co $$ text "-->" $$ ppr co'') $ - return (mkCcc (Cast (Lam x body') (FunCo r (mkReflCo r xty) co''))) + return (mkCcc (Cast (Lam x body') (mkFunCo' r (mkReflCo r xty) co''))) Trying("lam representational cast") e@(Cast e' _) -> Doing("lam representational cast") @@ -606,7 +656,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -> Doing("lam fmap unfold") -- dtrace "lam fmap unfold" (ppr body') $ return (mkCcc (Lam x body')) - + Trying("lam fmap 1") _e@(collectArgs -> (Var v, [Type _ {-(isFunTy -> True)-},Type h,Type b,Type c,_dict,_ok,f])) | v == fmapV -> Doing("lam fmap 1") @@ -625,10 +675,10 @@ ccc (CccEnv {..}) (Ops {..}) cat = , not (x `isFreeIn` u) , okType (exprType v) -> case mkCompose' cat (mkCcc u) (mkCcc (Lam x v)) of - Nothing -> + Nothing -> Doing("lam App compose bail") Nothing - Just e' -> + Just e' -> Doing("lam App compose") return e' @@ -649,7 +699,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = Trying("lam App") -- (\ x -> U V) --> apply . (\ x -> U) &&& (\ x -> V) - u `App` v -- | pprTrace "lam App" (ppr (u,v)) False -> undefined + u `App` v -- \| pprTrace "lam App" (ppr (u,v)) False -> undefined | catClosed, liftedExpr v, okType (exprType v) -- , pprTrace "lam App mkApplyMaybe -->" (ppr (mkApplyMaybe cat vty bty, cat)) True , mbComp <- do app <- mkApplyMaybe cat vty bty @@ -683,6 +733,130 @@ ccc (CccEnv {..}) (Ops {..}) cat = isConst = not (x `isFreeIn` body) catClosed = isClosed cat + -- Given + -- + -- * a desired polarity + -- * a representational coercion co :: t1 ~ t2 + -- * a list of type arguments `ts` + -- + -- returns an expression of type + -- t1 ts `cat` t2 ts (if polarity = True) + -- t2 ts `cat` t1 ts (if polarity = False) + -- + -- built using (.), fmapC, reprC and abstC + -- + -- + -- goCoercion checks that the output types make sense; goCoercion' does the work + goCoercion :: Bool -> Coercion -> [Type] -> CoreExpr + goCoercion pol co ts + | Just (t1',t2') <- tyArgs2_maybe (exprType exp_out) + , (t1 `mkAppTys` ts) `eqType` t1' + , (t2 `mkAppTys` ts) `eqType` t2' + = exp_out + | Just (t1',t2') <- tyArgs2_maybe (exprType exp_out) + = pprPanic "goCoercion mismatch:" $ + ppr pol $$ ppr co $$ ppr (coercionKind co) $$ ppr ts $$ ppr (Pair t1' t2') $$ ppr exp_out + | otherwise + = pprPanic "goCoercion not returning categorial arrow:" $ + ppr pol $$ ppr co $$ ppr (coercionKind co) $$ ppr ts $$ pprWithType exp_out + + where exp_out = goCoercion' pol co ts + Pair t1 t2 = (if pol then id else swap) $ coercionKind co + + -- Reflexivity + goCoercion' _ co ts | Just (ty, _) <- isReflCo_maybe co = mkId cat (ty `mkAppTys` ts) + + -- Symmetry + goCoercion' pol (SymCo co) ts = goCoercion (not pol) co ts + + -- Transitivity + goCoercion' pol (TransCo co1 co2) ts + = (if pol then id else flip) (mkCompose cat) (goCoercion' pol co2 ts) (goCoercion pol co1 ts) + + -- Coercion application: reflexive argument + goCoercion' pol (AppCo co1 co2) ts | Just (t, _role) <- isReflCo_maybe co2 + = goCoercion pol co1 (t : ts) + + -- Coercion application: non-reflexive argument. + -- Must be a nominal coercion, so treat it similar to SubCo below, and use mkCast + goCoercion' pol (AppCo co1 co2) ts + = mkCast out_exp out_co + where + Pair t11 t12 = (if pol then id else swap) $ coercionKind co1 + Pair t21 t22 = (if pol then id else swap) $ coercionKind co2 + out_exp = goCoercion pol co1 (t21 : ts) + out_co = (if pol then id else mkSymCo) $ mkSubCo $ + mkAppCos (mkReflCo Nominal cat) + [ mkReflCo Nominal (t11 `mkAppTys` (t21 : ts)) + , mkAppCos (mkReflCo Nominal t12) (co2 : [ mkReflCo Nominal t | t <- ts ]) + ] + + -- Nominal coercions are a bit like the identity, but we cast the resulting categorial arrow + goCoercion' pol (SubCo co) ts + = mkCast out_exp out_co + where + Pair t1 t2 = coercionKind co + out_exp = mkId cat (t1 `mkAppTys` ts) + out_co = (if pol then id else mkSymCo) $ mkSubCo $ + mkAppCos (mkReflCo Nominal cat) [mkReflCo Nominal t1, co] + + -- Newtype wrapper + -- This is (very likely) a newtype, so lets see if mkReprC (or mkAbstC) works + -- For now, the type arguments must not be coerced (usually there are none for newtypes) + goCoercion' pol co@(AxiomInstCo _ 0 cos1) ts | all isReflCo cos1 + -- = mkReprC' cat (t1 `mkAppTys` ts) + = fromMaybe (pprPanic "goCoercion AxiomInstCo: failed catOpMaybe" (ppr co)) $ + catOpMaybe cat (if pol then reprCV else abstCV) [t1 `mkAppTys` ts, t2 `mkAppTys` ts] + where Pair t1 t2 = coercionKind co + + + -- If the a arguments are casted, e.g. the coercion is + -- NDual (co) :: Dual t1 Double Float ~ t2 Float Double + -- where co :: t1 ~ t2 is a non-refl coercion, we have a slight problem. We + -- cannot create a categorical term that changes the first parameter of NDual + -- (we'd need generalization of Functor that are univariant, and that for each type parameter) + -- + -- So instead we de-normalize the coercion to + -- + -- co ; NDual + -- + -- by looking at the RHS type of the newtype equation, and building a coercion from it + -- where we insert the argument coercinos instead of the type variables (using liftCoSubstWith). + -- + -- This will probably loop for recursive newtypes (newtype Stream = MkS (Double, Stream)) + -- + -- TODO: think this through for pol = False + goCoercion' pol (AxiomInstCo ax 0 cos1) ts + = goCoercion pol (mkTransCo co1 co2) ts + where + co1 = AxiomInstCo ax 0 cos1' + ax_branch = coAxiomNthBranch ax 0 + -- Experimental hack: Hardcoded for the Dual newtype’s RHS + --co2 = mkAppCos c1 [c3,c2] + co2 = liftCoSubstWith Representational (coAxBranchTyVars ax_branch) cos1 (coAxBranchRHS ax_branch) + cos1' = [ mkReflCo (coercionRole arg_co) (pFst (coercionKind arg_co)) | arg_co <- cos1 ] + + goCoercion' pol co@(FunCo' Representational co1 co2) ts + | not (null ts) + = pprPanic "goCoercion': oddly kinded FunCo" (ppr co $$ ppr ts) + + -- If we have "_R -> co2", and a suitable FuncorCat instance exists, + -- we can use fmapC + | Just (ty1, _role) <- isReflCo_maybe co1 +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + , let h = mkTyConApp funTyCon [Many, liftedRepTy, liftedRepTy, ty1] +#else + , let h = mkTyConApp funTyCon [liftedRepTy, liftedRepTy, ty1] +#endif + , Just exp_out <- onDictMaybe =<< catOpMaybe cat fmapV [h, ty21, ty22] + = exp_out `App` goCoercion pol co2 [] + where Pair ty21 ty22 = (if pol then id else swap) $ coercionKind co2 + + goCoercion' pol co ts + = dtrace "goCoercion giving up, falling back to mkCoerceC" (ppr co $$ ppr (coercionKind co)) $ + mkCoerceC cat (t1 `mkAppTys` ts) (t2 `mkAppTys` ts) + where Pair t1 t2 = (if pol then id else swap) $ coercionKind co + pattern Coerce :: Cat -> Type -> Type -> CoreExpr pattern Coerce k a b <- -- (collectArgs -> (Var (isCoerceV -> True), [Type k,Type a,Type b,_dict])) @@ -707,7 +881,7 @@ composeR (CccEnv {..}) (Ops {..}) _g@(Coerce k _b c) _f@(Coerce _k a _b') Just (mkCoerceC k a c) -- composeR (CccEnv {..}) (Ops {..}) h (Compose _k _ _a _b' g f) --- | pprTrace "composeR try re-assoc" (ppr h $$ ppr g $$ ppr f) False = undefined +-- \| pprTrace "composeR try re-assoc" (ppr h $$ ppr g $$ ppr f) False = undefined composeR (CccEnv {..}) (Ops {..}) _h@(Coerce k _b c) (Compose _k _ a _b' _g@(Coerce _k' _z _a') f) = -- pprTrace "composeR coerce re-assoc" (ppr _h $$ ppr _g $$ ppr f) $ @@ -785,6 +959,7 @@ data Ops = Ops , isPseudoApp :: CoreExpr -> Bool , normType :: Role -> Type -> (Coercion, Type) , okType :: Type -> Bool + , optimizeCoercion :: Coercion -> Coercion } mkOps :: CccEnv -> ModGuts -> AnnEnv -> FamInstEnvs @@ -807,17 +982,13 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. tweak e@(App (Var con) e') | isDataConWorkId con , Just (tc,[]) <- splitTyConApp_maybe (exprType e) -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) , Just boxV <- flip DFMap.lookupUDFM tc boxers -#else - , Just boxV <- OrdMap.lookup tc boxers -#endif = success $ Var boxV `App` e' tweak ((Var v `App` Type ty) `App` e') | v == tagToEnumV && ty `eqType` boolTy = success $ Var boxIBV `App` e' -- Int equality turns into matching, which takes some care. - tweak (Case scrut v rhsTy ((DEFAULT, [], d) : (mapM litAlt -> Just las))) + tweak (Case scrut v rhsTy ((Alt DEFAULT [] d) : (mapM litAlt -> Just las))) | notNull las , hasTyCon intPrimTyCon vty = Doing("lam Case of Int#") @@ -829,7 +1000,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. scrut' = Var scrutV mkIf (lit,rhs) e = varApps ifEqIntHash [rhsTy] [scrut',Lit lit,rhs,e] tweak e = (Any False, e) - litAlt (LitAlt lit,[],rhs) = Just (lit,rhs) + litAlt (Alt (LitAlt lit) [] rhs) = Just (lit,rhs) litAlt _ = Nothing -- hrMeth :: Type -> Maybe (Id -> CoreExpr) -- hrMeth ty = -- dtrace "hasRepMeth:" (ppr ty) $ @@ -839,18 +1010,12 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. catTy (tyArgs2 -> (a,b)) = mkAppTys cat [a,b] reCatCo :: Rewrite Coercion -- reCatCo co | dtrace "reCatCo" (ppr co) False = undefined - reCatCo (FunCo r a b) = Just (mkAppCos (mkReflCo r cat) [a,b]) + reCatCo (FunCo' r a b) = Just (mkAppCos (mkReflCo r cat) [a,b]) reCatCo (splitAppCo_maybe -> Just (splitAppCo_maybe -> Just -#if MIN_VERSION_GLASGOW_HASKELL(8,8,0,0) (GRefl r _k mrefl,a),b)) = -- dtrace "reCatCo app" (ppr (r,_k,a,b)) $ Just (mkAppCos (mkGReflCo r cat mrefl) [a,b]) -#else - (Refl r _k,a),b)) = - -- dtrace "reCatCo app" (ppr (r,_k,a,b)) $ - Just (mkAppCos (mkReflCo r cat) [a,b]) -#endif reCatCo (co1 `TransCo` co2) = TransCo <$> reCatCo co1 <*> reCatCo co2 reCatCo co = pprTrace "ccc reCatCo: unhandled coercion" (ppr co) $ Nothing @@ -865,16 +1030,16 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. -- unfoldMaybe' e | pprTrace "unfoldMaybe'" (ppr (e,exprHead e)) False = undefined unfoldMaybe' e@(exprHead -> Just v) | not (isSelectorId v || isAbstReprId v) = unfoldMaybe e - unfoldMaybe' _ = Nothing + unfoldMaybe' _ = Nothing unfoldMaybe :: ReExpr -- unfoldMaybe e | dtrace "unfoldMaybe" (ppr (e,collectArgsPred isTyCoDictArg e)) False = undefined - unfoldMaybe e -- | unfoldOkay e - -- | (Var v, _) <- collectArgsPred isTyCoDictArg e + unfoldMaybe e -- \| unfoldOkay e + -- \| (Var v, _) <- collectArgsPred isTyCoDictArg e -- -- , dtrace "unfoldMaybe" (text (fqVarName v)) True -- , isNothing (catFun (Var v)) - -- | True -- experiment: don't restrict unfolding + -- \| True -- experiment: don't restrict unfolding = onExprHead dflags ({- traceRewrite "inlineMaybe" -} inlineMaybe) e - -- | otherwise = Nothing + -- \| otherwise = Nothing -- unfoldMaybe = -- traceRewrite "unfoldMaybe" $ -- onExprHead ({-traceRewrite "inlineMaybe"-} inlineMaybe) inlineMaybe :: Id -> Maybe CoreExpr @@ -890,14 +1055,14 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. noDictErr doc = either (\ msg -> pprPanic "ccc - couldn't build dictionary for" (doc GHC.<> colon $$ msg)) id onDictTry :: CoreExpr -> Either SDoc CoreExpr - onDictTry e | Just (ty,_) <- splitFunTy_maybe (exprType e) + onDictTry e | Just (ty,_) <- splitFunTy_maybe' (exprType e) , isPredTy' ty = App e <$> buildDictMaybe ty | otherwise = return e -- pprPanic "ccc / onDictTy: not a function from pred" (pprWithType e) onDictMaybe :: ReExpr -- TODO: refactor onDictMaybe onDictMaybe e = case onDictTry e of - Left msg -> dtrace "Couldn't build dictionary for" + Left msg -> dtrace "Couldn't build dictionary for" (pprWithType e GHC.<> colon $$ msg) $ Nothing Right dict -> Just dict @@ -907,7 +1072,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. -- Yet another variant: keep applying to dictionaries as long as we have -- a predicate type. TODO: reassess and refactor these variants. onDicts :: Unop CoreExpr - onDicts e | Just (ty,_) <- splitFunTy_maybe (exprType e) + onDicts e | Just (ty,_) <- splitFunTy_maybe' (exprType e) , isPredTy' ty = onDicts (onDict e) | otherwise = e buildDictMaybe :: Type -> Either SDoc CoreExpr @@ -915,7 +1080,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. buildDictionary hsc_env dflags guts uniqSupply inScope evTy ev ty catOp :: Cat -> Var -> [Type] -> CoreExpr -- catOp k op tys | dtrace "catOp" (ppr (k,op,tys)) False = undefined - catOp k op tys -- | dtrace "catOp" (pprWithType (Var op `mkTyApps` (k : tys))) True + catOp k op tys -- \| dtrace "catOp" (pprWithType (Var op `mkTyApps` (k : tys))) True = onDicts (Var op `mkTyApps` (k : tys)) -- TODO: refactor catOp and catOpMaybe when the dust settles -- catOp :: Cat -> Var -> CoreExpr @@ -926,7 +1091,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. mkCcc' e = varApps cccPV [cat,a,b,evTy] [ev,e] where (a,b) = fromMaybe (pprPanic "mkCcc non-function:" (pprWithType e)) $ - splitFunTy_maybe (exprType e) + splitFunTy_maybe' (exprType e) mkCcc :: Unop CoreExpr -- Any reason to parametrize over Cat? mkCcc e = -- dtrace "mkCcc" (ppr (cat, e)) $ mkCcc' e @@ -940,10 +1105,12 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. mkCompose k g f | Just (b,c ) <- tyArgs2_maybe (exprType g) , Just (a,b') <- tyArgs2_maybe (exprType f) - , b `eqType` b' = -- mkCoreApps (onDict (catOp k composeV `mkTyApps` [b,c,a])) [g,f] - mkCoreApps (onDict (catOp k composeV [b,c,a])) [g,f] - | otherwise = pprPanic "mkCompose mismatch:" (pprWithType g $$ pprWithType f) + if b `eqType` b' + then mkCoreApps (onDict (catOp k composeV [b,c,a])) [g,f] + else pprPanic "mkCompose mismatch:" $ ppr b $$ ppr b' $$ pprWithType g $$ pprWithType f + | otherwise + = pprPanic "mkCompose arguments not arrays:" $ pprWithType g $$ pprWithType f -- Experiment mkCompose' :: Cat -> ReExpr2 @@ -955,7 +1122,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. = -- flip mkCoreApps [g,f] <$> onDictMaybe (catOp k composeV [b,c,a]) -- (flip mkCoreApps [g,f] . onDict) <$> catOpMaybe k composeV [b,c,a] flip mkCoreApps [g,f] <$> (onDictMaybe =<< catOpMaybe k composeV [b,c,a]) - | otherwise = pprPanic "mkCompose mismatch:" (pprWithType g $$ pprWithType f) + | otherwise = pprPanic "mkCompose' mismatch:" (pprWithType g $$ pprWithType f) mkEx :: Cat -> Var -> Unop CoreExpr mkEx k ex z = @@ -1041,7 +1208,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. mkCompose cat (catOp k ifV [ty]) (mkFork cat cond (mkFork cat true false)) mkBottomC :: Cat -> Type -> Type -> Maybe CoreExpr - mkBottomC k dom cod = + mkBottomC k dom cod = -- dtrace "mkBottomC bottomTV" (pprWithType (Var bottomTV)) $ onDicts <$> catOpMaybe k bottomTV [dom,cod] mkConst :: Cat -> Type -> ReExpr @@ -1148,14 +1315,18 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. else oops "type change" (ppr beforeTy <+> "vs" $$ ppr afterTy <+> "in")) +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + (oops "Lint" . pprMessageBag) +#else (oops "Lint") +#endif (lintExpr dflags (uniqSetToList (exprFreeVars after)) after) transCatOp :: ReExpr transCatOp orig@(collectArgs -> (Var v, Type (isFunCat -> True) : rest)) | isFunCat cat = Just orig -- Take care with const, so we don't transform it alone. -- TODO: look for a more general suitable test for wrong number of arguments. - -- | pprTrace "transCatOp" (ppr (WithType (Var v),WithType <$> rest,length rest, orig)) False = undefined + -- \| pprTrace "transCatOp" (ppr (WithType (Var v),WithType <$> rest,length rest, orig)) False = undefined | v == constV && length rest /= 5 = Nothing | varModuleName v == Just catModule , uqVarName v `elem` @@ -1222,10 +1393,15 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. where pseudoAnns :: Id -> [PseudoFun] pseudoAnns = findAnns deserializeWithData annotations . NamedTarget . varName +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + optimizeCoercion = optCoercion (initOptCoercionOpts dflags) emptyTCvSubst +#else + optimizeCoercion = optCoercion dflags emptyTCvSubst +#endif substFriendly :: Bool -> CoreExpr -> Bool -- substFriendly catClosed rhs - -- | pprTrace "substFriendly" + -- \| pprTrace "substFriendly" -- (ppr ((catClosed,rhs),not (liftedExpr rhs),incompleteCatOp rhs,isTrivial rhs,isFunTy ty && not catClosed,isIntegerTy ty)) -- False = undefined -- where @@ -1233,6 +1409,7 @@ substFriendly :: Bool -> CoreExpr -> Bool substFriendly catClosed rhs = not (liftedExpr rhs) -- || substFriendlyTy (exprType rhs) + || substFriendlyTy' (exprType rhs) -- experiment || incompleteCatOp rhs || -- pprTrace "isTrivial" (ppr rhs <+> text "-->" <+> ppr (isTrivial rhs)) (isTrivial rhs) @@ -1259,7 +1436,11 @@ isTrivial (App e arg) = isTyCoDictArg arg && isTrivial e isTrivial (Tick _ e) = isTrivial e isTrivial (Cast e _) = isTrivial e isTrivial (Lam b body) = not (isRuntimeVar b) && isTrivial body +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +isTrivial (Case _ _ _ [Alt DEFAULT [] rhs]) = isTrivial rhs +#else isTrivial (Case _ _ _ [(DEFAULT,[],rhs)]) = isTrivial rhs +#endif isTrivial (Case e _ _ alts) = isTrivial e && all (isTrivial . altRhs) alts isTrivial _ = False @@ -1277,6 +1458,14 @@ substFriendlyTy (coreView -> Just ty) = substFriendlyTy ty substFriendlyTy (splitTyConApp_maybe -> Just (tc,tys)) = isFunTyCon tc || any substFriendlyTy tys substFriendlyTy _ = False +-- This variant only checks if we're dealing with TypeRep expressions. +-- These are effectively dictionary constructions for Typeable, but aren't +-- applications of dictionary constructors. We want the bindings for these +-- to let-float, definitely not turned into a beta redex. +substFriendlyTy' :: Type -> Bool +substFriendlyTy' (TyConApp tc@(isAlgTyCon -> True) _) = tyConName tc == typeRepTyConName +substFriendlyTy' _ = False + catModule :: String catModule = "ConCat.AltCat" @@ -1298,7 +1487,7 @@ extModule = "GHC.Exts" isTrivialCatOp :: CoreExpr -> Bool -- isTrivialCatOp = liftA2 (||) isSelection isAbstRepr isTrivialCatOp (collectArgs -> (Var v,length -> n)) - -- | pprTrace "isTrivialCatOp" (ppr (v,n,isSelectorId v,isAbstReprId v)) True + -- \| pprTrace "isTrivialCatOp" (ppr (v,n,isSelectorId v,isAbstReprId v)) True = (isSelectorId v && n == 5) -- exl cat tya tyb dict ok || (isAbstReprId v && n == 4) -- reprCf cat a r repCat isTrivialCatOp _ = False @@ -1330,12 +1519,12 @@ composeRuleName = fsLit "compose/coerce" evidenceRuleName :: FastString evidenceRuleName = fsLit "evidence annotation" -cccRules :: Maybe (IORef Int) -> FamInstEnvs -> CccEnv -> ModGuts -> AnnEnv -> [CoreRule] -cccRules steps famEnvs env@(CccEnv {..}) guts annotations = +cccRules :: Maybe (IORef Int) -> FamInstEnvs -> CccEnv -> ModGuts -> AnnEnv -> DynFlags -> [CoreRule] +cccRules steps famEnvs env@(CccEnv {..}) guts annotations dflags = [ BuiltinRule { ru_name = cccRuleName , ru_fn = varName cccPV , ru_nargs = 6 -- including type args - , ru_try = \ dflags inScope _fn -> + , ru_try = \ _rOpts inScope _fn -> \ case -- _args | pprTrace "ccc ru_try args" (ppr _args) False -> undefined _es@(Type k : Type _a : Type _b : Type evType : ev : arg : _) -> @@ -1369,9 +1558,7 @@ evidencePass (CccEnv {..}) guts = bindsOnlyPass (mapM (annotateEvidence cccV ccc plugin :: Plugin plugin = defaultPlugin { installCoreToDos = install -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) , pluginRecompile = purePlugin -#endif } -- Find an option "foo=bar" for optName "foo", returning a read of "bar". @@ -1386,13 +1573,14 @@ install opts todos = dflags <- getDynFlags -- Unfortunately, the plugin doesn't work in GHCi. Until fixed, -- disable under GHCi, so we can at least type-check conveniently. +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + if backend dflags == Interpreter then +#else if hscTarget dflags == HscInterpreted then +#endif return todos else do -#if !MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) - reinitializeGlobals -#endif hsc_env <- getHscEnv pkgFamEnv <- getPackageFamInstEnv env <- mkCccEnv opts @@ -1405,11 +1593,11 @@ install opts todos = let famEnvs = (pkgFamEnv, mg_fam_inst_env guts) maxSteps = (unsafePerformIO . newIORef) <$> parseOpt "maxSteps" opts - return (on_mg_rules (++ cccRules maxSteps famEnvs env guts allAnns) guts) + return (on_mg_rules (++ cccRules maxSteps famEnvs env guts allAnns dflags) guts) delCccRule guts = return (on_mg_rules (filter (not . isCccRule)) guts) isCccRule r = isBuiltinRule r && ru_name r `elem` [cccRuleName,composeRuleName] -- isCCC r | is = pprTrace "delRule" (ppr cccRuleName) is - -- | otherwise = is + -- \| otherwise = is -- where -- is = isBuiltinRule r && ru_name r == cccRuleName (pre,post) = -- (todos,[]) @@ -1419,7 +1607,7 @@ install opts todos = annotateEvidencePass = CoreDoPluginPass "evidence-annotate toCcc'" (evidencePass env) ours = [ annotateEvidencePass , CoreDoPluginPass "Ccc insert rule" addCccRule - , CoreDoSimplify 7 (mode dflags) + , CoreDoSimplify 7 (mode hsc_env dflags) , CoreDoPluginPass "Ccc remove rule" delCccRule , CoreDoPluginPass "Flag remaining ccc calls" (flagCcc env) ] @@ -1427,11 +1615,7 @@ install opts todos = -- pprTrace "ccc post-install todos:" (ppr (pre ++ ours ++ post)) (return ()) return (pre ++ ours ++ post) where -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) flagCcc :: CccEnv -> CorePluginPass -#else - flagCcc :: CccEnv -> PluginPass -#endif flagCcc (CccEnv {..}) guts | showCcc && pprTrace "ccc final:" (ppr (mg_binds guts)) False = undefined | not (Seq.null remaining) && @@ -1455,19 +1639,20 @@ install opts todos = collectQ f = everything mappend (mkQ mempty f) -- Extra simplifier pass mode -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) + hsc_env dflags -#else - _dflags -#endif = SimplMode { sm_names = ["Ccc simplifier pass"] , sm_phase = Phase 2 -- avoid inlining i.e. Vector which is at phase 1 , sm_rules = True -- important , sm_inline = True -- False -- ?? , sm_eta_expand = False -- ?? , sm_case_case = True -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) , sm_dflags = dflags +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + , sm_uf_opts = unfoldingOpts dflags + , sm_cast_swizzle = True + , sm_pre_inline = gopt Opt_SimplPreInlining dflags + , sm_logger = hsc_logger hsc_env #endif } @@ -1487,13 +1672,9 @@ mkCccEnv opts = do err = "ccc installation: couldn't find " ++ str ++ " in " ++ moduleNameString modu -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) -- In GHC 8.6, lookupRdrNameInModuleForPlugins returns a (Name, Module) -- where earlier it was just a Name mkThing' = mkThing . fst -#else - mkThing' = mkThing -#endif lookupTh mkOcc mk modu = lookupRdr (mkModuleName modu) mkOcc mk enablePolymorphism = "enablePolymorphism" `elem` opts @@ -1561,8 +1742,20 @@ mkCccEnv opts = do let boxers = OrdMap.fromList [(intTyCon,boxIV),(doubleTyCon,boxDV),(floatTyCon,boxFV)] #endif -- _ <- findId "GHC.Num" "subtract" -- help the plugin find instances for Float and Double + + -- toCcc' is defined to throw an exception, but this shouldn't matter as the plugin + -- transforms calls to toCcc'. + -- However, if ghc knows it throws an exception it elides calls to toCcc' before + -- the plugin gets to it. + -- See ConCat.Oops for the trick we're using to keep ghc from discoverng that toCcc' + -- throws an exception. Make sure here that it works. +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + when (isDeadEndId cccV) $ + pprPanic "isDeadEndId cccV" empty +#else when (isBottomingId cccV) $ pprPanic "isBottomingId cccV" empty +#endif return (CccEnv { .. }) -- Variables that have associated ccc rewrite rules in AltCat. If we have @@ -1588,8 +1781,8 @@ monoInfo = info :: [(String, [(String, [Type])])] info = [ ("notC",boolOp "not"), ("andC",boolOp "&&"), ("orC",boolOp "||") - , ("equal", eqOp "==" <$> ifd) - , ("notEqual", eqOp "/=" <$> ifd) + , ("equal", eqOp "==" <$> ifd) + , ("notEqual", eqOp "/=" <$> ifd) , ("lessThan", compOps "lt" "<") , ("greaterThan", compOps "gt" ">") , ("lessThanOrEqual", compOps "le" "<=") @@ -1660,8 +1853,11 @@ floatModule = "GHC.Float" -- (<): ltI, $fOrdFloat_$c< pp :: Outputable a => a -> String +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +pp = showPprUnsafe +#else pp = showPpr unsafeGlobalDynFlags - +#endif {-------------------------------------------------------------------- Misc @@ -1698,7 +1894,11 @@ qualifiedName nm = -- binders, which is handy as dead binders can appear with live binders of the -- same variable. subst :: [(Id,CoreExpr)] -> Unop CoreExpr +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +subst ps = substExpr (foldr add emptySubst ps') +#else subst ps = substExpr "subst" (foldr add emptySubst ps') +#endif where add (v,new) sub = extendIdSubst sub v new ps' = filter (not . isDeadBinder . fst) ps @@ -1747,45 +1947,23 @@ isPred :: CoreExpr -> Bool isPred e = not (isTyCoArg e) && isPredTy' (exprType e) stringExpr :: String -> CoreExpr -#if MIN_VERSION_GLASGOW_HASKELL(8,8,0,0) stringExpr = Lit . mkLitString -#else -stringExpr = Lit . mkMachString -#endif varNameExpr :: Id -> CoreExpr varNameExpr = stringExpr . uniqVarName -#if ! MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) - -pattern FunTy :: Type -> Type -> Type -pattern FunTy dom ran <- (splitFunTy_maybe -> Just (dom,ran)) - where FunTy = mkFunTy - --- TODO: Replace explicit uses of splitFunTy_maybe - --- TODO: Look for other useful pattern synonyms - -pattern FunCo :: Role -> Coercion -> Coercion -> Coercion -pattern FunCo r dom ran <- TyConAppCo r (isFunTyCon -> True) [dom,ran] - where FunCo = mkFunCo - -#endif - onCaseRhs :: Type -> Unop (Unop CoreExpr) onCaseRhs altsTy' f (Case scrut v _ alts) = Case scrut v altsTy' (onAltRhs f <$> alts) onCaseRhs _ _ e = pprPanic "onCaseRhs. Not a case: " (ppr e) onAltRhs :: Unop CoreExpr -> Unop CoreAlt -onAltRhs f (con,bs,rhs) = (con,bs,f rhs) +onAltRhs f (Alt con bs rhs) = Alt con bs (f rhs) -- To help debug. Sometimes I'm unsure what constructor goes with what ppr. coercionTag :: Coercion -> String coercionTag Refl {} = "Refl" -#if MIN_VERSION_GLASGOW_HASKELL(8,8,0,0) coercionTag GRefl {} = "GRefl" -#endif coercionTag FunCo {} = "FunCo" -- pattern synonym coercionTag TyConAppCo {} = "TyConAppCo" coercionTag AppCo {} = "AppCo" @@ -1799,14 +1977,9 @@ coercionTag AxiomRuleCo {} = "AxiomRuleCo" coercionTag NthCo {} = "NthCo" coercionTag LRCo {} = "LRCo" coercionTag InstCo {} = "InstCo" -#if !MIN_VERSION_GLASGOW_HASKELL(8,8,0,0) -coercionTag CoherenceCo {} = "CoherenceCo" -#endif coercionTag KindCo {} = "KindCo" coercionTag SubCo {} = "SubCo" -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) coercionTag HoleCo {} = "HoleCo" -#endif -- TODO: Should I unfold (inline application head) earlier? Doing so might -- result in much simpler generated code by avoiding many beta-redexes. If I @@ -1843,10 +2016,10 @@ onExprHead _dflags h = (fmap.fmap) simpleOptExpr' $ go cont (Cast e co) = go (cont . (`Cast` co)) e go _ _ = Nothing -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) - simpleOptExpr' = simpleOptExpr _dflags +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + simpleOptExpr' = simpleOptExpr (initSimpleOpts _dflags) #else - simpleOptExpr' = simpleOptExpr + simpleOptExpr' = simpleOptExpr _dflags #endif -- TODO: try go using Maybe fmap instead of continuation. @@ -1858,7 +2031,11 @@ onExprHead _dflags h = (fmap.fmap) simpleOptExpr' $ freshId :: VarSet -> String -> Type -> Id freshId used nm ty = uniqAway (mkInScopeSet used) $ +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + mkSysLocal (fsLit nm) (mkBuiltinUnique 17) Many ty +#else mkSysLocal (fsLit nm) (mkBuiltinUnique 17) ty +#endif freshDeadId :: VarSet -> String -> Type -> Id freshDeadId used nm ty = setIdOccInfo (freshId used nm ty) IAmDead @@ -1913,10 +2090,10 @@ etaReduceN e = e -- The function category funCat :: Cat -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) -funCat = mkTyConApp funTyCon [liftedRepDataConTy, liftedRepDataConTy] +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +funCat = mkTyConApp funTyCon [Many, liftedRepTy, liftedRepTy] #else -funCat = mkTyConTy funTyCon +funCat = mkTyConApp funTyCon [liftedRepDataConTy, liftedRepDataConTy] #endif liftedExpr :: CoreExpr -> Bool @@ -1956,7 +2133,7 @@ idOccs penalizeUnderLambda x = go go (Type _) = 0 go (Coercion _) = 0 go _e@(exprType -> isPredTy' -> True) - -- | pprTrace "idOccs predicate" (pprWithType _e) False = undefined + -- \| pprTrace "idOccs predicate" (pprWithType _e) False = undefined = 0 go (Lit _) = 0 go (Var y) | y == x = -- pprTrace "idOccs found" (ppr y) $ @@ -1974,7 +2151,7 @@ idOccs penalizeUnderLambda x = go goB (y,rhs) | y == x = 0 | otherwise = go rhs -- goAlt alt | pprTrace "idOccs goAlt" (ppr alt) False = undefined - goAlt (_,ys,rhs) | x `elem` ys = 0 + goAlt (Alt _ ys rhs) | x `elem` ys = 0 | otherwise = go rhs -- GHC's isPredTy says "no" to unboxed tuples of pred types. @@ -1989,11 +2166,7 @@ isPredTy' ty = isPredTy ty || others ty others _ = False starKind :: Kind -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) starKind = liftedTypeKind -#else -starKind = mkTyConTy starKindTyCon -#endif castE :: Coercion -> CoreExpr castE co = Lam x (mkCast (Var x) co) @@ -2005,21 +2178,17 @@ pprCoWithType :: Coercion -> SDoc pprCoWithType co = ppr co <+> dcolon $$ ppr (coercionType co) setNominalRole_maybe' :: Coercion -> Maybe Coercion -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) setNominalRole_maybe' c = setNominalRole_maybe (coercionRole c) c -#else -setNominalRole_maybe' = setNominalRole_maybe -#endif -- Exists somewhere? eitherToMaybe :: Either a b -> Maybe b eitherToMaybe = either (const Nothing) Just altRhs :: Alt b -> Expr b -altRhs (_,_,rhs) = rhs +altRhs (Alt _ _ rhs) = rhs altVars :: Alt b -> [b] -altVars (_,bs,_) = bs +altVars (Alt _ bs _) = bs isCast :: Expr b -> Bool isCast (Cast {}) = True @@ -2071,7 +2240,7 @@ unsafeLimit (Just r) = \ a -> unsafePerformIO $ -- experiment alwaysSubst :: CoreExpr -> Bool -- alwaysSubst e@(collectArgs -> (Var _, args)) --- | pprTrace "alwaysSubst" (ppr (e,not (isTyCoDictArg e), all isTyCoDictArg args)) False = undefined +-- \| pprTrace "alwaysSubst" (ppr (e,not (isTyCoDictArg e), all isTyCoDictArg args)) False = undefined alwaysSubst e@(collectArgs -> (Var _, args)) = not (isTyCoDictArg e) && all isTyCoDictArg args alwaysSubst _ = False @@ -2087,10 +2256,10 @@ isFunCat _ = False -- If the wild variable in a Case is not dead, make a new dead wild var and -- transform to a Let. deadifyCaseWild :: ReExpr -deadifyCaseWild e@(Case scrut wild _rhsTy [(DataAlt dc, [a,b], rhs)]) +deadifyCaseWild e@(Case scrut wild _rhsTy [Alt (DataAlt dc) [a,b] rhs]) | not (isDeadBinder wild) = - Just (Let (NonRec wild scrut) - (Case (Var wild) wild' _rhsTy [(DataAlt dc, [a,b], rhs)])) - where + Just (Let (NonRec wild scrut) + (Case (Var wild) wild' _rhsTy [Alt (DataAlt dc) [a,b] rhs])) + where wild' = freshDeadId (exprFreeVars e) "newWild" (varType wild) deadifyCaseWild _ = Nothing diff --git a/plugin/src/ConCat/Rebox.hs b/plugin/src/ConCat/Rebox.hs index 50f635bfc..0e46ffdea 100644 --- a/plugin/src/ConCat/Rebox.hs +++ b/plugin/src/ConCat/Rebox.hs @@ -134,6 +134,7 @@ Rebox2F(timesFloat#,mulC) Rebox2F(divideFloat#,divideC) Rebox1F(sinFloat#,sinC) Rebox1F(sqrtFloat#,sqrtC) +Rebox1F(tanhFloat#,tanhC) Rebox1F(cosFloat#,cosC) Rebox1F(expFloat#,expC) Rebox1F(logFloat#,logC) @@ -146,6 +147,7 @@ Rebox2D((*##),mulC) Rebox2D((/##),divideC) Rebox1D(sinDouble#,sinC) Rebox1D(sqrtDouble#,sqrtC) +Rebox1D(tanhDouble#,tanhC) Rebox1D(cosDouble#,cosC) Rebox1D(expDouble#,expC) Rebox1D(logDouble#,logC) @@ -206,6 +208,7 @@ Rebox2(id,unboxIB, leInteger#,lessThanOrEqual) "boxF cos" [~0] forall u . boxF (cosFloat# u) = cosC (boxF u) "boxF sin" [~0] forall u . boxF (sinFloat# u) = sinC (boxF u) "boxF sqrt" [~0] forall u . boxF (sqrtFloat# u) = sqrtC (boxF u) +"boxF tanh" [~0] forall u . boxF (tanhFloat# u) = tanhC (boxF u) "boxD i2D" [~0] forall n . boxD (int2Double# n) = fromIntegralC (boxI n) "boxD negate" [~0] forall u . boxD (negateDouble# u) = negateC (boxD u) @@ -217,6 +220,7 @@ Rebox2(id,unboxIB, leInteger#,lessThanOrEqual) "boxD cos" [~0] forall u . boxD (cosDouble# u) = cosC (boxD u) "boxD sin" [~0] forall u . boxD (sinDouble# u) = sinC (boxD u) "boxD sqrt" [~0] forall u . boxD (sqrtDouble# u) = sqrtC (boxD u) +"boxD tanh" [~0] forall u . boxD (tanhDouble# u) = tanhC (boxD u) -- These two don't work: @@ -407,8 +411,8 @@ CatifyC((>=),greaterThanOrEqual) -- -- Now that we have better conditional support (including differentiation), -- -- don't translate min & max. See journal notes 2018-02-10. --- CatifyC(min,minC) --- CatifyC(max,maxC) +CatifyC(min,minC) +CatifyC(max,maxC) Catify(succ,succC) Catify(pred,predC) @@ -430,6 +434,7 @@ Catify(log,logC) Catify(cos,cosC) Catify(sin,sinC) Catify(sqrt,sqrtC) +Catify(tanh,tanhC) Catify((**),pow) -- u ** v == exp (log (u ** v)) == exp (v * log u) -- log is base in Haskell @@ -466,6 +471,7 @@ Catify(expFloat,exp) Catify(logFloat,log) Catify(sinFloat,sin) Catify(sqrtFloat,sqrt) +Catify(tanhFloat,tanh) Catify(cosFloat,cos) CatifyC(plusDouble , addC) @@ -483,6 +489,7 @@ Catify(expDouble,expC) Catify(logDouble,logC) Catify(sinDouble,sinC) Catify(sqrtDouble,sqrtC) +Catify(tanhDouble,tanhC) Catify(cosDouble,cosC) -- Maybe move elsewhere @@ -493,10 +500,6 @@ Catify(cosDouble,cosC) -- GHC 8.2+ says "A constructor, (,), appears as outermost match in RULE lhs. -- This rule will be ignored." -#if ! MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) -"pair fst snd" forall p. (,) (exl p) (exr p) = p -"swap" forall p. (,) (exr p) (exl p) = swap p -#endif #-} diff --git a/examples/test/BasicTests.hs b/plugin/test/BasicTests.hs similarity index 100% rename from examples/test/BasicTests.hs rename to plugin/test/BasicTests.hs diff --git a/examples/test/Examples.hs b/plugin/test/Examples.hs similarity index 100% rename from examples/test/Examples.hs rename to plugin/test/Examples.hs diff --git a/examples/test/GoldTests.hs b/plugin/test/GoldTests.hs similarity index 100% rename from examples/test/GoldTests.hs rename to plugin/test/GoldTests.hs diff --git a/examples/test/Miscellany.hs b/plugin/test/Miscellany.hs similarity index 100% rename from examples/test/Miscellany.hs rename to plugin/test/Miscellany.hs diff --git a/examples/test/Utils.hs b/plugin/test/Utils.hs similarity index 84% rename from examples/test/Utils.hs rename to plugin/test/Utils.hs index 765c07c5d..3e6321f13 100644 --- a/examples/test/Utils.hs +++ b/plugin/test/Utils.hs @@ -1,4 +1,5 @@ {-# LANGUAGE TypeOperators #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wall #-} module Utils where @@ -24,7 +25,7 @@ runSynCirc nm (syn A.:**: circ) = ] where gold str = goldenVsString "syntax" - ("test/gold/" <> nm <> "-" <> str <> ".golden") + ("test/gold/" <> show (__GLASGOW_HASKELL__ :: Int) <> "/" <> nm <> "-" <> str <> ".golden") . pure . BS.pack runDers :: (Show a, Show b, Show s) => String @@ -35,7 +36,7 @@ runDers :: (Show a, Show b, Show s) => String -> TestTree runDers nm derf derr gradr a a' b = let gold str = goldenVsString str - ("test/gold/" <> nm <> "-" <> str <> ".golden") + ("test/gold/" <> show (__GLASGOW_HASKELL__ :: Int) <> "/" <> nm <> "-" <> str <> ".golden") . pure . BS.pack (b', d) = derf a (b'', rd) = derr a diff --git a/examples/test/gold/add-adf-dot.golden b/plugin/test/gold/810/add-adf-dot.golden similarity index 100% rename from examples/test/gold/add-adf-dot.golden rename to plugin/test/gold/810/add-adf-dot.golden diff --git a/plugin/test/gold/810/add-adf-syn.golden b/plugin/test/gold/810/add-adf-syn.golden new file mode 100644 index 000000000..d446add70 --- /dev/null +++ b/plugin/test/gold/810/add-adf-syn.golden @@ -0,0 +1 @@ +(addC *** id . repr . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/add-adr-dot.golden b/plugin/test/gold/810/add-adr-dot.golden similarity index 100% rename from examples/test/gold/add-adr-dot.golden rename to plugin/test/gold/810/add-adr-dot.golden diff --git a/plugin/test/gold/810/add-adr-syn.golden b/plugin/test/gold/810/add-adr-syn.golden new file mode 100644 index 000000000..5c74c0f36 --- /dev/null +++ b/plugin/test/gold/810/add-adr-syn.golden @@ -0,0 +1,2 @@ +((exl . id *** repr . exr . id) . dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/add-dot.golden b/plugin/test/gold/810/add-dot.golden similarity index 100% rename from examples/test/gold/add-dot.golden rename to plugin/test/gold/810/add-dot.golden diff --git a/examples/test/gold/add-gradr-dot.golden b/plugin/test/gold/810/add-gradr-dot.golden similarity index 100% rename from examples/test/gold/add-gradr-dot.golden rename to plugin/test/gold/810/add-gradr-dot.golden diff --git a/plugin/test/gold/810/add-gradr-syn.golden b/plugin/test/gold/810/add-gradr-syn.golden new file mode 100644 index 000000000..0c5076e9d --- /dev/null +++ b/plugin/test/gold/810/add-gradr-syn.golden @@ -0,0 +1,4 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/add-syn.golden b/plugin/test/gold/810/add-syn.golden similarity index 100% rename from examples/test/gold/add-syn.golden rename to plugin/test/gold/810/add-syn.golden diff --git a/examples/test/gold/add-uncurry-dot.golden b/plugin/test/gold/810/add-uncurry-dot.golden similarity index 100% rename from examples/test/gold/add-uncurry-dot.golden rename to plugin/test/gold/810/add-uncurry-dot.golden diff --git a/examples/test/gold/add-uncurry-syn.golden b/plugin/test/gold/810/add-uncurry-syn.golden similarity index 100% rename from examples/test/gold/add-uncurry-syn.golden rename to plugin/test/gold/810/add-uncurry-syn.golden diff --git a/examples/test/gold/complex-mul-dot.golden b/plugin/test/gold/810/complex-mul-dot.golden similarity index 100% rename from examples/test/gold/complex-mul-dot.golden rename to plugin/test/gold/810/complex-mul-dot.golden diff --git a/examples/test/gold/complex-mul-syn.golden b/plugin/test/gold/810/complex-mul-syn.golden similarity index 100% rename from examples/test/gold/complex-mul-syn.golden rename to plugin/test/gold/810/complex-mul-syn.golden diff --git a/examples/test/gold/cos-2x-adf-dot.golden b/plugin/test/gold/810/cos-2x-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adf-dot.golden rename to plugin/test/gold/810/cos-2x-adf-dot.golden diff --git a/examples/test/gold/cos-2x-adf-syn.golden b/plugin/test/gold/810/cos-2x-adf-syn.golden similarity index 67% rename from examples/test/gold/cos-2x-adf-syn.golden rename to plugin/test/gold/810/cos-2x-adf-syn.golden index 1902eba76..e577cfd3f 100644 --- a/examples/test/gold/cos-2x-adf-syn.golden +++ b/plugin/test/gold/810/cos-2x-adf-syn.golden @@ -1,14 +1,14 @@ -second coerce . +second (id . repr) . apply . ((curry ((exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . - coerce . + repr . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** exr . exl) . @@ -21,10 +21,10 @@ apply . ((exl . exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exl) . dup) . dup) *** @@ -39,11 +39,11 @@ apply . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . exl) . @@ -51,11 +51,11 @@ apply . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -65,18 +65,18 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** coerce . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2x-adr-dot.golden b/plugin/test/gold/810/cos-2x-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adr-dot.golden rename to plugin/test/gold/810/cos-2x-adr-dot.golden diff --git a/examples/test/gold/cos-2x-adr-syn.golden b/plugin/test/gold/810/cos-2x-adr-syn.golden similarity index 63% rename from examples/test/gold/cos-2x-adr-syn.golden rename to plugin/test/gold/810/cos-2x-adr-syn.golden index 4ca4af322..f6691e42b 100644 --- a/examples/test/gold/cos-2x-adr-syn.golden +++ b/plugin/test/gold/810/cos-2x-adr-syn.golden @@ -1,5 +1,5 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -8,12 +8,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -22,7 +22,8 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . @@ -37,12 +38,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -51,29 +52,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -84,14 +85,14 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -101,25 +102,24 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** ((const 2.0 *** - coerce . - coerce . - curry (const 0.0) . coerce . coerce . curry (const ()) . const 0.0) . + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2x-gradr-dot.golden b/plugin/test/gold/810/cos-2x-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-gradr-dot.golden rename to plugin/test/gold/810/cos-2x-gradr-dot.golden diff --git a/examples/test/gold/cos-2x-gradr-syn.golden b/plugin/test/gold/810/cos-2x-gradr-syn.golden similarity index 62% rename from examples/test/gold/cos-2x-gradr-syn.golden rename to plugin/test/gold/810/cos-2x-gradr-syn.golden index d80ee565c..b96057f38 100644 --- a/examples/test/gold/cos-2x-gradr-syn.golden +++ b/plugin/test/gold/810/cos-2x-gradr-syn.golden @@ -1,7 +1,7 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -10,12 +10,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -24,7 +24,8 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . @@ -39,12 +40,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -53,29 +54,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -86,14 +87,14 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -103,25 +104,24 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** ((const 2.0 *** - coerce . - coerce . - curry (const 0.0) . coerce . coerce . curry (const ()) . const 0.0) . + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2xx-adf-dot.golden b/plugin/test/gold/810/cos-2xx-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adf-dot.golden rename to plugin/test/gold/810/cos-2xx-adf-dot.golden diff --git a/examples/test/gold/cos-2xx-adf-syn.golden b/plugin/test/gold/810/cos-2xx-adf-syn.golden similarity index 69% rename from examples/test/gold/cos-2xx-adf-syn.golden rename to plugin/test/gold/810/cos-2xx-adf-syn.golden index 708e4528c..69fbd5a2e 100644 --- a/examples/test/gold/cos-2xx-adf-syn.golden +++ b/plugin/test/gold/810/cos-2xx-adf-syn.golden @@ -1,14 +1,14 @@ -second coerce . +second (id . repr) . apply . ((curry ((exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . - coerce . + repr . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** exr . exl) . @@ -21,10 +21,10 @@ apply . ((exl . exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exl) . dup) . dup) *** @@ -39,11 +39,11 @@ apply . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . exl) . @@ -51,11 +51,11 @@ apply . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -65,13 +65,13 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -80,11 +80,11 @@ apply . ((exl . exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exl) . dup) . dup) *** @@ -99,11 +99,11 @@ apply . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . exl) . @@ -111,12 +111,12 @@ apply . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -126,22 +126,22 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** coerce . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr) . dup) . dup . exl . exl) . dup) *** - ((id *** coerce . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2xx-adr-dot.golden b/plugin/test/gold/810/cos-2xx-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adr-dot.golden rename to plugin/test/gold/810/cos-2xx-adr-dot.golden diff --git a/examples/test/gold/cos-2xx-adr-syn.golden b/plugin/test/gold/810/cos-2xx-adr-syn.golden similarity index 63% rename from examples/test/gold/cos-2xx-adr-syn.golden rename to plugin/test/gold/810/cos-2xx-adr-syn.golden index 23023e1db..9bfa5d2a3 100644 --- a/examples/test/gold/cos-2xx-adr-syn.golden +++ b/plugin/test/gold/810/cos-2xx-adr-syn.golden @@ -1,5 +1,5 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -8,12 +8,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -22,7 +22,8 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . @@ -37,12 +38,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -51,29 +52,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -84,14 +85,14 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -101,15 +102,15 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -121,12 +122,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -135,29 +136,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -168,15 +169,15 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -186,29 +187,29 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** ((const 2.0 *** - coerce . - coerce . - curry (const 0.0) . coerce . coerce . curry (const ()) . const 0.0) . + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2xx-dot.golden b/plugin/test/gold/810/cos-2xx-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-dot.golden rename to plugin/test/gold/810/cos-2xx-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-dot.golden b/plugin/test/gold/810/cos-2xx-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-gradr-dot.golden rename to plugin/test/gold/810/cos-2xx-gradr-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-syn.golden b/plugin/test/gold/810/cos-2xx-gradr-syn.golden similarity index 63% rename from examples/test/gold/cos-2xx-gradr-syn.golden rename to plugin/test/gold/810/cos-2xx-gradr-syn.golden index 55823e4d1..6f8fccac6 100644 --- a/examples/test/gold/cos-2xx-gradr-syn.golden +++ b/plugin/test/gold/810/cos-2xx-gradr-syn.golden @@ -1,7 +1,7 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -10,12 +10,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -24,7 +24,8 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . @@ -39,12 +40,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -53,29 +54,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -86,14 +87,14 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -103,15 +104,15 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -123,12 +124,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -137,29 +138,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -170,15 +171,15 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . coerce . curry (addC . exr)) . + abst . abst . curry (addC . exr)) . dup) . dup) . apply . @@ -188,29 +189,29 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** ((const 2.0 *** - coerce . - coerce . - curry (const 0.0) . coerce . coerce . curry (const ()) . const 0.0) . + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup . exl . exl) . dup) *** - ((id *** coerce . coerce . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-2xx-syn.golden b/plugin/test/gold/810/cos-2xx-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-syn.golden rename to plugin/test/gold/810/cos-2xx-syn.golden diff --git a/examples/test/gold/cos-adf-dot.golden b/plugin/test/gold/810/cos-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-adf-dot.golden rename to plugin/test/gold/810/cos-adf-dot.golden diff --git a/examples/test/gold/cos-adf-syn.golden b/plugin/test/gold/810/cos-adf-syn.golden similarity index 80% rename from examples/test/gold/cos-adf-syn.golden rename to plugin/test/gold/810/cos-adf-syn.golden index e875a9128..1adb56320 100644 --- a/examples/test/gold/cos-adf-syn.golden +++ b/plugin/test/gold/810/cos-adf-syn.golden @@ -1,8 +1,8 @@ -second coerce . +second (id . repr) . apply . (curry ((exr *** - coerce . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . diff --git a/examples/test/gold/cos-adr-dot.golden b/plugin/test/gold/810/cos-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-adr-dot.golden rename to plugin/test/gold/810/cos-adr-dot.golden diff --git a/plugin/test/gold/810/cos-adr-syn.golden b/plugin/test/gold/810/cos-adr-syn.golden new file mode 100644 index 000000000..1d1eac293 --- /dev/null +++ b/plugin/test/gold/810/cos-adr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/examples/test/gold/cos-gradr-dot.golden b/plugin/test/gold/810/cos-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-gradr-dot.golden rename to plugin/test/gold/810/cos-gradr-dot.golden diff --git a/examples/test/gold/cos-gradr-syn.golden b/plugin/test/gold/810/cos-gradr-syn.golden similarity index 56% rename from examples/test/gold/cos-gradr-syn.golden rename to plugin/test/gold/810/cos-gradr-syn.golden index 3e404ca39..092301088 100644 --- a/examples/test/gold/cos-gradr-syn.golden +++ b/plugin/test/gold/810/cos-gradr-syn.golden @@ -1,11 +1,12 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . (curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . diff --git a/examples/test/gold/cos-xpy-adf-dot.golden b/plugin/test/gold/810/cos-xpy-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adf-dot.golden rename to plugin/test/gold/810/cos-xpy-adf-dot.golden diff --git a/examples/test/gold/cos-xpy-adf-syn.golden b/plugin/test/gold/810/cos-xpy-adf-syn.golden similarity index 67% rename from examples/test/gold/cos-xpy-adf-syn.golden rename to plugin/test/gold/810/cos-xpy-adf-syn.golden index 01ec3990b..aae5d2cbc 100644 --- a/examples/test/gold/cos-xpy-adf-syn.golden +++ b/plugin/test/gold/810/cos-xpy-adf-syn.golden @@ -1,16 +1,16 @@ -second coerce . +second (id . repr) . apply . ((curry ((exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . - coerce . + repr . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup *** - coerce . curry (addC . exr)) . + abst . curry (addC . exr)) . dup) . dup) *** cosC) . diff --git a/examples/test/gold/cos-xpy-adr-dot.golden b/plugin/test/gold/810/cos-xpy-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adr-dot.golden rename to plugin/test/gold/810/cos-xpy-adr-dot.golden diff --git a/examples/test/gold/cos-xpy-adr-syn.golden b/plugin/test/gold/810/cos-xpy-adr-syn.golden similarity index 65% rename from examples/test/gold/cos-xpy-adr-syn.golden rename to plugin/test/gold/810/cos-xpy-adr-syn.golden index 6c16c1357..14d7164aa 100644 --- a/examples/test/gold/cos-xpy-adr-syn.golden +++ b/plugin/test/gold/810/cos-xpy-adr-syn.golden @@ -1,5 +1,5 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -8,12 +8,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -22,11 +22,12 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . dup) . exl) . dup) . -(addC *** coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file +(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/cos-xpy-gradr-dot.golden b/plugin/test/gold/810/cos-xpy-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-gradr-dot.golden rename to plugin/test/gold/810/cos-xpy-gradr-dot.golden diff --git a/examples/test/gold/cos-xpy-gradr-syn.golden b/plugin/test/gold/810/cos-xpy-gradr-syn.golden similarity index 63% rename from examples/test/gold/cos-xpy-gradr-syn.golden rename to plugin/test/gold/810/cos-xpy-gradr-syn.golden index 29c4c5376..2d5985c7a 100644 --- a/examples/test/gold/cos-xpy-gradr-syn.golden +++ b/plugin/test/gold/810/cos-xpy-gradr-syn.golden @@ -1,7 +1,7 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -10,12 +10,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -24,11 +24,12 @@ apply . apply . ((curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . dup) . exl) . dup) . -(addC *** coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file +(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/cosSinProd-dot.golden b/plugin/test/gold/810/cosSinProd-dot.golden similarity index 100% rename from examples/test/gold/cosSinProd-dot.golden rename to plugin/test/gold/810/cosSinProd-dot.golden diff --git a/examples/test/gold/cosSinProd-syn.golden b/plugin/test/gold/810/cosSinProd-syn.golden similarity index 100% rename from examples/test/gold/cosSinProd-syn.golden rename to plugin/test/gold/810/cosSinProd-syn.golden diff --git a/examples/test/gold/dup-dot.golden b/plugin/test/gold/810/dup-dot.golden similarity index 100% rename from examples/test/gold/dup-dot.golden rename to plugin/test/gold/810/dup-dot.golden diff --git a/examples/test/gold/dup-syn.golden b/plugin/test/gold/810/dup-syn.golden similarity index 100% rename from examples/test/gold/dup-syn.golden rename to plugin/test/gold/810/dup-syn.golden diff --git a/examples/test/gold/fst-dot.golden b/plugin/test/gold/810/fst-dot.golden similarity index 100% rename from examples/test/gold/fst-dot.golden rename to plugin/test/gold/810/fst-dot.golden diff --git a/examples/test/gold/fst-syn.golden b/plugin/test/gold/810/fst-syn.golden similarity index 100% rename from examples/test/gold/fst-syn.golden rename to plugin/test/gold/810/fst-syn.golden diff --git a/examples/test/gold/horner-dot.golden b/plugin/test/gold/810/horner-dot.golden similarity index 100% rename from examples/test/gold/horner-dot.golden rename to plugin/test/gold/810/horner-dot.golden diff --git a/examples/test/gold/horner-syn.golden b/plugin/test/gold/810/horner-syn.golden similarity index 100% rename from examples/test/gold/horner-syn.golden rename to plugin/test/gold/810/horner-syn.golden diff --git a/examples/test/gold/log-2xx-dot.golden b/plugin/test/gold/810/log-2xx-dot.golden similarity index 100% rename from examples/test/gold/log-2xx-dot.golden rename to plugin/test/gold/810/log-2xx-dot.golden diff --git a/examples/test/gold/log-2xx-syn.golden b/plugin/test/gold/810/log-2xx-syn.golden similarity index 100% rename from examples/test/gold/log-2xx-syn.golden rename to plugin/test/gold/810/log-2xx-syn.golden diff --git a/examples/test/gold/magSqr-adf-dot.golden b/plugin/test/gold/810/magSqr-adf-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adf-dot.golden rename to plugin/test/gold/810/magSqr-adf-dot.golden diff --git a/examples/test/gold/magSqr-adf-syn.golden b/plugin/test/gold/810/magSqr-adf-syn.golden similarity index 67% rename from examples/test/gold/magSqr-adf-syn.golden rename to plugin/test/gold/810/magSqr-adf-syn.golden index b81df807a..b40ce23d4 100644 --- a/examples/test/gold/magSqr-adf-syn.golden +++ b/plugin/test/gold/810/magSqr-adf-syn.golden @@ -1,13 +1,13 @@ -second coerce . -((addC . exl *** coerce . curry (addC . apply) . coerce . exr) . dup) . +second (id . repr) . +((addC . exl *** abst . curry (addC . apply) . repr . exr) . dup) . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -17,13 +17,13 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -32,11 +32,11 @@ apply . ((exl . exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exl) . dup) . dup) *** @@ -51,11 +51,11 @@ apply . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . exl) . @@ -63,12 +63,12 @@ apply . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -78,19 +78,19 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exl *** coerce . curry (exl . exr)) . dup) . exl . exl) . + ((exl *** abst . curry (exl . exr)) . dup) . exl . exl) . dup) *** - ((exl *** coerce . curry (exl . exr)) . dup) . exr) . + ((exl *** abst . curry (exl . exr)) . dup) . exr) . dup) . dup . exl . exl) . dup) *** @@ -99,11 +99,11 @@ apply . ((exl . exr *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exl) . dup) . dup) *** @@ -118,11 +118,11 @@ apply . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . exl) . @@ -130,11 +130,11 @@ apply . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . apply . @@ -144,19 +144,19 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exr . exr *** + repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exr *** coerce . curry (exr . exr)) . dup) . exl . exl) . + ((exr *** abst . curry (exr . exr)) . dup) . exl . exl) . dup) *** - ((exr *** coerce . curry (exr . exr)) . dup) . exr) . + ((exr *** abst . curry (exr . exr)) . dup) . exr) . dup) . dup . exr) . dup) . diff --git a/examples/test/gold/magSqr-adr-dot.golden b/plugin/test/gold/810/magSqr-adr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adr-dot.golden rename to plugin/test/gold/810/magSqr-adr-dot.golden diff --git a/examples/test/gold/magSqr-adr-syn.golden b/plugin/test/gold/810/magSqr-adr-syn.golden similarity index 65% rename from examples/test/gold/magSqr-adr-syn.golden rename to plugin/test/gold/810/magSqr-adr-syn.golden index 3bb04dd20..dcd75cf3e 100644 --- a/examples/test/gold/magSqr-adr-syn.golden +++ b/plugin/test/gold/810/magSqr-adr-syn.golden @@ -1,5 +1,5 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -8,18 +8,18 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . dup) . dup) *** - ((addC *** coerce . coerce . curry (dup . exr)) . dup) . exl) . + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . dup) . ((exl *** apply . @@ -27,15 +27,15 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -50,15 +50,15 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -70,12 +70,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -84,29 +84,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -117,16 +117,16 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -141,24 +141,23 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exl *** coerce . coerce . curry (((id *** const 0.0) . dup) . exr)) . + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . exl . exl) . dup) *** - ((exl *** coerce . coerce . curry (((id *** const 0.0) . dup) . exr)) . - dup) . + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . exr) . dup) . dup . exl . exl) . @@ -171,12 +170,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -185,29 +184,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -218,16 +217,16 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -242,24 +241,22 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exr *** coerce . coerce . curry (((const 0.0 *** id) . dup) . exr)) . - dup) . + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . exl . exl) . dup) *** - ((exr *** coerce . coerce . curry (((const 0.0 *** id) . dup) . exr)) . - dup) . + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . exr) . dup) . dup . exr) . diff --git a/examples/test/gold/magSqr-dot.golden b/plugin/test/gold/810/magSqr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-dot.golden rename to plugin/test/gold/810/magSqr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-dot.golden b/plugin/test/gold/810/magSqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-gradr-dot.golden rename to plugin/test/gold/810/magSqr-gradr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-syn.golden b/plugin/test/gold/810/magSqr-gradr-syn.golden similarity index 65% rename from examples/test/gold/magSqr-gradr-syn.golden rename to plugin/test/gold/810/magSqr-gradr-syn.golden index dfb62d103..1568a72c2 100644 --- a/examples/test/gold/magSqr-gradr-syn.golden +++ b/plugin/test/gold/810/magSqr-gradr-syn.golden @@ -1,7 +1,7 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -10,18 +10,18 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . dup) . dup) *** - ((addC *** coerce . coerce . curry (dup . exr)) . dup) . exl) . + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . dup) . ((exl *** apply . @@ -29,15 +29,15 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -52,15 +52,15 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** @@ -72,12 +72,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -86,29 +86,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -119,16 +119,16 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -143,24 +143,23 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exl *** coerce . coerce . curry (((id *** const 0.0) . dup) . exr)) . + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . exl . exl) . dup) *** - ((exl *** coerce . coerce . curry (((id *** const 0.0) . dup) . exr)) . - dup) . + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . exr) . dup) . dup . exl . exl) . @@ -173,12 +172,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -187,29 +186,29 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . @@ -220,16 +219,16 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr *** - coerce . - coerce . + abst . + abst . curry (((addC . (exl . exr . exl *** exl . exr) . dup *** addC . (exr . exr . exl *** exr . exr) . dup) . @@ -244,24 +243,22 @@ apply . (((exl . exr *** exl . exr . exl) . dup *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exr . exr *** + repr . repr . exr . exr *** exr . exr . exl) . dup) . dup) *** - ((exr *** coerce . coerce . curry (((const 0.0 *** id) . dup) . exr)) . - dup) . + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . exl . exl) . dup) *** - ((exr *** coerce . coerce . curry (((const 0.0 *** id) . dup) . exr)) . - dup) . + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . exr) . dup) . dup . exr) . diff --git a/examples/test/gold/magSqr-syn.golden b/plugin/test/gold/810/magSqr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-syn.golden rename to plugin/test/gold/810/magSqr-syn.golden diff --git a/plugin/test/gold/810/maximum-derf.golden b/plugin/test/gold/810/maximum-derf.golden new file mode 100644 index 000000000..e347ea3a9 --- /dev/null +++ b/plugin/test/gold/810/maximum-derf.golden @@ -0,0 +1 @@ +(7.0,2.0) \ No newline at end of file diff --git a/plugin/test/gold/810/maximum-derr.golden b/plugin/test/gold/810/maximum-derr.golden new file mode 100644 index 000000000..fd8a49770 --- /dev/null +++ b/plugin/test/gold/810/maximum-derr.golden @@ -0,0 +1 @@ +(7.0,Vector [7.0,7.0,7.0,7.0,7.0]) \ No newline at end of file diff --git a/plugin/test/gold/810/maximum-gradr.golden b/plugin/test/gold/810/maximum-gradr.golden new file mode 100644 index 000000000..d3f5183d7 --- /dev/null +++ b/plugin/test/gold/810/maximum-gradr.golden @@ -0,0 +1 @@ +(7.0,Vector [1.0,1.0,1.0,1.0,1.0]) \ No newline at end of file diff --git a/examples/test/gold/sin-adf-dot.golden b/plugin/test/gold/810/sin-adf-dot.golden similarity index 100% rename from examples/test/gold/sin-adf-dot.golden rename to plugin/test/gold/810/sin-adf-dot.golden diff --git a/plugin/test/gold/810/sin-adf-syn.golden b/plugin/test/gold/810/sin-adf-syn.golden new file mode 100644 index 000000000..c84410931 --- /dev/null +++ b/plugin/test/gold/810/sin-adf-syn.golden @@ -0,0 +1,7 @@ +second (id . repr) . +apply . +(curry + ((exr *** abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/examples/test/gold/sin-adr-dot.golden b/plugin/test/gold/810/sin-adr-dot.golden similarity index 100% rename from examples/test/gold/sin-adr-dot.golden rename to plugin/test/gold/810/sin-adr-dot.golden diff --git a/plugin/test/gold/810/sin-adr-syn.golden b/plugin/test/gold/810/sin-adr-syn.golden new file mode 100644 index 000000000..23b07c29a --- /dev/null +++ b/plugin/test/gold/810/sin-adr-syn.golden @@ -0,0 +1,9 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/examples/test/gold/sin-gradr-dot.golden b/plugin/test/gold/810/sin-gradr-dot.golden similarity index 100% rename from examples/test/gold/sin-gradr-dot.golden rename to plugin/test/gold/810/sin-gradr-dot.golden diff --git a/plugin/test/gold/810/sin-gradr-syn.golden b/plugin/test/gold/810/sin-gradr-syn.golden new file mode 100644 index 000000000..16dcf2193 --- /dev/null +++ b/plugin/test/gold/810/sin-gradr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/examples/test/gold/sqr-adf-dot.golden b/plugin/test/gold/810/sqr-adf-dot.golden similarity index 100% rename from examples/test/gold/sqr-adf-dot.golden rename to plugin/test/gold/810/sqr-adf-dot.golden diff --git a/examples/test/gold/sqr-adf-syn.golden b/plugin/test/gold/810/sqr-adf-syn.golden similarity index 63% rename from examples/test/gold/sqr-adf-syn.golden rename to plugin/test/gold/810/sqr-adf-syn.golden index 781117816..e827d0b55 100644 --- a/examples/test/gold/sqr-adf-syn.golden +++ b/plugin/test/gold/810/sqr-adf-syn.golden @@ -1,12 +1,12 @@ -second coerce . +second (id . repr) . ((exl *** apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . exr *** - coerce . curry (dup . exr)) . + repr . exr *** + abst . curry (dup . exr)) . dup) . dup) . ((mulC *** @@ -20,11 +20,11 @@ second coerce . ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . exl *** - coerce . exr) . + repr . exl *** + repr . exr) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . curry mulC . exr *** + abst . curry mulC . exl) . dup) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/sqr-adr-dot.golden b/plugin/test/gold/810/sqr-adr-dot.golden similarity index 100% rename from examples/test/gold/sqr-adr-dot.golden rename to plugin/test/gold/810/sqr-adr-dot.golden diff --git a/examples/test/gold/sqr-adr-syn.golden b/plugin/test/gold/810/sqr-adr-syn.golden similarity index 57% rename from examples/test/gold/sqr-adr-syn.golden rename to plugin/test/gold/810/sqr-adr-syn.golden index a15d8d32b..f052bad50 100644 --- a/examples/test/gold/sqr-adr-syn.golden +++ b/plugin/test/gold/810/sqr-adr-syn.golden @@ -1,5 +1,5 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -8,12 +8,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -22,31 +22,31 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . dup) . -(dup *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/sqr-dot.golden b/plugin/test/gold/810/sqr-dot.golden similarity index 100% rename from examples/test/gold/sqr-dot.golden rename to plugin/test/gold/810/sqr-dot.golden diff --git a/examples/test/gold/sqr-gradr-dot.golden b/plugin/test/gold/810/sqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/sqr-gradr-dot.golden rename to plugin/test/gold/810/sqr-gradr-dot.golden diff --git a/examples/test/gold/sqr-gradr-syn.golden b/plugin/test/gold/810/sqr-gradr-syn.golden similarity index 56% rename from examples/test/gold/sqr-gradr-syn.golden rename to plugin/test/gold/810/sqr-gradr-syn.golden index 81197dd5d..6ada6a564 100644 --- a/examples/test/gold/sqr-gradr-syn.golden +++ b/plugin/test/gold/810/sqr-gradr-syn.golden @@ -1,7 +1,7 @@ ((exl . id *** - apply . ((coerce . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . dup) . -second coerce . +second (id . repr) . apply . ((curry ((exl . exr *** @@ -10,12 +10,12 @@ apply . curry (apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . coerce . exr *** - coerce . exl) . + repr . repr . exr *** + repr . exl) . dup) . exr . exr *** exr . exl) . @@ -24,31 +24,31 @@ apply . ((mulC *** apply . (curry - (coerce . + (abst . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - coerce . + repr . apply . (coerce . - curry (apply . (exl *** coerce . exr) . dup) . + curry (apply . (exl *** repr . exr) . dup) . curry (curry ((apply . (exl . exl *** exl . exr) . dup *** apply . (exr . exl *** exr . exr) . dup) . dup)) . - coerce . coerce . exl *** - coerce . exr) . + repr . repr . exl *** + repr . exr) . dup *** - coerce . curry (dup . exr)) . + abst . curry (dup . exr)) . dup) . - coerce . curry mulC . exr *** - coerce . curry mulC . exl) . + abst . abst . curry mulC . exr *** + abst . abst . curry mulC . exl) . dup) . dup) . exl) . dup) . -(dup *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/sqr-syn.golden b/plugin/test/gold/810/sqr-syn.golden similarity index 100% rename from examples/test/gold/sqr-syn.golden rename to plugin/test/gold/810/sqr-syn.golden diff --git a/examples/test/gold/twice-adf-dot.golden b/plugin/test/gold/810/twice-adf-dot.golden similarity index 100% rename from examples/test/gold/twice-adf-dot.golden rename to plugin/test/gold/810/twice-adf-dot.golden diff --git a/plugin/test/gold/810/twice-adf-syn.golden b/plugin/test/gold/810/twice-adf-syn.golden new file mode 100644 index 000000000..8e8d72ec1 --- /dev/null +++ b/plugin/test/gold/810/twice-adf-syn.golden @@ -0,0 +1,3 @@ +(addC . dup *** + id . repr . abst . curry (addC . apply) . repr . abst . curry (dup . exr)) . +dup \ No newline at end of file diff --git a/examples/test/gold/twice-adr-dot.golden b/plugin/test/gold/810/twice-adr-dot.golden similarity index 100% rename from examples/test/gold/twice-adr-dot.golden rename to plugin/test/gold/810/twice-adr-dot.golden diff --git a/plugin/test/gold/810/twice-adr-syn.golden b/plugin/test/gold/810/twice-adr-syn.golden new file mode 100644 index 000000000..52e2873c1 --- /dev/null +++ b/plugin/test/gold/810/twice-adr-syn.golden @@ -0,0 +1,24 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/twice-dot.golden b/plugin/test/gold/810/twice-dot.golden similarity index 100% rename from examples/test/gold/twice-dot.golden rename to plugin/test/gold/810/twice-dot.golden diff --git a/examples/test/gold/twice-gradr-dot.golden b/plugin/test/gold/810/twice-gradr-dot.golden similarity index 100% rename from examples/test/gold/twice-gradr-dot.golden rename to plugin/test/gold/810/twice-gradr-dot.golden diff --git a/plugin/test/gold/810/twice-gradr-syn.golden b/plugin/test/gold/810/twice-gradr-syn.golden new file mode 100644 index 000000000..feaa5c507 --- /dev/null +++ b/plugin/test/gold/810/twice-gradr-syn.golden @@ -0,0 +1,26 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/examples/test/gold/twice-syn.golden b/plugin/test/gold/810/twice-syn.golden similarity index 100% rename from examples/test/gold/twice-syn.golden rename to plugin/test/gold/810/twice-syn.golden diff --git a/examples/test/gold/xp3y-dot.golden b/plugin/test/gold/810/xp3y-dot.golden similarity index 100% rename from examples/test/gold/xp3y-dot.golden rename to plugin/test/gold/810/xp3y-dot.golden diff --git a/examples/test/gold/xp3y-syn.golden b/plugin/test/gold/810/xp3y-syn.golden similarity index 100% rename from examples/test/gold/xp3y-syn.golden rename to plugin/test/gold/810/xp3y-syn.golden diff --git a/plugin/test/gold/900/add-adf-dot.golden b/plugin/test/gold/900/add-adf-dot.golden new file mode 100644 index 000000000..296ee412e --- /dev/null +++ b/plugin/test/gold/900/add-adf-dot.golden @@ -0,0 +1,28 @@ +digraph add_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph cluster_5 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c3 [label="{{|}|+|{}}"] + c2 [label="{In|{|}}"] + c4 [label="{{}|Out}"] + c2:Out0 -> c3:In0 [label="Double"] + c2:Out1 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + } + subgraph clusterc6 { label=""; color=white; margin=0; c6 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c6:In0 [label="Double"] + c4 -> c6:In1 [ltail=cluster_5,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/add-adf-syn.golden b/plugin/test/gold/900/add-adf-syn.golden new file mode 100644 index 000000000..d446add70 --- /dev/null +++ b/plugin/test/gold/900/add-adf-syn.golden @@ -0,0 +1 @@ +(addC *** id . repr . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/add-adr-dot.golden b/plugin/test/gold/900/add-adr-dot.golden new file mode 100644 index 000000000..708ec4c99 --- /dev/null +++ b/plugin/test/gold/900/add-adr-dot.golden @@ -0,0 +1,26 @@ +digraph add_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph cluster_4 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c2 [label="{In|{}}"] + c3 [label="{{|}|Out}"] + c2:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + } + subgraph clusterc5 { label=""; color=white; margin=0; c5 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c5:In0 [label="Double"] + c3 -> c5:In1 [ltail=cluster_4,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/add-adr-syn.golden b/plugin/test/gold/900/add-adr-syn.golden new file mode 100644 index 000000000..5c74c0f36 --- /dev/null +++ b/plugin/test/gold/900/add-adr-syn.golden @@ -0,0 +1,2 @@ +((exl . id *** repr . exr . id) . dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/add-dot.golden b/plugin/test/gold/900/add-dot.golden new file mode 100644 index 000000000..7b4f837a8 --- /dev/null +++ b/plugin/test/gold/900/add-dot.golden @@ -0,0 +1,24 @@ +digraph add { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph cluster_4 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c2 [label="{{|}|+|{}}"] + c1 [label="{In|{}}"] + c3 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c2:Out0 -> c3:In0 [label="Double"] + } + subgraph clusterc5 { label=""; color=white; margin=0; c5 [label="{{}|Out}"] } + c3 -> c5:In0 [ltail=cluster_4,label="Double Double"] +} diff --git a/plugin/test/gold/900/add-gradr-dot.golden b/plugin/test/gold/900/add-gradr-dot.golden new file mode 100644 index 000000000..82746d290 --- /dev/null +++ b/plugin/test/gold/900/add-gradr-dot.golden @@ -0,0 +1,18 @@ +digraph add_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|+|{}}"] + c5 [label="{1.0|{}}"] + c6 [label="{{||}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c6:In0 [label="Double"] + c5:Out0 -> c6:In1 [label="Double"] + c5:Out0 -> c6:In2 [label="Double"] +} diff --git a/plugin/test/gold/900/add-gradr-syn.golden b/plugin/test/gold/900/add-gradr-syn.golden new file mode 100644 index 000000000..0c5076e9d --- /dev/null +++ b/plugin/test/gold/900/add-gradr-syn.golden @@ -0,0 +1,4 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/add-syn.golden b/plugin/test/gold/900/add-syn.golden new file mode 100644 index 000000000..d543240d0 --- /dev/null +++ b/plugin/test/gold/900/add-syn.golden @@ -0,0 +1 @@ +curry addC \ No newline at end of file diff --git a/plugin/test/gold/900/add-uncurry-dot.golden b/plugin/test/gold/900/add-uncurry-dot.golden new file mode 100644 index 000000000..e7c658907 --- /dev/null +++ b/plugin/test/gold/900/add-uncurry-dot.golden @@ -0,0 +1,15 @@ +digraph add_uncurry { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c5 [label="{{|}|+|{}}"] + c6 [label="{{}|Out}"] + c0:Out0 -> c5:In0 [label="Double"] + c0:Out1 -> c5:In1 [label="Double"] + c5:Out0 -> c6:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/add-uncurry-syn.golden b/plugin/test/gold/900/add-uncurry-syn.golden new file mode 100644 index 000000000..c4a4e4847 --- /dev/null +++ b/plugin/test/gold/900/add-uncurry-syn.golden @@ -0,0 +1 @@ +apply . (curry addC . exl *** exr) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/complex-mul-dot.golden b/plugin/test/gold/900/complex-mul-dot.golden new file mode 100644 index 000000000..2f88826f1 --- /dev/null +++ b/plugin/test/gold/900/complex-mul-dot.golden @@ -0,0 +1,31 @@ +digraph complex_mul { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|||}}"] + c10 [label="{{|}|\|{}}"] + c11 [label="{{|}|\|{}}"] + c12 [label="{{|}|\|{}}"] + c13 [label="{{|}|\|{}}"] + c14 [label="{{|}|\|{}}"] + c15 [label="{{|}|+|{}}"] + c16 [label="{{|}|Out}"] + c0:Out0 -> c10:In0 [label="Double"] + c0:Out2 -> c10:In1 [label="Double"] + c0:Out1 -> c11:In0 [label="Double"] + c0:Out3 -> c11:In1 [label="Double"] + c10:Out0 -> c12:In0 [label="Double"] + c11:Out0 -> c12:In1 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c0:Out3 -> c13:In1 [label="Double"] + c0:Out1 -> c14:In0 [label="Double"] + c0:Out2 -> c14:In1 [label="Double"] + c13:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c15:In1 [label="Double"] + c12:Out0 -> c16:In0 [label="Double"] + c15:Out0 -> c16:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/complex-mul-syn.golden b/plugin/test/gold/900/complex-mul-syn.golden new file mode 100644 index 000000000..77b77100d --- /dev/null +++ b/plugin/test/gold/900/complex-mul-syn.golden @@ -0,0 +1,17 @@ +apply . +(curry + (abst . + ((subC . + (mulC . (exl . exr . exl *** exl . exr) . dup *** + mulC . (exr . exr . exl *** exr . exr) . dup) . + dup *** + addC . + (mulC . (exl . exr . exl *** exr . exr) . dup *** + mulC . (exr . exr . exl *** exl . exr) . dup) . + dup) . + dup) . + ((id *** repr . exr . exr . exl) . dup) . + ((id *** repr . exl . exr) . dup) . dup) . + exl *** + exr) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2x-adf-dot.golden b/plugin/test/gold/900/cos-2x-adf-dot.golden new file mode 100644 index 000000000..20339b5e8 --- /dev/null +++ b/plugin/test/gold/900/cos-2x-adf-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2x_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc77 { label=""; color=white; margin=0; c77 [label="{2.0|{}}"] } + subgraph clusterc142 { label=""; color=white; margin=0; c142 [label="{{|}|\|{}}"] } + subgraph clusterc253 { label=""; color=white; margin=0; c253 [label="{{}|cos|{}}"] } + subgraph clusterc254 { label=""; color=white; margin=0; c254 [label="{{}|sin|{}}"] } + subgraph cluster_287 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c283 [label="{{|}|\|{}}"] + c284 [label="{{|}|\|{}}"] + c282 [label="{In|{}}"] + c286 [label="{{}|Out}"] + c285 [label="{{}|negate|{}}"] + c77:Out0 -> c283:In0 [label="Double"] + c282:Out0 -> c283:In1 [label="Double"] + c254:Out0 -> c284:In0 [label="Double"] + c283:Out0 -> c284:In1 [label="Double"] + c285:Out0 -> c286:In0 [label="Double"] + c284:Out0 -> c285:In0 [label="Double"] + } + subgraph clusterc288 { label=""; color=white; margin=0; c288 [label="{{|}|Out}"] } + c0:Out0 -> c142:In0 [label="Double"] + c77:Out0 -> c142:In1 [label="Double"] + c142:Out0 -> c253:In0 [label="Double"] + c142:Out0 -> c254:In0 [label="Double"] + c253:Out0 -> c288:In0 [label="Double"] + c286 -> c288:In1 [ltail=cluster_287,label="Double Double"] +} diff --git a/plugin/test/gold/900/cos-2x-adf-syn.golden b/plugin/test/gold/900/cos-2x-adf-syn.golden new file mode 100644 index 000000000..1a093f262 --- /dev/null +++ b/plugin/test/gold/900/cos-2x-adf-syn.golden @@ -0,0 +1,88 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2x-adr-dot.golden b/plugin/test/gold/900/cos-2x-adr-dot.golden new file mode 100644 index 000000000..eaeb85285 --- /dev/null +++ b/plugin/test/gold/900/cos-2x-adr-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2x_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc109 { label=""; color=white; margin=0; c109 [label="{2.0|{}}"] } + subgraph clusterc243 { label=""; color=white; margin=0; c243 [label="{{|}|\|{}}"] } + subgraph clusterc463 { label=""; color=white; margin=0; c463 [label="{{}|cos|{}}"] } + subgraph clusterc464 { label=""; color=white; margin=0; c464 [label="{{}|sin|{}}"] } + subgraph cluster_528 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c524 [label="{{|}|\|{}}"] + c520 [label="{{|}|\|{}}"] + c519 [label="{In|{}}"] + c527 [label="{{}|Out}"] + c525 [label="{{}|negate|{}}"] + c109:Out0 -> c524:In0 [label="Double"] + c520:Out0 -> c524:In1 [label="Double"] + c464:Out0 -> c520:In0 [label="Double"] + c519:Out0 -> c520:In1 [label="Double"] + c525:Out0 -> c527:In0 [label="Double"] + c524:Out0 -> c525:In0 [label="Double"] + } + subgraph clusterc529 { label=""; color=white; margin=0; c529 [label="{{|}|Out}"] } + c0:Out0 -> c243:In0 [label="Double"] + c109:Out0 -> c243:In1 [label="Double"] + c243:Out0 -> c463:In0 [label="Double"] + c243:Out0 -> c464:In0 [label="Double"] + c463:Out0 -> c529:In0 [label="Double"] + c527 -> c529:In1 [ltail=cluster_528,label="Double Double"] +} diff --git a/plugin/test/gold/900/cos-2x-adr-syn.golden b/plugin/test/gold/900/cos-2x-adr-syn.golden new file mode 100644 index 000000000..bbe23cf19 --- /dev/null +++ b/plugin/test/gold/900/cos-2x-adr-syn.golden @@ -0,0 +1,126 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2x-gradr-dot.golden b/plugin/test/gold/900/cos-2x-gradr-dot.golden new file mode 100644 index 000000000..4882aa74c --- /dev/null +++ b/plugin/test/gold/900/cos-2x-gradr-dot.golden @@ -0,0 +1,26 @@ +digraph cos_2x_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c109 [label="{2.0|{}}"] + c243 [label="{{|}|\|{}}"] + c463 [label="{{}|cos|{}}"] + c464 [label="{{}|sin|{}}"] + c532 [label="{{|}|\|{}}"] + c533 [label="{{}|negate|{}}"] + c534 [label="{{|}|Out}"] + c0:Out0 -> c243:In0 [label="Double"] + c109:Out0 -> c243:In1 [label="Double"] + c243:Out0 -> c463:In0 [label="Double"] + c243:Out0 -> c464:In0 [label="Double"] + c109:Out0 -> c532:In0 [label="Double"] + c464:Out0 -> c532:In1 [label="Double"] + c532:Out0 -> c533:In0 [label="Double"] + c463:Out0 -> c534:In0 [label="Double"] + c533:Out0 -> c534:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/cos-2x-gradr-syn.golden b/plugin/test/gold/900/cos-2x-gradr-syn.golden new file mode 100644 index 000000000..0393e913d --- /dev/null +++ b/plugin/test/gold/900/cos-2x-gradr-syn.golden @@ -0,0 +1,128 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-adf-dot.golden b/plugin/test/gold/900/cos-2xx-adf-dot.golden new file mode 100644 index 000000000..8ea7e8eca --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-adf-dot.golden @@ -0,0 +1,50 @@ +digraph cos_2xx_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc366 { label=""; color=white; margin=0; c366 [label="{2.0|{}}"] } + subgraph clusterc431 { label=""; color=white; margin=0; c431 [label="{{|}|\|{}}"] } + subgraph clusterc572 { label=""; color=white; margin=0; c572 [label="{{|}|\|{}}"] } + subgraph clusterc689 { label=""; color=white; margin=0; c689 [label="{{}|cos|{}}"] } + subgraph clusterc690 { label=""; color=white; margin=0; c690 [label="{{}|sin|{}}"] } + subgraph cluster_726 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c720 [label="{{|}|\|{}}"] + c719 [label="{{|}|\|{}}"] + c721 [label="{{|}|\|{}}"] + c723 [label="{{|}|\|{}}"] + c722 [label="{{|}|+|{}}"] + c718 [label="{In|{}}"] + c725 [label="{{}|Out}"] + c724 [label="{{}|negate|{}}"] + c0:Out0 -> c720:In0 [label="Double"] + c719:Out0 -> c720:In1 [label="Double"] + c366:Out0 -> c719:In0 [label="Double"] + c718:Out0 -> c719:In1 [label="Double"] + c431:Out0 -> c721:In0 [label="Double"] + c718:Out0 -> c721:In1 [label="Double"] + c690:Out0 -> c723:In0 [label="Double"] + c722:Out0 -> c723:In1 [label="Double"] + c720:Out0 -> c722:In0 [label="Double"] + c721:Out0 -> c722:In1 [label="Double"] + c724:Out0 -> c725:In0 [label="Double"] + c723:Out0 -> c724:In0 [label="Double"] + } + subgraph clusterc727 { label=""; color=white; margin=0; c727 [label="{{|}|Out}"] } + c0:Out0 -> c431:In0 [label="Double"] + c366:Out0 -> c431:In1 [label="Double"] + c0:Out0 -> c572:In0 [label="Double"] + c431:Out0 -> c572:In1 [label="Double"] + c572:Out0 -> c689:In0 [label="Double"] + c572:Out0 -> c690:In0 [label="Double"] + c689:Out0 -> c727:In0 [label="Double"] + c725 -> c727:In1 [ltail=cluster_726,label="Double Double"] +} diff --git a/plugin/test/gold/900/cos-2xx-adf-syn.golden b/plugin/test/gold/900/cos-2xx-adf-syn.golden new file mode 100644 index 000000000..e4689af77 --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-adf-syn.golden @@ -0,0 +1,155 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-adr-dot.golden b/plugin/test/gold/900/cos-2xx-adr-dot.golden new file mode 100644 index 000000000..1e0de33dc --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-adr-dot.golden @@ -0,0 +1,50 @@ +digraph cos_2xx_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc610 { label=""; color=white; margin=0; c610 [label="{2.0|{}}"] } + subgraph clusterc744 { label=""; color=white; margin=0; c744 [label="{{|}|\|{}}"] } + subgraph clusterc1043 { label=""; color=white; margin=0; c1043 [label="{{|}|\|{}}"] } + subgraph clusterc1281 { label=""; color=white; margin=0; c1281 [label="{{}|cos|{}}"] } + subgraph clusterc1282 { label=""; color=white; margin=0; c1282 [label="{{}|sin|{}}"] } + subgraph cluster_1358 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1346 [label="{{|}|\|{}}"] + c1352 [label="{{|}|\|{}}"] + c1348 [label="{{|}|\|{}}"] + c1344 [label="{{|}|\|{}}"] + c1355 [label="{{|}|+|{}}"] + c1343 [label="{In|{}}"] + c1357 [label="{{}|Out}"] + c1356 [label="{{}|negate|{}}"] + c0:Out0 -> c1346:In0 [label="Double"] + c1344:Out0 -> c1346:In1 [label="Double"] + c610:Out0 -> c1352:In0 [label="Double"] + c1346:Out0 -> c1352:In1 [label="Double"] + c744:Out0 -> c1348:In0 [label="Double"] + c1344:Out0 -> c1348:In1 [label="Double"] + c1282:Out0 -> c1344:In0 [label="Double"] + c1343:Out0 -> c1344:In1 [label="Double"] + c1348:Out0 -> c1355:In0 [label="Double"] + c1352:Out0 -> c1355:In1 [label="Double"] + c1356:Out0 -> c1357:In0 [label="Double"] + c1355:Out0 -> c1356:In0 [label="Double"] + } + subgraph clusterc1359 { label=""; color=white; margin=0; c1359 [label="{{|}|Out}"] } + c0:Out0 -> c744:In0 [label="Double"] + c610:Out0 -> c744:In1 [label="Double"] + c0:Out0 -> c1043:In0 [label="Double"] + c744:Out0 -> c1043:In1 [label="Double"] + c1043:Out0 -> c1281:In0 [label="Double"] + c1043:Out0 -> c1282:In0 [label="Double"] + c1281:Out0 -> c1359:In0 [label="Double"] + c1357 -> c1359:In1 [ltail=cluster_1358,label="Double Double"] +} diff --git a/plugin/test/gold/900/cos-2xx-adr-syn.golden b/plugin/test/gold/900/cos-2xx-adr-syn.golden new file mode 100644 index 000000000..af35a5dfb --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-adr-syn.golden @@ -0,0 +1,218 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-dot.golden b/plugin/test/gold/900/cos-2xx-dot.golden new file mode 100644 index 000000000..ab90b5f50 --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-dot.golden @@ -0,0 +1,21 @@ +digraph cos_2xx { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{2.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|\|{}}"] + c4 [label="{{}|cos|{}}"] + c5 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + c4:Out0 -> c5:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/cos-2xx-gradr-dot.golden b/plugin/test/gold/900/cos-2xx-gradr-dot.golden new file mode 100644 index 000000000..a2b562057 --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-gradr-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2xx_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c610 [label="{2.0|{}}"] + c744 [label="{{|}|\|{}}"] + c1043 [label="{{|}|\|{}}"] + c1281 [label="{{}|cos|{}}"] + c1282 [label="{{}|sin|{}}"] + c1360 [label="{{|}|\|{}}"] + c1362 [label="{{|}|\|{}}"] + c1366 [label="{{|}|\|{}}"] + c1368 [label="{{|}|+|{}}"] + c1369 [label="{{}|negate|{}}"] + c1370 [label="{{|}|Out}"] + c0:Out0 -> c744:In0 [label="Double"] + c610:Out0 -> c744:In1 [label="Double"] + c0:Out0 -> c1043:In0 [label="Double"] + c744:Out0 -> c1043:In1 [label="Double"] + c1043:Out0 -> c1281:In0 [label="Double"] + c1043:Out0 -> c1282:In0 [label="Double"] + c0:Out0 -> c1360:In0 [label="Double"] + c1282:Out0 -> c1360:In1 [label="Double"] + c744:Out0 -> c1362:In0 [label="Double"] + c1282:Out0 -> c1362:In1 [label="Double"] + c610:Out0 -> c1366:In0 [label="Double"] + c1360:Out0 -> c1366:In1 [label="Double"] + c1362:Out0 -> c1368:In0 [label="Double"] + c1366:Out0 -> c1368:In1 [label="Double"] + c1368:Out0 -> c1369:In0 [label="Double"] + c1281:Out0 -> c1370:In0 [label="Double"] + c1369:Out0 -> c1370:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/cos-2xx-gradr-syn.golden b/plugin/test/gold/900/cos-2xx-gradr-syn.golden new file mode 100644 index 000000000..01de18c11 --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-gradr-syn.golden @@ -0,0 +1,220 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-syn.golden b/plugin/test/gold/900/cos-2xx-syn.golden new file mode 100644 index 000000000..6c236aa23 --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-syn.golden @@ -0,0 +1 @@ +cosC . mulC . (mulC . (const 2.0 *** id) . dup *** id) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-adf-dot.golden b/plugin/test/gold/900/cos-adf-dot.golden new file mode 100644 index 000000000..1b4deacfb --- /dev/null +++ b/plugin/test/gold/900/cos-adf-dot.golden @@ -0,0 +1,31 @@ +digraph cos_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc14 { label=""; color=white; margin=0; c14 [label="{{}|cos|{}}"] } + subgraph clusterc15 { label=""; color=white; margin=0; c15 [label="{{}|sin|{}}"] } + subgraph cluster_24 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c21 [label="{{|}|\|{}}"] + c20 [label="{In|{}}"] + c23 [label="{{}|Out}"] + c22 [label="{{}|negate|{}}"] + c15:Out0 -> c21:In0 [label="Double"] + c20:Out0 -> c21:In1 [label="Double"] + c22:Out0 -> c23:In0 [label="Double"] + c21:Out0 -> c22:In0 [label="Double"] + } + subgraph clusterc25 { label=""; color=white; margin=0; c25 [label="{{|}|Out}"] } + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c25:In0 [label="Double"] + c23 -> c25:In1 [ltail=cluster_24,label="Double Double"] +} diff --git a/examples/test/gold/cos-adr-syn.golden b/plugin/test/gold/900/cos-adf-syn.golden similarity index 63% rename from examples/test/gold/cos-adr-syn.golden rename to plugin/test/gold/900/cos-adf-syn.golden index 1b315fbb2..1adb56320 100644 --- a/examples/test/gold/cos-adr-syn.golden +++ b/plugin/test/gold/900/cos-adf-syn.golden @@ -1,9 +1,8 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +second (id . repr) . apply . (curry ((exr *** - coerce . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . diff --git a/plugin/test/gold/900/cos-adr-dot.golden b/plugin/test/gold/900/cos-adr-dot.golden new file mode 100644 index 000000000..52707dac9 --- /dev/null +++ b/plugin/test/gold/900/cos-adr-dot.golden @@ -0,0 +1,31 @@ +digraph cos_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc14 { label=""; color=white; margin=0; c14 [label="{{}|cos|{}}"] } + subgraph clusterc15 { label=""; color=white; margin=0; c15 [label="{{}|sin|{}}"] } + subgraph cluster_24 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c21 [label="{{|}|\|{}}"] + c20 [label="{In|{}}"] + c23 [label="{{}|Out}"] + c22 [label="{{}|negate|{}}"] + c15:Out0 -> c21:In0 [label="Double"] + c20:Out0 -> c21:In1 [label="Double"] + c22:Out0 -> c23:In0 [label="Double"] + c21:Out0 -> c22:In0 [label="Double"] + } + subgraph clusterc25 { label=""; color=white; margin=0; c25 [label="{{|}|Out}"] } + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c25:In0 [label="Double"] + c23 -> c25:In1 [ltail=cluster_24,label="Double Double"] +} diff --git a/plugin/test/gold/900/cos-adr-syn.golden b/plugin/test/gold/900/cos-adr-syn.golden new file mode 100644 index 000000000..1d1eac293 --- /dev/null +++ b/plugin/test/gold/900/cos-adr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-gradr-dot.golden b/plugin/test/gold/900/cos-gradr-dot.golden new file mode 100644 index 000000000..bec73cbf9 --- /dev/null +++ b/plugin/test/gold/900/cos-gradr-dot.golden @@ -0,0 +1,19 @@ +digraph cos_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c14 [label="{{}|cos|{}}"] + c15 [label="{{}|sin|{}}"] + c16 [label="{{}|negate|{}}"] + c26 [label="{{|}|Out}"] + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c15:Out0 -> c16:In0 [label="Double"] + c14:Out0 -> c26:In0 [label="Double"] + c16:Out0 -> c26:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/cos-gradr-syn.golden b/plugin/test/gold/900/cos-gradr-syn.golden new file mode 100644 index 000000000..092301088 --- /dev/null +++ b/plugin/test/gold/900/cos-gradr-syn.golden @@ -0,0 +1,13 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-xpy-adf-dot.golden b/plugin/test/gold/900/cos-xpy-adf-dot.golden new file mode 100644 index 000000000..e89e109f3 --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-adf-dot.golden @@ -0,0 +1,37 @@ +digraph cos_xpy_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph clusterc43 { label=""; color=white; margin=0; c43 [label="{{}|cos|{}}"] } + subgraph clusterc44 { label=""; color=white; margin=0; c44 [label="{{}|sin|{}}"] } + subgraph cluster_77 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c74 [label="{{|}|\|{}}"] + c73 [label="{{|}|+|{}}"] + c72 [label="{In|{|}}"] + c76 [label="{{}|Out}"] + c75 [label="{{}|negate|{}}"] + c44:Out0 -> c74:In0 [label="Double"] + c73:Out0 -> c74:In1 [label="Double"] + c72:Out0 -> c73:In0 [label="Double"] + c72:Out1 -> c73:In1 [label="Double"] + c75:Out0 -> c76:In0 [label="Double"] + c74:Out0 -> c75:In0 [label="Double"] + } + subgraph clusterc78 { label=""; color=white; margin=0; c78 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c43:In0 [label="Double"] + c1:Out0 -> c44:In0 [label="Double"] + c43:Out0 -> c78:In0 [label="Double"] + c76 -> c78:In1 [ltail=cluster_77,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/cos-xpy-adf-syn.golden b/plugin/test/gold/900/cos-xpy-adf-syn.golden new file mode 100644 index 000000000..f9c57c951 --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-adf-syn.golden @@ -0,0 +1,24 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +(addC *** abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-xpy-adr-dot.golden b/plugin/test/gold/900/cos-xpy-adr-dot.golden new file mode 100644 index 000000000..7b42f75d7 --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-adr-dot.golden @@ -0,0 +1,35 @@ +digraph cos_xpy_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph clusterc63 { label=""; color=white; margin=0; c63 [label="{{}|cos|{}}"] } + subgraph clusterc64 { label=""; color=white; margin=0; c64 [label="{{}|sin|{}}"] } + subgraph cluster_117 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c114 [label="{{|}|\|{}}"] + c113 [label="{In|{}}"] + c116 [label="{{|}|Out}"] + c115 [label="{{}|negate|{}}"] + c64:Out0 -> c114:In0 [label="Double"] + c113:Out0 -> c114:In1 [label="Double"] + c115:Out0 -> c116:In0 [label="Double"] + c115:Out0 -> c116:In1 [label="Double"] + c114:Out0 -> c115:In0 [label="Double"] + } + subgraph clusterc118 { label=""; color=white; margin=0; c118 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c63:In0 [label="Double"] + c1:Out0 -> c64:In0 [label="Double"] + c63:Out0 -> c118:In0 [label="Double"] + c116 -> c118:In1 [ltail=cluster_117,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/cos-xpy-adr-syn.golden b/plugin/test/gold/900/cos-xpy-adr-syn.golden new file mode 100644 index 000000000..14d7164aa --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-adr-syn.golden @@ -0,0 +1,33 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-xpy-gradr-dot.golden b/plugin/test/gold/900/cos-xpy-gradr-dot.golden new file mode 100644 index 000000000..0128caf25 --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-gradr-dot.golden @@ -0,0 +1,23 @@ +digraph cos_xpy_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|+|{}}"] + c63 [label="{{}|cos|{}}"] + c64 [label="{{}|sin|{}}"] + c65 [label="{{}|negate|{}}"] + c119 [label="{{||}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c63:In0 [label="Double"] + c1:Out0 -> c64:In0 [label="Double"] + c64:Out0 -> c65:In0 [label="Double"] + c63:Out0 -> c119:In0 [label="Double"] + c65:Out0 -> c119:In1 [label="Double"] + c65:Out0 -> c119:In2 [label="Double"] +} diff --git a/plugin/test/gold/900/cos-xpy-gradr-syn.golden b/plugin/test/gold/900/cos-xpy-gradr-syn.golden new file mode 100644 index 000000000..2d5985c7a --- /dev/null +++ b/plugin/test/gold/900/cos-xpy-gradr-syn.golden @@ -0,0 +1,35 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cosSinProd-dot.golden b/plugin/test/gold/900/cosSinProd-dot.golden new file mode 100644 index 000000000..3cf075e6f --- /dev/null +++ b/plugin/test/gold/900/cosSinProd-dot.golden @@ -0,0 +1,20 @@ +digraph cosSinProd { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{}|cos|{}}"] + c3 [label="{{}|sin|{}}"] + c4 [label="{{|}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c4:In0 [label="Double"] + c3:Out0 -> c4:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/cosSinProd-syn.golden b/plugin/test/gold/900/cosSinProd-syn.golden new file mode 100644 index 000000000..7b9515000 --- /dev/null +++ b/plugin/test/gold/900/cosSinProd-syn.golden @@ -0,0 +1 @@ +((cosC *** sinC) . dup) . mulC \ No newline at end of file diff --git a/plugin/test/gold/900/dup-dot.golden b/plugin/test/gold/900/dup-dot.golden new file mode 100644 index 000000000..ed6525c84 --- /dev/null +++ b/plugin/test/gold/900/dup-dot.golden @@ -0,0 +1,13 @@ +digraph dup { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/dup-syn.golden b/plugin/test/gold/900/dup-syn.golden new file mode 100644 index 000000000..5d487a853 --- /dev/null +++ b/plugin/test/gold/900/dup-syn.golden @@ -0,0 +1 @@ +dup \ No newline at end of file diff --git a/plugin/test/gold/900/fst-dot.golden b/plugin/test/gold/900/fst-dot.golden new file mode 100644 index 000000000..01f192d8b --- /dev/null +++ b/plugin/test/gold/900/fst-dot.golden @@ -0,0 +1,12 @@ +digraph fst { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/fst-syn.golden b/plugin/test/gold/900/fst-syn.golden new file mode 100644 index 000000000..438c6f210 --- /dev/null +++ b/plugin/test/gold/900/fst-syn.golden @@ -0,0 +1 @@ +exl \ No newline at end of file diff --git a/plugin/test/gold/900/horner-dot.golden b/plugin/test/gold/900/horner-dot.golden new file mode 100644 index 000000000..4c99cd781 --- /dev/null +++ b/plugin/test/gold/900/horner-dot.golden @@ -0,0 +1,27 @@ +digraph horner { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{1.0|{}}"] + c2 [label="{3.0|{}}"] + c3 [label="{5.0|{}}"] + c5 [label="{{|}|\|{}}"] + c6 [label="{{|}|+|{}}"] + c7 [label="{{|}|\|{}}"] + c8 [label="{{|}|+|{}}"] + c9 [label="{{}|Out}"] + c0:Out0 -> c5:In0 [label="Double"] + c3:Out0 -> c5:In1 [label="Double"] + c2:Out0 -> c6:In0 [label="Double"] + c5:Out0 -> c6:In1 [label="Double"] + c0:Out0 -> c7:In0 [label="Double"] + c6:Out0 -> c7:In1 [label="Double"] + c1:Out0 -> c8:In0 [label="Double"] + c7:Out0 -> c8:In1 [label="Double"] + c8:Out0 -> c9:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/horner-syn.golden b/plugin/test/gold/900/horner-syn.golden new file mode 100644 index 000000000..dc3a83964 --- /dev/null +++ b/plugin/test/gold/900/horner-syn.golden @@ -0,0 +1,12 @@ +addC . +(const 1.0 *** + mulC . + (id *** + addC . + (const 3.0 *** + mulC . + (id *** addC . (const 5.0 *** mulC . (id *** const 0.0) . dup) . dup) . + dup) . + dup) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/log-2xx-dot.golden b/plugin/test/gold/900/log-2xx-dot.golden new file mode 100644 index 000000000..1e8454d6c --- /dev/null +++ b/plugin/test/gold/900/log-2xx-dot.golden @@ -0,0 +1,21 @@ +digraph log_2xx { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{2.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|\|{}}"] + c4 [label="{{}|log|{}}"] + c5 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + c4:Out0 -> c5:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/log-2xx-syn.golden b/plugin/test/gold/900/log-2xx-syn.golden new file mode 100644 index 000000000..58d8e5c25 --- /dev/null +++ b/plugin/test/gold/900/log-2xx-syn.golden @@ -0,0 +1 @@ +logC . mulC . (mulC . (const 2.0 *** id) . dup *** id) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/magSqr-adf-dot.golden b/plugin/test/gold/900/magSqr-adf-dot.golden new file mode 100644 index 000000000..f9b3fa467 --- /dev/null +++ b/plugin/test/gold/900/magSqr-adf-dot.golden @@ -0,0 +1,46 @@ +digraph magSqr_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc513 { label=""; color=white; margin=0; c513 [label="{{|}|\|{}}"] } + subgraph clusterc793 { label=""; color=white; margin=0; c793 [label="{{|}|\|{}}"] } + subgraph clusterc981 { label=""; color=white; margin=0; c981 [label="{{|}|+|{}}"] } + subgraph cluster_1009 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1003 [label="{{|}|\|{}}"] + c1005 [label="{{|}|\|{}}"] + c1004 [label="{{|}|+|{}}"] + c1007 [label="{{|}|+|{}}"] + c1006 [label="{{|}|+|{}}"] + c1002 [label="{In|{|}}"] + c1008 [label="{{}|Out}"] + c0:Out0 -> c1003:In0 [label="Double"] + c1002:Out0 -> c1003:In1 [label="Double"] + c0:Out1 -> c1005:In0 [label="Double"] + c1002:Out1 -> c1005:In1 [label="Double"] + c1003:Out0 -> c1004:In0 [label="Double"] + c1003:Out0 -> c1004:In1 [label="Double"] + c1004:Out0 -> c1007:In0 [label="Double"] + c1006:Out0 -> c1007:In1 [label="Double"] + c1005:Out0 -> c1006:In0 [label="Double"] + c1005:Out0 -> c1006:In1 [label="Double"] + c1007:Out0 -> c1008:In0 [label="Double"] + } + subgraph clusterc1010 { label=""; color=white; margin=0; c1010 [label="{{|}|Out}"] } + c0:Out1 -> c513:In0 [label="Double"] + c0:Out1 -> c513:In1 [label="Double"] + c0:Out0 -> c793:In0 [label="Double"] + c0:Out0 -> c793:In1 [label="Double"] + c513:Out0 -> c981:In0 [label="Double"] + c793:Out0 -> c981:In1 [label="Double"] + c981:Out0 -> c1010:In0 [label="Double"] + c1008 -> c1010:In1 [ltail=cluster_1009,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/magSqr-adf-syn.golden b/plugin/test/gold/900/magSqr-adf-syn.golden new file mode 100644 index 000000000..519a449e0 --- /dev/null +++ b/plugin/test/gold/900/magSqr-adf-syn.golden @@ -0,0 +1,223 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . curry (addC . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exl . exr . exl) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** abst . curry (exr . exr)) . dup) . exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exl . exr . exl) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** abst . curry (exr . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/magSqr-adr-dot.golden b/plugin/test/gold/900/magSqr-adr-dot.golden new file mode 100644 index 000000000..235748b01 --- /dev/null +++ b/plugin/test/gold/900/magSqr-adr-dot.golden @@ -0,0 +1,44 @@ +digraph magSqr_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc956 { label=""; color=white; margin=0; c956 [label="{{|}|\|{}}"] } + subgraph clusterc1480 { label=""; color=white; margin=0; c1480 [label="{{|}|\|{}}"] } + subgraph clusterc1850 { label=""; color=white; margin=0; c1850 [label="{{|}|+|{}}"] } + subgraph cluster_1908 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1902 [label="{{|}|\|{}}"] + c1905 [label="{{|}|\|{}}"] + c1904 [label="{{|}|+|{}}"] + c1906 [label="{{|}|+|{}}"] + c1901 [label="{In|{}}"] + c1907 [label="{{|}|Out}"] + c0:Out0 -> c1902:In0 [label="Double"] + c1901:Out0 -> c1902:In1 [label="Double"] + c0:Out1 -> c1905:In0 [label="Double"] + c1901:Out0 -> c1905:In1 [label="Double"] + c1902:Out0 -> c1904:In0 [label="Double"] + c1902:Out0 -> c1904:In1 [label="Double"] + c1905:Out0 -> c1906:In0 [label="Double"] + c1905:Out0 -> c1906:In1 [label="Double"] + c1904:Out0 -> c1907:In0 [label="Double"] + c1906:Out0 -> c1907:In1 [label="Double"] + } + subgraph clusterc1909 { label=""; color=white; margin=0; c1909 [label="{{|}|Out}"] } + c0:Out1 -> c956:In0 [label="Double"] + c0:Out1 -> c956:In1 [label="Double"] + c0:Out0 -> c1480:In0 [label="Double"] + c0:Out0 -> c1480:In1 [label="Double"] + c956:Out0 -> c1850:In0 [label="Double"] + c1480:Out0 -> c1850:In1 [label="Double"] + c1850:Out0 -> c1909:In0 [label="Double"] + c1907 -> c1909:In1 [ltail=cluster_1908,label="Double Double Double"] +} diff --git a/plugin/test/gold/900/magSqr-adr-syn.golden b/plugin/test/gold/900/magSqr-adr-syn.golden new file mode 100644 index 000000000..ff7eee668 --- /dev/null +++ b/plugin/test/gold/900/magSqr-adr-syn.golden @@ -0,0 +1,360 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exl . exr . exl) . dup) . (id *** exl . exr . exl) . dup *** + ((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exr . exl) . dup) . (id *** exr . exr . exl) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/magSqr-dot.golden b/plugin/test/gold/900/magSqr-dot.golden new file mode 100644 index 000000000..6beba561e --- /dev/null +++ b/plugin/test/gold/900/magSqr-dot.golden @@ -0,0 +1,21 @@ +digraph magSqr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|+|{}}"] + c4 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c0:Out1 -> c2:In0 [label="Double"] + c0:Out1 -> c2:In1 [label="Double"] + c1:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/magSqr-gradr-dot.golden b/plugin/test/gold/900/magSqr-gradr-dot.golden new file mode 100644 index 000000000..54141195b --- /dev/null +++ b/plugin/test/gold/900/magSqr-gradr-dot.golden @@ -0,0 +1,29 @@ +digraph magSqr_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c956 [label="{{|}|\|{}}"] + c1480 [label="{{|}|\|{}}"] + c1850 [label="{{|}|+|{}}"] + c1911 [label="{{|}|+|{}}"] + c1912 [label="{{|}|+|{}}"] + c1913 [label="{{||}|Out}"] + c0:Out1 -> c956:In0 [label="Double"] + c0:Out1 -> c956:In1 [label="Double"] + c0:Out0 -> c1480:In0 [label="Double"] + c0:Out0 -> c1480:In1 [label="Double"] + c956:Out0 -> c1850:In0 [label="Double"] + c1480:Out0 -> c1850:In1 [label="Double"] + c0:Out0 -> c1911:In0 [label="Double"] + c0:Out0 -> c1911:In1 [label="Double"] + c0:Out1 -> c1912:In0 [label="Double"] + c0:Out1 -> c1912:In1 [label="Double"] + c1850:Out0 -> c1913:In0 [label="Double"] + c1911:Out0 -> c1913:In1 [label="Double"] + c1912:Out0 -> c1913:In2 [label="Double"] +} diff --git a/plugin/test/gold/900/magSqr-gradr-syn.golden b/plugin/test/gold/900/magSqr-gradr-syn.golden new file mode 100644 index 000000000..21f5ca1a0 --- /dev/null +++ b/plugin/test/gold/900/magSqr-gradr-syn.golden @@ -0,0 +1,362 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exl . exr . exl) . dup) . (id *** exl . exr . exl) . dup *** + ((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exr . exl) . dup) . (id *** exr . exr . exl) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/magSqr-syn.golden b/plugin/test/gold/900/magSqr-syn.golden new file mode 100644 index 000000000..3cbccedb9 --- /dev/null +++ b/plugin/test/gold/900/magSqr-syn.golden @@ -0,0 +1,4 @@ +addC . +((mulC . ((exl *** exl) . dup) . exr *** mulC . ((exr *** exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/maximum-derf.golden b/plugin/test/gold/900/maximum-derf.golden new file mode 100644 index 000000000..e347ea3a9 --- /dev/null +++ b/plugin/test/gold/900/maximum-derf.golden @@ -0,0 +1 @@ +(7.0,2.0) \ No newline at end of file diff --git a/plugin/test/gold/900/maximum-derr.golden b/plugin/test/gold/900/maximum-derr.golden new file mode 100644 index 000000000..fd8a49770 --- /dev/null +++ b/plugin/test/gold/900/maximum-derr.golden @@ -0,0 +1 @@ +(7.0,Vector [7.0,7.0,7.0,7.0,7.0]) \ No newline at end of file diff --git a/plugin/test/gold/900/maximum-gradr.golden b/plugin/test/gold/900/maximum-gradr.golden new file mode 100644 index 000000000..d3f5183d7 --- /dev/null +++ b/plugin/test/gold/900/maximum-gradr.golden @@ -0,0 +1 @@ +(7.0,Vector [1.0,1.0,1.0,1.0,1.0]) \ No newline at end of file diff --git a/plugin/test/gold/900/sin-adf-dot.golden b/plugin/test/gold/900/sin-adf-dot.golden new file mode 100644 index 000000000..412357d29 --- /dev/null +++ b/plugin/test/gold/900/sin-adf-dot.golden @@ -0,0 +1,29 @@ +digraph sin_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc12 { label=""; color=white; margin=0; c12 [label="{{}|sin|{}}"] } + subgraph clusterc13 { label=""; color=white; margin=0; c13 [label="{{}|cos|{}}"] } + subgraph cluster_20 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c18 [label="{{|}|\|{}}"] + c17 [label="{In|{}}"] + c19 [label="{{}|Out}"] + c13:Out0 -> c18:In0 [label="Double"] + c17:Out0 -> c18:In1 [label="Double"] + c18:Out0 -> c19:In0 [label="Double"] + } + subgraph clusterc21 { label=""; color=white; margin=0; c21 [label="{{|}|Out}"] } + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c21:In0 [label="Double"] + c19 -> c21:In1 [ltail=cluster_20,label="Double Double"] +} diff --git a/plugin/test/gold/900/sin-adf-syn.golden b/plugin/test/gold/900/sin-adf-syn.golden new file mode 100644 index 000000000..c84410931 --- /dev/null +++ b/plugin/test/gold/900/sin-adf-syn.golden @@ -0,0 +1,7 @@ +second (id . repr) . +apply . +(curry + ((exr *** abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/sin-adr-dot.golden b/plugin/test/gold/900/sin-adr-dot.golden new file mode 100644 index 000000000..d017f0d9c --- /dev/null +++ b/plugin/test/gold/900/sin-adr-dot.golden @@ -0,0 +1,29 @@ +digraph sin_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc12 { label=""; color=white; margin=0; c12 [label="{{}|sin|{}}"] } + subgraph clusterc13 { label=""; color=white; margin=0; c13 [label="{{}|cos|{}}"] } + subgraph cluster_20 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c18 [label="{{|}|\|{}}"] + c17 [label="{In|{}}"] + c19 [label="{{}|Out}"] + c13:Out0 -> c18:In0 [label="Double"] + c17:Out0 -> c18:In1 [label="Double"] + c18:Out0 -> c19:In0 [label="Double"] + } + subgraph clusterc21 { label=""; color=white; margin=0; c21 [label="{{|}|Out}"] } + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c21:In0 [label="Double"] + c19 -> c21:In1 [ltail=cluster_20,label="Double Double"] +} diff --git a/plugin/test/gold/900/sin-adr-syn.golden b/plugin/test/gold/900/sin-adr-syn.golden new file mode 100644 index 000000000..23b07c29a --- /dev/null +++ b/plugin/test/gold/900/sin-adr-syn.golden @@ -0,0 +1,9 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/sin-gradr-dot.golden b/plugin/test/gold/900/sin-gradr-dot.golden new file mode 100644 index 000000000..ec826a311 --- /dev/null +++ b/plugin/test/gold/900/sin-gradr-dot.golden @@ -0,0 +1,17 @@ +digraph sin_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c12 [label="{{}|sin|{}}"] + c13 [label="{{}|cos|{}}"] + c22 [label="{{|}|Out}"] + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c22:In0 [label="Double"] + c13:Out0 -> c22:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/sin-gradr-syn.golden b/plugin/test/gold/900/sin-gradr-syn.golden new file mode 100644 index 000000000..16dcf2193 --- /dev/null +++ b/plugin/test/gold/900/sin-gradr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/900/sqr-adf-dot.golden b/plugin/test/gold/900/sqr-adf-dot.golden new file mode 100644 index 000000000..56369cc5b --- /dev/null +++ b/plugin/test/gold/900/sqr-adf-dot.golden @@ -0,0 +1,31 @@ +digraph sqr_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc27 { label=""; color=white; margin=0; c27 [label="{{|}|\|{}}"] } + subgraph cluster_101 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c98 [label="{{|}|\|{}}"] + c99 [label="{{|}|+|{}}"] + c97 [label="{In|{}}"] + c100 [label="{{}|Out}"] + c0:Out0 -> c98:In0 [label="Double"] + c97:Out0 -> c98:In1 [label="Double"] + c98:Out0 -> c99:In0 [label="Double"] + c98:Out0 -> c99:In1 [label="Double"] + c99:Out0 -> c100:In0 [label="Double"] + } + subgraph clusterc102 { label=""; color=white; margin=0; c102 [label="{{|}|Out}"] } + c0:Out0 -> c27:In0 [label="Double"] + c0:Out0 -> c27:In1 [label="Double"] + c27:Out0 -> c102:In0 [label="Double"] + c100 -> c102:In1 [ltail=cluster_101,label="Double Double"] +} diff --git a/plugin/test/gold/900/sqr-adf-syn.golden b/plugin/test/gold/900/sqr-adf-syn.golden new file mode 100644 index 000000000..4ab7b6c6b --- /dev/null +++ b/plugin/test/gold/900/sqr-adf-syn.golden @@ -0,0 +1,35 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/sqr-adr-dot.golden b/plugin/test/gold/900/sqr-adr-dot.golden new file mode 100644 index 000000000..4993f8d95 --- /dev/null +++ b/plugin/test/gold/900/sqr-adr-dot.golden @@ -0,0 +1,31 @@ +digraph sqr_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc53 { label=""; color=white; margin=0; c53 [label="{{|}|\|{}}"] } + subgraph cluster_202 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c199 [label="{{|}|\|{}}"] + c200 [label="{{|}|+|{}}"] + c198 [label="{In|{}}"] + c201 [label="{{}|Out}"] + c0:Out0 -> c199:In0 [label="Double"] + c198:Out0 -> c199:In1 [label="Double"] + c199:Out0 -> c200:In0 [label="Double"] + c199:Out0 -> c200:In1 [label="Double"] + c200:Out0 -> c201:In0 [label="Double"] + } + subgraph clusterc203 { label=""; color=white; margin=0; c203 [label="{{|}|Out}"] } + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c203:In0 [label="Double"] + c201 -> c203:In1 [ltail=cluster_202,label="Double Double"] +} diff --git a/plugin/test/gold/900/sqr-adr-syn.golden b/plugin/test/gold/900/sqr-adr-syn.golden new file mode 100644 index 000000000..0edde29a4 --- /dev/null +++ b/plugin/test/gold/900/sqr-adr-syn.golden @@ -0,0 +1,53 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/sqr-dot.golden b/plugin/test/gold/900/sqr-dot.golden new file mode 100644 index 000000000..a9f70b531 --- /dev/null +++ b/plugin/test/gold/900/sqr-dot.golden @@ -0,0 +1,15 @@ +digraph sqr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/sqr-gradr-dot.golden b/plugin/test/gold/900/sqr-gradr-dot.golden new file mode 100644 index 000000000..5980b83c1 --- /dev/null +++ b/plugin/test/gold/900/sqr-gradr-dot.golden @@ -0,0 +1,19 @@ +digraph sqr_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c53 [label="{{|}|\|{}}"] + c204 [label="{{|}|+|{}}"] + c205 [label="{{|}|Out}"] + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c0:Out0 -> c204:In0 [label="Double"] + c0:Out0 -> c204:In1 [label="Double"] + c53:Out0 -> c205:In0 [label="Double"] + c204:Out0 -> c205:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/sqr-gradr-syn.golden b/plugin/test/gold/900/sqr-gradr-syn.golden new file mode 100644 index 000000000..45ecdc00a --- /dev/null +++ b/plugin/test/gold/900/sqr-gradr-syn.golden @@ -0,0 +1,55 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/sqr-syn.golden b/plugin/test/gold/900/sqr-syn.golden new file mode 100644 index 000000000..71c93dc16 --- /dev/null +++ b/plugin/test/gold/900/sqr-syn.golden @@ -0,0 +1 @@ +mulC . dup \ No newline at end of file diff --git a/plugin/test/gold/900/twice-adf-dot.golden b/plugin/test/gold/900/twice-adf-dot.golden new file mode 100644 index 000000000..01d49c491 --- /dev/null +++ b/plugin/test/gold/900/twice-adf-dot.golden @@ -0,0 +1,28 @@ +digraph twice_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc27 { label=""; color=white; margin=0; c27 [label="{{|}|+|{}}"] } + subgraph cluster_51 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c49 [label="{{|}|+|{}}"] + c48 [label="{In|{}}"] + c50 [label="{{}|Out}"] + c48:Out0 -> c49:In0 [label="Double"] + c48:Out0 -> c49:In1 [label="Double"] + c49:Out0 -> c50:In0 [label="Double"] + } + subgraph clusterc52 { label=""; color=white; margin=0; c52 [label="{{|}|Out}"] } + c0:Out0 -> c27:In0 [label="Double"] + c0:Out0 -> c27:In1 [label="Double"] + c27:Out0 -> c52:In0 [label="Double"] + c50 -> c52:In1 [ltail=cluster_51,label="Double Double"] +} diff --git a/plugin/test/gold/900/twice-adf-syn.golden b/plugin/test/gold/900/twice-adf-syn.golden new file mode 100644 index 000000000..f09fd4faa --- /dev/null +++ b/plugin/test/gold/900/twice-adf-syn.golden @@ -0,0 +1,16 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . curry (addC . exr)) . dup) . exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/twice-adr-dot.golden b/plugin/test/gold/900/twice-adr-dot.golden new file mode 100644 index 000000000..632b5f131 --- /dev/null +++ b/plugin/test/gold/900/twice-adr-dot.golden @@ -0,0 +1,28 @@ +digraph twice_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc53 { label=""; color=white; margin=0; c53 [label="{{|}|+|{}}"] } + subgraph cluster_99 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c97 [label="{{|}|+|{}}"] + c96 [label="{In|{}}"] + c98 [label="{{}|Out}"] + c96:Out0 -> c97:In0 [label="Double"] + c96:Out0 -> c97:In1 [label="Double"] + c97:Out0 -> c98:In0 [label="Double"] + } + subgraph clusterc100 { label=""; color=white; margin=0; c100 [label="{{|}|Out}"] } + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c100:In0 [label="Double"] + c98 -> c100:In1 [ltail=cluster_99,label="Double Double"] +} diff --git a/plugin/test/gold/900/twice-adr-syn.golden b/plugin/test/gold/900/twice-adr-syn.golden new file mode 100644 index 000000000..52e2873c1 --- /dev/null +++ b/plugin/test/gold/900/twice-adr-syn.golden @@ -0,0 +1,24 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/twice-dot.golden b/plugin/test/gold/900/twice-dot.golden new file mode 100644 index 000000000..8286b1b80 --- /dev/null +++ b/plugin/test/gold/900/twice-dot.golden @@ -0,0 +1,15 @@ +digraph twice { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|+|{}}"] + c2 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/twice-gradr-dot.golden b/plugin/test/gold/900/twice-gradr-dot.golden new file mode 100644 index 000000000..6c7b1b394 --- /dev/null +++ b/plugin/test/gold/900/twice-gradr-dot.golden @@ -0,0 +1,17 @@ +digraph twice_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c53 [label="{{|}|+|{}}"] + c101 [label="{2.0|{}}"] + c102 [label="{{|}|Out}"] + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c102:In0 [label="Double"] + c101:Out0 -> c102:In1 [label="Double"] +} diff --git a/plugin/test/gold/900/twice-gradr-syn.golden b/plugin/test/gold/900/twice-gradr-syn.golden new file mode 100644 index 000000000..feaa5c507 --- /dev/null +++ b/plugin/test/gold/900/twice-gradr-syn.golden @@ -0,0 +1,26 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/twice-syn.golden b/plugin/test/gold/900/twice-syn.golden new file mode 100644 index 000000000..9242c719e --- /dev/null +++ b/plugin/test/gold/900/twice-syn.golden @@ -0,0 +1 @@ +addC . dup \ No newline at end of file diff --git a/plugin/test/gold/900/xp3y-dot.golden b/plugin/test/gold/900/xp3y-dot.golden new file mode 100644 index 000000000..2da92fbf1 --- /dev/null +++ b/plugin/test/gold/900/xp3y-dot.golden @@ -0,0 +1,19 @@ +digraph xp3y { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{3.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|+|{}}"] + c4 [label="{{}|Out}"] + c0:Out1 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] +} diff --git a/plugin/test/gold/900/xp3y-syn.golden b/plugin/test/gold/900/xp3y-syn.golden new file mode 100644 index 000000000..17158c9b9 --- /dev/null +++ b/plugin/test/gold/900/xp3y-syn.golden @@ -0,0 +1 @@ +addC . ((exl . exr *** mulC . (const 3.0 *** exr . exr) . dup) . dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/add-adf-dot.golden b/plugin/test/gold/902/add-adf-dot.golden new file mode 100644 index 000000000..296ee412e --- /dev/null +++ b/plugin/test/gold/902/add-adf-dot.golden @@ -0,0 +1,28 @@ +digraph add_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph cluster_5 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c3 [label="{{|}|+|{}}"] + c2 [label="{In|{|}}"] + c4 [label="{{}|Out}"] + c2:Out0 -> c3:In0 [label="Double"] + c2:Out1 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + } + subgraph clusterc6 { label=""; color=white; margin=0; c6 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c6:In0 [label="Double"] + c4 -> c6:In1 [ltail=cluster_5,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/add-adf-syn.golden b/plugin/test/gold/902/add-adf-syn.golden new file mode 100644 index 000000000..d446add70 --- /dev/null +++ b/plugin/test/gold/902/add-adf-syn.golden @@ -0,0 +1 @@ +(addC *** id . repr . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/add-adr-dot.golden b/plugin/test/gold/902/add-adr-dot.golden new file mode 100644 index 000000000..708ec4c99 --- /dev/null +++ b/plugin/test/gold/902/add-adr-dot.golden @@ -0,0 +1,26 @@ +digraph add_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph cluster_4 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c2 [label="{In|{}}"] + c3 [label="{{|}|Out}"] + c2:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + } + subgraph clusterc5 { label=""; color=white; margin=0; c5 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c5:In0 [label="Double"] + c3 -> c5:In1 [ltail=cluster_4,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/add-adr-syn.golden b/plugin/test/gold/902/add-adr-syn.golden new file mode 100644 index 000000000..5c74c0f36 --- /dev/null +++ b/plugin/test/gold/902/add-adr-syn.golden @@ -0,0 +1,2 @@ +((exl . id *** repr . exr . id) . dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/add-dot.golden b/plugin/test/gold/902/add-dot.golden new file mode 100644 index 000000000..7b4f837a8 --- /dev/null +++ b/plugin/test/gold/902/add-dot.golden @@ -0,0 +1,24 @@ +digraph add { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph cluster_4 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c2 [label="{{|}|+|{}}"] + c1 [label="{In|{}}"] + c3 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c2:Out0 -> c3:In0 [label="Double"] + } + subgraph clusterc5 { label=""; color=white; margin=0; c5 [label="{{}|Out}"] } + c3 -> c5:In0 [ltail=cluster_4,label="Double Double"] +} diff --git a/plugin/test/gold/902/add-gradr-dot.golden b/plugin/test/gold/902/add-gradr-dot.golden new file mode 100644 index 000000000..82746d290 --- /dev/null +++ b/plugin/test/gold/902/add-gradr-dot.golden @@ -0,0 +1,18 @@ +digraph add_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|+|{}}"] + c5 [label="{1.0|{}}"] + c6 [label="{{||}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c6:In0 [label="Double"] + c5:Out0 -> c6:In1 [label="Double"] + c5:Out0 -> c6:In2 [label="Double"] +} diff --git a/plugin/test/gold/902/add-gradr-syn.golden b/plugin/test/gold/902/add-gradr-syn.golden new file mode 100644 index 000000000..0c5076e9d --- /dev/null +++ b/plugin/test/gold/902/add-gradr-syn.golden @@ -0,0 +1,4 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/add-syn.golden b/plugin/test/gold/902/add-syn.golden new file mode 100644 index 000000000..d543240d0 --- /dev/null +++ b/plugin/test/gold/902/add-syn.golden @@ -0,0 +1 @@ +curry addC \ No newline at end of file diff --git a/plugin/test/gold/902/add-uncurry-dot.golden b/plugin/test/gold/902/add-uncurry-dot.golden new file mode 100644 index 000000000..e7c658907 --- /dev/null +++ b/plugin/test/gold/902/add-uncurry-dot.golden @@ -0,0 +1,15 @@ +digraph add_uncurry { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c5 [label="{{|}|+|{}}"] + c6 [label="{{}|Out}"] + c0:Out0 -> c5:In0 [label="Double"] + c0:Out1 -> c5:In1 [label="Double"] + c5:Out0 -> c6:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/add-uncurry-syn.golden b/plugin/test/gold/902/add-uncurry-syn.golden new file mode 100644 index 000000000..c4a4e4847 --- /dev/null +++ b/plugin/test/gold/902/add-uncurry-syn.golden @@ -0,0 +1 @@ +apply . (curry addC . exl *** exr) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/complex-mul-dot.golden b/plugin/test/gold/902/complex-mul-dot.golden new file mode 100644 index 000000000..2f88826f1 --- /dev/null +++ b/plugin/test/gold/902/complex-mul-dot.golden @@ -0,0 +1,31 @@ +digraph complex_mul { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|||}}"] + c10 [label="{{|}|\|{}}"] + c11 [label="{{|}|\|{}}"] + c12 [label="{{|}|\|{}}"] + c13 [label="{{|}|\|{}}"] + c14 [label="{{|}|\|{}}"] + c15 [label="{{|}|+|{}}"] + c16 [label="{{|}|Out}"] + c0:Out0 -> c10:In0 [label="Double"] + c0:Out2 -> c10:In1 [label="Double"] + c0:Out1 -> c11:In0 [label="Double"] + c0:Out3 -> c11:In1 [label="Double"] + c10:Out0 -> c12:In0 [label="Double"] + c11:Out0 -> c12:In1 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c0:Out3 -> c13:In1 [label="Double"] + c0:Out1 -> c14:In0 [label="Double"] + c0:Out2 -> c14:In1 [label="Double"] + c13:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c15:In1 [label="Double"] + c12:Out0 -> c16:In0 [label="Double"] + c15:Out0 -> c16:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/complex-mul-syn.golden b/plugin/test/gold/902/complex-mul-syn.golden new file mode 100644 index 000000000..77b77100d --- /dev/null +++ b/plugin/test/gold/902/complex-mul-syn.golden @@ -0,0 +1,17 @@ +apply . +(curry + (abst . + ((subC . + (mulC . (exl . exr . exl *** exl . exr) . dup *** + mulC . (exr . exr . exl *** exr . exr) . dup) . + dup *** + addC . + (mulC . (exl . exr . exl *** exr . exr) . dup *** + mulC . (exr . exr . exl *** exl . exr) . dup) . + dup) . + dup) . + ((id *** repr . exr . exr . exl) . dup) . + ((id *** repr . exl . exr) . dup) . dup) . + exl *** + exr) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2x-adf-dot.golden b/plugin/test/gold/902/cos-2x-adf-dot.golden new file mode 100644 index 000000000..20339b5e8 --- /dev/null +++ b/plugin/test/gold/902/cos-2x-adf-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2x_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc77 { label=""; color=white; margin=0; c77 [label="{2.0|{}}"] } + subgraph clusterc142 { label=""; color=white; margin=0; c142 [label="{{|}|\|{}}"] } + subgraph clusterc253 { label=""; color=white; margin=0; c253 [label="{{}|cos|{}}"] } + subgraph clusterc254 { label=""; color=white; margin=0; c254 [label="{{}|sin|{}}"] } + subgraph cluster_287 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c283 [label="{{|}|\|{}}"] + c284 [label="{{|}|\|{}}"] + c282 [label="{In|{}}"] + c286 [label="{{}|Out}"] + c285 [label="{{}|negate|{}}"] + c77:Out0 -> c283:In0 [label="Double"] + c282:Out0 -> c283:In1 [label="Double"] + c254:Out0 -> c284:In0 [label="Double"] + c283:Out0 -> c284:In1 [label="Double"] + c285:Out0 -> c286:In0 [label="Double"] + c284:Out0 -> c285:In0 [label="Double"] + } + subgraph clusterc288 { label=""; color=white; margin=0; c288 [label="{{|}|Out}"] } + c0:Out0 -> c142:In0 [label="Double"] + c77:Out0 -> c142:In1 [label="Double"] + c142:Out0 -> c253:In0 [label="Double"] + c142:Out0 -> c254:In0 [label="Double"] + c253:Out0 -> c288:In0 [label="Double"] + c286 -> c288:In1 [ltail=cluster_287,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-2x-adf-syn.golden b/plugin/test/gold/902/cos-2x-adf-syn.golden new file mode 100644 index 000000000..87e4f3b0c --- /dev/null +++ b/plugin/test/gold/902/cos-2x-adf-syn.golden @@ -0,0 +1,88 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2x-adr-dot.golden b/plugin/test/gold/902/cos-2x-adr-dot.golden new file mode 100644 index 000000000..eaeb85285 --- /dev/null +++ b/plugin/test/gold/902/cos-2x-adr-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2x_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc109 { label=""; color=white; margin=0; c109 [label="{2.0|{}}"] } + subgraph clusterc243 { label=""; color=white; margin=0; c243 [label="{{|}|\|{}}"] } + subgraph clusterc463 { label=""; color=white; margin=0; c463 [label="{{}|cos|{}}"] } + subgraph clusterc464 { label=""; color=white; margin=0; c464 [label="{{}|sin|{}}"] } + subgraph cluster_528 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c524 [label="{{|}|\|{}}"] + c520 [label="{{|}|\|{}}"] + c519 [label="{In|{}}"] + c527 [label="{{}|Out}"] + c525 [label="{{}|negate|{}}"] + c109:Out0 -> c524:In0 [label="Double"] + c520:Out0 -> c524:In1 [label="Double"] + c464:Out0 -> c520:In0 [label="Double"] + c519:Out0 -> c520:In1 [label="Double"] + c525:Out0 -> c527:In0 [label="Double"] + c524:Out0 -> c525:In0 [label="Double"] + } + subgraph clusterc529 { label=""; color=white; margin=0; c529 [label="{{|}|Out}"] } + c0:Out0 -> c243:In0 [label="Double"] + c109:Out0 -> c243:In1 [label="Double"] + c243:Out0 -> c463:In0 [label="Double"] + c243:Out0 -> c464:In0 [label="Double"] + c463:Out0 -> c529:In0 [label="Double"] + c527 -> c529:In1 [ltail=cluster_528,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-2x-adr-syn.golden b/plugin/test/gold/902/cos-2x-adr-syn.golden new file mode 100644 index 000000000..bbe23cf19 --- /dev/null +++ b/plugin/test/gold/902/cos-2x-adr-syn.golden @@ -0,0 +1,126 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2x-gradr-dot.golden b/plugin/test/gold/902/cos-2x-gradr-dot.golden new file mode 100644 index 000000000..4882aa74c --- /dev/null +++ b/plugin/test/gold/902/cos-2x-gradr-dot.golden @@ -0,0 +1,26 @@ +digraph cos_2x_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c109 [label="{2.0|{}}"] + c243 [label="{{|}|\|{}}"] + c463 [label="{{}|cos|{}}"] + c464 [label="{{}|sin|{}}"] + c532 [label="{{|}|\|{}}"] + c533 [label="{{}|negate|{}}"] + c534 [label="{{|}|Out}"] + c0:Out0 -> c243:In0 [label="Double"] + c109:Out0 -> c243:In1 [label="Double"] + c243:Out0 -> c463:In0 [label="Double"] + c243:Out0 -> c464:In0 [label="Double"] + c109:Out0 -> c532:In0 [label="Double"] + c464:Out0 -> c532:In1 [label="Double"] + c532:Out0 -> c533:In0 [label="Double"] + c463:Out0 -> c534:In0 [label="Double"] + c533:Out0 -> c534:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/cos-2x-gradr-syn.golden b/plugin/test/gold/902/cos-2x-gradr-syn.golden new file mode 100644 index 000000000..0393e913d --- /dev/null +++ b/plugin/test/gold/902/cos-2x-gradr-syn.golden @@ -0,0 +1,128 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-adf-dot.golden b/plugin/test/gold/902/cos-2xx-adf-dot.golden new file mode 100644 index 000000000..8ea7e8eca --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-adf-dot.golden @@ -0,0 +1,50 @@ +digraph cos_2xx_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc366 { label=""; color=white; margin=0; c366 [label="{2.0|{}}"] } + subgraph clusterc431 { label=""; color=white; margin=0; c431 [label="{{|}|\|{}}"] } + subgraph clusterc572 { label=""; color=white; margin=0; c572 [label="{{|}|\|{}}"] } + subgraph clusterc689 { label=""; color=white; margin=0; c689 [label="{{}|cos|{}}"] } + subgraph clusterc690 { label=""; color=white; margin=0; c690 [label="{{}|sin|{}}"] } + subgraph cluster_726 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c720 [label="{{|}|\|{}}"] + c719 [label="{{|}|\|{}}"] + c721 [label="{{|}|\|{}}"] + c723 [label="{{|}|\|{}}"] + c722 [label="{{|}|+|{}}"] + c718 [label="{In|{}}"] + c725 [label="{{}|Out}"] + c724 [label="{{}|negate|{}}"] + c0:Out0 -> c720:In0 [label="Double"] + c719:Out0 -> c720:In1 [label="Double"] + c366:Out0 -> c719:In0 [label="Double"] + c718:Out0 -> c719:In1 [label="Double"] + c431:Out0 -> c721:In0 [label="Double"] + c718:Out0 -> c721:In1 [label="Double"] + c690:Out0 -> c723:In0 [label="Double"] + c722:Out0 -> c723:In1 [label="Double"] + c720:Out0 -> c722:In0 [label="Double"] + c721:Out0 -> c722:In1 [label="Double"] + c724:Out0 -> c725:In0 [label="Double"] + c723:Out0 -> c724:In0 [label="Double"] + } + subgraph clusterc727 { label=""; color=white; margin=0; c727 [label="{{|}|Out}"] } + c0:Out0 -> c431:In0 [label="Double"] + c366:Out0 -> c431:In1 [label="Double"] + c0:Out0 -> c572:In0 [label="Double"] + c431:Out0 -> c572:In1 [label="Double"] + c572:Out0 -> c689:In0 [label="Double"] + c572:Out0 -> c690:In0 [label="Double"] + c689:Out0 -> c727:In0 [label="Double"] + c725 -> c727:In1 [ltail=cluster_726,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-2xx-adf-syn.golden b/plugin/test/gold/902/cos-2xx-adf-syn.golden new file mode 100644 index 000000000..8929d8444 --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-adf-syn.golden @@ -0,0 +1,155 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-adr-dot.golden b/plugin/test/gold/902/cos-2xx-adr-dot.golden new file mode 100644 index 000000000..1e0de33dc --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-adr-dot.golden @@ -0,0 +1,50 @@ +digraph cos_2xx_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc610 { label=""; color=white; margin=0; c610 [label="{2.0|{}}"] } + subgraph clusterc744 { label=""; color=white; margin=0; c744 [label="{{|}|\|{}}"] } + subgraph clusterc1043 { label=""; color=white; margin=0; c1043 [label="{{|}|\|{}}"] } + subgraph clusterc1281 { label=""; color=white; margin=0; c1281 [label="{{}|cos|{}}"] } + subgraph clusterc1282 { label=""; color=white; margin=0; c1282 [label="{{}|sin|{}}"] } + subgraph cluster_1358 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1346 [label="{{|}|\|{}}"] + c1352 [label="{{|}|\|{}}"] + c1348 [label="{{|}|\|{}}"] + c1344 [label="{{|}|\|{}}"] + c1355 [label="{{|}|+|{}}"] + c1343 [label="{In|{}}"] + c1357 [label="{{}|Out}"] + c1356 [label="{{}|negate|{}}"] + c0:Out0 -> c1346:In0 [label="Double"] + c1344:Out0 -> c1346:In1 [label="Double"] + c610:Out0 -> c1352:In0 [label="Double"] + c1346:Out0 -> c1352:In1 [label="Double"] + c744:Out0 -> c1348:In0 [label="Double"] + c1344:Out0 -> c1348:In1 [label="Double"] + c1282:Out0 -> c1344:In0 [label="Double"] + c1343:Out0 -> c1344:In1 [label="Double"] + c1348:Out0 -> c1355:In0 [label="Double"] + c1352:Out0 -> c1355:In1 [label="Double"] + c1356:Out0 -> c1357:In0 [label="Double"] + c1355:Out0 -> c1356:In0 [label="Double"] + } + subgraph clusterc1359 { label=""; color=white; margin=0; c1359 [label="{{|}|Out}"] } + c0:Out0 -> c744:In0 [label="Double"] + c610:Out0 -> c744:In1 [label="Double"] + c0:Out0 -> c1043:In0 [label="Double"] + c744:Out0 -> c1043:In1 [label="Double"] + c1043:Out0 -> c1281:In0 [label="Double"] + c1043:Out0 -> c1282:In0 [label="Double"] + c1281:Out0 -> c1359:In0 [label="Double"] + c1357 -> c1359:In1 [ltail=cluster_1358,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-2xx-adr-syn.golden b/plugin/test/gold/902/cos-2xx-adr-syn.golden new file mode 100644 index 000000000..af35a5dfb --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-adr-syn.golden @@ -0,0 +1,218 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-dot.golden b/plugin/test/gold/902/cos-2xx-dot.golden new file mode 100644 index 000000000..ab90b5f50 --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-dot.golden @@ -0,0 +1,21 @@ +digraph cos_2xx { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{2.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|\|{}}"] + c4 [label="{{}|cos|{}}"] + c5 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + c4:Out0 -> c5:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/cos-2xx-gradr-dot.golden b/plugin/test/gold/902/cos-2xx-gradr-dot.golden new file mode 100644 index 000000000..a2b562057 --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-gradr-dot.golden @@ -0,0 +1,38 @@ +digraph cos_2xx_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c610 [label="{2.0|{}}"] + c744 [label="{{|}|\|{}}"] + c1043 [label="{{|}|\|{}}"] + c1281 [label="{{}|cos|{}}"] + c1282 [label="{{}|sin|{}}"] + c1360 [label="{{|}|\|{}}"] + c1362 [label="{{|}|\|{}}"] + c1366 [label="{{|}|\|{}}"] + c1368 [label="{{|}|+|{}}"] + c1369 [label="{{}|negate|{}}"] + c1370 [label="{{|}|Out}"] + c0:Out0 -> c744:In0 [label="Double"] + c610:Out0 -> c744:In1 [label="Double"] + c0:Out0 -> c1043:In0 [label="Double"] + c744:Out0 -> c1043:In1 [label="Double"] + c1043:Out0 -> c1281:In0 [label="Double"] + c1043:Out0 -> c1282:In0 [label="Double"] + c0:Out0 -> c1360:In0 [label="Double"] + c1282:Out0 -> c1360:In1 [label="Double"] + c744:Out0 -> c1362:In0 [label="Double"] + c1282:Out0 -> c1362:In1 [label="Double"] + c610:Out0 -> c1366:In0 [label="Double"] + c1360:Out0 -> c1366:In1 [label="Double"] + c1362:Out0 -> c1368:In0 [label="Double"] + c1366:Out0 -> c1368:In1 [label="Double"] + c1368:Out0 -> c1369:In0 [label="Double"] + c1281:Out0 -> c1370:In0 [label="Double"] + c1369:Out0 -> c1370:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/cos-2xx-gradr-syn.golden b/plugin/test/gold/902/cos-2xx-gradr-syn.golden new file mode 100644 index 000000000..01de18c11 --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-gradr-syn.golden @@ -0,0 +1,220 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . +apply . +((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . abst . curry (addC . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((const 2.0 *** + abst . + abst . + curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . + dup) . + exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl . exr . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr . exr) . + dup) . +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-syn.golden b/plugin/test/gold/902/cos-2xx-syn.golden new file mode 100644 index 000000000..6c236aa23 --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-syn.golden @@ -0,0 +1 @@ +cosC . mulC . (mulC . (const 2.0 *** id) . dup *** id) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-adf-dot.golden b/plugin/test/gold/902/cos-adf-dot.golden new file mode 100644 index 000000000..1b4deacfb --- /dev/null +++ b/plugin/test/gold/902/cos-adf-dot.golden @@ -0,0 +1,31 @@ +digraph cos_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc14 { label=""; color=white; margin=0; c14 [label="{{}|cos|{}}"] } + subgraph clusterc15 { label=""; color=white; margin=0; c15 [label="{{}|sin|{}}"] } + subgraph cluster_24 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c21 [label="{{|}|\|{}}"] + c20 [label="{In|{}}"] + c23 [label="{{}|Out}"] + c22 [label="{{}|negate|{}}"] + c15:Out0 -> c21:In0 [label="Double"] + c20:Out0 -> c21:In1 [label="Double"] + c22:Out0 -> c23:In0 [label="Double"] + c21:Out0 -> c22:In0 [label="Double"] + } + subgraph clusterc25 { label=""; color=white; margin=0; c25 [label="{{|}|Out}"] } + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c25:In0 [label="Double"] + c23 -> c25:In1 [ltail=cluster_24,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-adf-syn.golden b/plugin/test/gold/902/cos-adf-syn.golden new file mode 100644 index 000000000..1adb56320 --- /dev/null +++ b/plugin/test/gold/902/cos-adf-syn.golden @@ -0,0 +1,9 @@ +second (id . repr) . +apply . +(curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-adr-dot.golden b/plugin/test/gold/902/cos-adr-dot.golden new file mode 100644 index 000000000..52707dac9 --- /dev/null +++ b/plugin/test/gold/902/cos-adr-dot.golden @@ -0,0 +1,31 @@ +digraph cos_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc14 { label=""; color=white; margin=0; c14 [label="{{}|cos|{}}"] } + subgraph clusterc15 { label=""; color=white; margin=0; c15 [label="{{}|sin|{}}"] } + subgraph cluster_24 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c21 [label="{{|}|\|{}}"] + c20 [label="{In|{}}"] + c23 [label="{{}|Out}"] + c22 [label="{{}|negate|{}}"] + c15:Out0 -> c21:In0 [label="Double"] + c20:Out0 -> c21:In1 [label="Double"] + c22:Out0 -> c23:In0 [label="Double"] + c21:Out0 -> c22:In0 [label="Double"] + } + subgraph clusterc25 { label=""; color=white; margin=0; c25 [label="{{|}|Out}"] } + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c14:Out0 -> c25:In0 [label="Double"] + c23 -> c25:In1 [ltail=cluster_24,label="Double Double"] +} diff --git a/plugin/test/gold/902/cos-adr-syn.golden b/plugin/test/gold/902/cos-adr-syn.golden new file mode 100644 index 000000000..1d1eac293 --- /dev/null +++ b/plugin/test/gold/902/cos-adr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-gradr-dot.golden b/plugin/test/gold/902/cos-gradr-dot.golden new file mode 100644 index 000000000..bec73cbf9 --- /dev/null +++ b/plugin/test/gold/902/cos-gradr-dot.golden @@ -0,0 +1,19 @@ +digraph cos_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c14 [label="{{}|cos|{}}"] + c15 [label="{{}|sin|{}}"] + c16 [label="{{}|negate|{}}"] + c26 [label="{{|}|Out}"] + c0:Out0 -> c14:In0 [label="Double"] + c0:Out0 -> c15:In0 [label="Double"] + c15:Out0 -> c16:In0 [label="Double"] + c14:Out0 -> c26:In0 [label="Double"] + c16:Out0 -> c26:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/cos-gradr-syn.golden b/plugin/test/gold/902/cos-gradr-syn.golden new file mode 100644 index 000000000..092301088 --- /dev/null +++ b/plugin/test/gold/902/cos-gradr-syn.golden @@ -0,0 +1,13 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-xpy-adf-dot.golden b/plugin/test/gold/902/cos-xpy-adf-dot.golden new file mode 100644 index 000000000..e89e109f3 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-adf-dot.golden @@ -0,0 +1,37 @@ +digraph cos_xpy_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph clusterc43 { label=""; color=white; margin=0; c43 [label="{{}|cos|{}}"] } + subgraph clusterc44 { label=""; color=white; margin=0; c44 [label="{{}|sin|{}}"] } + subgraph cluster_77 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c74 [label="{{|}|\|{}}"] + c73 [label="{{|}|+|{}}"] + c72 [label="{In|{|}}"] + c76 [label="{{}|Out}"] + c75 [label="{{}|negate|{}}"] + c44:Out0 -> c74:In0 [label="Double"] + c73:Out0 -> c74:In1 [label="Double"] + c72:Out0 -> c73:In0 [label="Double"] + c72:Out1 -> c73:In1 [label="Double"] + c75:Out0 -> c76:In0 [label="Double"] + c74:Out0 -> c75:In0 [label="Double"] + } + subgraph clusterc78 { label=""; color=white; margin=0; c78 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c43:In0 [label="Double"] + c1:Out0 -> c44:In0 [label="Double"] + c43:Out0 -> c78:In0 [label="Double"] + c76 -> c78:In1 [ltail=cluster_77,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/cos-xpy-adf-syn.golden b/plugin/test/gold/902/cos-xpy-adf-syn.golden new file mode 100644 index 000000000..f9c57c951 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-adf-syn.golden @@ -0,0 +1,24 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +(addC *** abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-xpy-adr-dot.golden b/plugin/test/gold/902/cos-xpy-adr-dot.golden new file mode 100644 index 000000000..011b30ba2 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-adr-dot.golden @@ -0,0 +1,35 @@ +digraph cos_xpy_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc155 { label=""; color=white; margin=0; c155 [label="{{|}|+|{}}"] } + subgraph clusterc263 { label=""; color=white; margin=0; c263 [label="{{}|cos|{}}"] } + subgraph clusterc264 { label=""; color=white; margin=0; c264 [label="{{}|sin|{}}"] } + subgraph cluster_320 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c316 [label="{{|}|\|{}}"] + c315 [label="{In|{}}"] + c319 [label="{{|}|Out}"] + c317 [label="{{}|negate|{}}"] + c264:Out0 -> c316:In0 [label="Double"] + c315:Out0 -> c316:In1 [label="Double"] + c317:Out0 -> c319:In0 [label="Double"] + c317:Out0 -> c319:In1 [label="Double"] + c316:Out0 -> c317:In0 [label="Double"] + } + subgraph clusterc321 { label=""; color=white; margin=0; c321 [label="{{|}|Out}"] } + c0:Out0 -> c155:In0 [label="Double"] + c0:Out1 -> c155:In1 [label="Double"] + c155:Out0 -> c263:In0 [label="Double"] + c155:Out0 -> c264:In0 [label="Double"] + c263:Out0 -> c321:In0 [label="Double"] + c319 -> c321:In1 [ltail=cluster_320,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/cos-xpy-adr-syn.golden b/plugin/test/gold/902/cos-xpy-adr-syn.golden new file mode 100644 index 000000000..d9a84bd78 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-adr-syn.golden @@ -0,0 +1,87 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-xpy-gradr-dot.golden b/plugin/test/gold/902/cos-xpy-gradr-dot.golden new file mode 100644 index 000000000..fb1119701 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-gradr-dot.golden @@ -0,0 +1,23 @@ +digraph cos_xpy_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c155 [label="{{|}|+|{}}"] + c263 [label="{{}|cos|{}}"] + c264 [label="{{}|sin|{}}"] + c265 [label="{{}|negate|{}}"] + c323 [label="{{||}|Out}"] + c0:Out0 -> c155:In0 [label="Double"] + c0:Out1 -> c155:In1 [label="Double"] + c155:Out0 -> c263:In0 [label="Double"] + c155:Out0 -> c264:In0 [label="Double"] + c264:Out0 -> c265:In0 [label="Double"] + c263:Out0 -> c323:In0 [label="Double"] + c265:Out0 -> c323:In1 [label="Double"] + c265:Out0 -> c323:In2 [label="Double"] +} diff --git a/plugin/test/gold/902/cos-xpy-gradr-syn.golden b/plugin/test/gold/902/cos-xpy-gradr-syn.golden new file mode 100644 index 000000000..9746ee659 --- /dev/null +++ b/plugin/test/gold/902/cos-xpy-gradr-syn.golden @@ -0,0 +1,89 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exr *** + abst . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/cosSinProd-dot.golden b/plugin/test/gold/902/cosSinProd-dot.golden new file mode 100644 index 000000000..3cf075e6f --- /dev/null +++ b/plugin/test/gold/902/cosSinProd-dot.golden @@ -0,0 +1,20 @@ +digraph cosSinProd { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{}|cos|{}}"] + c3 [label="{{}|sin|{}}"] + c4 [label="{{|}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out1 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c4:In0 [label="Double"] + c3:Out0 -> c4:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/cosSinProd-syn.golden b/plugin/test/gold/902/cosSinProd-syn.golden new file mode 100644 index 000000000..acaddb2c9 --- /dev/null +++ b/plugin/test/gold/902/cosSinProd-syn.golden @@ -0,0 +1 @@ +((cosC *** sinC) . dup) . mulC . exr . dup \ No newline at end of file diff --git a/plugin/test/gold/902/dup-dot.golden b/plugin/test/gold/902/dup-dot.golden new file mode 100644 index 000000000..ed6525c84 --- /dev/null +++ b/plugin/test/gold/902/dup-dot.golden @@ -0,0 +1,13 @@ +digraph dup { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/dup-syn.golden b/plugin/test/gold/902/dup-syn.golden new file mode 100644 index 000000000..5d487a853 --- /dev/null +++ b/plugin/test/gold/902/dup-syn.golden @@ -0,0 +1 @@ +dup \ No newline at end of file diff --git a/plugin/test/gold/902/fst-dot.golden b/plugin/test/gold/902/fst-dot.golden new file mode 100644 index 000000000..01f192d8b --- /dev/null +++ b/plugin/test/gold/902/fst-dot.golden @@ -0,0 +1,12 @@ +digraph fst { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/fst-syn.golden b/plugin/test/gold/902/fst-syn.golden new file mode 100644 index 000000000..438c6f210 --- /dev/null +++ b/plugin/test/gold/902/fst-syn.golden @@ -0,0 +1 @@ +exl \ No newline at end of file diff --git a/plugin/test/gold/902/horner-dot.golden b/plugin/test/gold/902/horner-dot.golden new file mode 100644 index 000000000..4c99cd781 --- /dev/null +++ b/plugin/test/gold/902/horner-dot.golden @@ -0,0 +1,27 @@ +digraph horner { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{1.0|{}}"] + c2 [label="{3.0|{}}"] + c3 [label="{5.0|{}}"] + c5 [label="{{|}|\|{}}"] + c6 [label="{{|}|+|{}}"] + c7 [label="{{|}|\|{}}"] + c8 [label="{{|}|+|{}}"] + c9 [label="{{}|Out}"] + c0:Out0 -> c5:In0 [label="Double"] + c3:Out0 -> c5:In1 [label="Double"] + c2:Out0 -> c6:In0 [label="Double"] + c5:Out0 -> c6:In1 [label="Double"] + c0:Out0 -> c7:In0 [label="Double"] + c6:Out0 -> c7:In1 [label="Double"] + c1:Out0 -> c8:In0 [label="Double"] + c7:Out0 -> c8:In1 [label="Double"] + c8:Out0 -> c9:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/horner-syn.golden b/plugin/test/gold/902/horner-syn.golden new file mode 100644 index 000000000..dc3a83964 --- /dev/null +++ b/plugin/test/gold/902/horner-syn.golden @@ -0,0 +1,12 @@ +addC . +(const 1.0 *** + mulC . + (id *** + addC . + (const 3.0 *** + mulC . + (id *** addC . (const 5.0 *** mulC . (id *** const 0.0) . dup) . dup) . + dup) . + dup) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/log-2xx-dot.golden b/plugin/test/gold/902/log-2xx-dot.golden new file mode 100644 index 000000000..1e8454d6c --- /dev/null +++ b/plugin/test/gold/902/log-2xx-dot.golden @@ -0,0 +1,21 @@ +digraph log_2xx { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{2.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|\|{}}"] + c4 [label="{{}|log|{}}"] + c5 [label="{{}|Out}"] + c0:Out0 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] + c4:Out0 -> c5:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/log-2xx-syn.golden b/plugin/test/gold/902/log-2xx-syn.golden new file mode 100644 index 000000000..58d8e5c25 --- /dev/null +++ b/plugin/test/gold/902/log-2xx-syn.golden @@ -0,0 +1 @@ +logC . mulC . (mulC . (const 2.0 *** id) . dup *** id) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/magSqr-adf-dot.golden b/plugin/test/gold/902/magSqr-adf-dot.golden new file mode 100644 index 000000000..f9b3fa467 --- /dev/null +++ b/plugin/test/gold/902/magSqr-adf-dot.golden @@ -0,0 +1,46 @@ +digraph magSqr_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc513 { label=""; color=white; margin=0; c513 [label="{{|}|\|{}}"] } + subgraph clusterc793 { label=""; color=white; margin=0; c793 [label="{{|}|\|{}}"] } + subgraph clusterc981 { label=""; color=white; margin=0; c981 [label="{{|}|+|{}}"] } + subgraph cluster_1009 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1003 [label="{{|}|\|{}}"] + c1005 [label="{{|}|\|{}}"] + c1004 [label="{{|}|+|{}}"] + c1007 [label="{{|}|+|{}}"] + c1006 [label="{{|}|+|{}}"] + c1002 [label="{In|{|}}"] + c1008 [label="{{}|Out}"] + c0:Out0 -> c1003:In0 [label="Double"] + c1002:Out0 -> c1003:In1 [label="Double"] + c0:Out1 -> c1005:In0 [label="Double"] + c1002:Out1 -> c1005:In1 [label="Double"] + c1003:Out0 -> c1004:In0 [label="Double"] + c1003:Out0 -> c1004:In1 [label="Double"] + c1004:Out0 -> c1007:In0 [label="Double"] + c1006:Out0 -> c1007:In1 [label="Double"] + c1005:Out0 -> c1006:In0 [label="Double"] + c1005:Out0 -> c1006:In1 [label="Double"] + c1007:Out0 -> c1008:In0 [label="Double"] + } + subgraph clusterc1010 { label=""; color=white; margin=0; c1010 [label="{{|}|Out}"] } + c0:Out1 -> c513:In0 [label="Double"] + c0:Out1 -> c513:In1 [label="Double"] + c0:Out0 -> c793:In0 [label="Double"] + c0:Out0 -> c793:In1 [label="Double"] + c513:Out0 -> c981:In0 [label="Double"] + c793:Out0 -> c981:In1 [label="Double"] + c981:Out0 -> c1010:In0 [label="Double"] + c1008 -> c1010:In1 [ltail=cluster_1009,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/magSqr-adf-syn.golden b/plugin/test/gold/902/magSqr-adf-syn.golden new file mode 100644 index 000000000..6c16a256a --- /dev/null +++ b/plugin/test/gold/902/magSqr-adf-syn.golden @@ -0,0 +1,223 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . curry (addC . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exl . exr . exl) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** abst . curry (exr . exr)) . dup) . exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr *** + abst . curry (dup . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exl . exr . exl) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** abst . curry (exr . exr)) . dup) . exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/magSqr-adr-dot.golden b/plugin/test/gold/902/magSqr-adr-dot.golden new file mode 100644 index 000000000..235748b01 --- /dev/null +++ b/plugin/test/gold/902/magSqr-adr-dot.golden @@ -0,0 +1,44 @@ +digraph magSqr_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } + subgraph clusterc956 { label=""; color=white; margin=0; c956 [label="{{|}|\|{}}"] } + subgraph clusterc1480 { label=""; color=white; margin=0; c1480 [label="{{|}|\|{}}"] } + subgraph clusterc1850 { label=""; color=white; margin=0; c1850 [label="{{|}|+|{}}"] } + subgraph cluster_1908 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1902 [label="{{|}|\|{}}"] + c1905 [label="{{|}|\|{}}"] + c1904 [label="{{|}|+|{}}"] + c1906 [label="{{|}|+|{}}"] + c1901 [label="{In|{}}"] + c1907 [label="{{|}|Out}"] + c0:Out0 -> c1902:In0 [label="Double"] + c1901:Out0 -> c1902:In1 [label="Double"] + c0:Out1 -> c1905:In0 [label="Double"] + c1901:Out0 -> c1905:In1 [label="Double"] + c1902:Out0 -> c1904:In0 [label="Double"] + c1902:Out0 -> c1904:In1 [label="Double"] + c1905:Out0 -> c1906:In0 [label="Double"] + c1905:Out0 -> c1906:In1 [label="Double"] + c1904:Out0 -> c1907:In0 [label="Double"] + c1906:Out0 -> c1907:In1 [label="Double"] + } + subgraph clusterc1909 { label=""; color=white; margin=0; c1909 [label="{{|}|Out}"] } + c0:Out1 -> c956:In0 [label="Double"] + c0:Out1 -> c956:In1 [label="Double"] + c0:Out0 -> c1480:In0 [label="Double"] + c0:Out0 -> c1480:In1 [label="Double"] + c956:Out0 -> c1850:In0 [label="Double"] + c1480:Out0 -> c1850:In1 [label="Double"] + c1850:Out0 -> c1909:In0 [label="Double"] + c1907 -> c1909:In1 [ltail=cluster_1908,label="Double Double Double"] +} diff --git a/plugin/test/gold/902/magSqr-adr-syn.golden b/plugin/test/gold/902/magSqr-adr-syn.golden new file mode 100644 index 000000000..ff7eee668 --- /dev/null +++ b/plugin/test/gold/902/magSqr-adr-syn.golden @@ -0,0 +1,360 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exl . exr . exl) . dup) . (id *** exl . exr . exl) . dup *** + ((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exr . exl) . dup) . (id *** exr . exr . exl) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/magSqr-dot.golden b/plugin/test/gold/902/magSqr-dot.golden new file mode 100644 index 000000000..6beba561e --- /dev/null +++ b/plugin/test/gold/902/magSqr-dot.golden @@ -0,0 +1,21 @@ +digraph magSqr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|+|{}}"] + c4 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c0:Out1 -> c2:In0 [label="Double"] + c0:Out1 -> c2:In1 [label="Double"] + c1:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/magSqr-gradr-dot.golden b/plugin/test/gold/902/magSqr-gradr-dot.golden new file mode 100644 index 000000000..54141195b --- /dev/null +++ b/plugin/test/gold/902/magSqr-gradr-dot.golden @@ -0,0 +1,29 @@ +digraph magSqr_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c956 [label="{{|}|\|{}}"] + c1480 [label="{{|}|\|{}}"] + c1850 [label="{{|}|+|{}}"] + c1911 [label="{{|}|+|{}}"] + c1912 [label="{{|}|+|{}}"] + c1913 [label="{{||}|Out}"] + c0:Out1 -> c956:In0 [label="Double"] + c0:Out1 -> c956:In1 [label="Double"] + c0:Out0 -> c1480:In0 [label="Double"] + c0:Out0 -> c1480:In1 [label="Double"] + c956:Out0 -> c1850:In0 [label="Double"] + c1480:Out0 -> c1850:In1 [label="Double"] + c0:Out0 -> c1911:In0 [label="Double"] + c0:Out0 -> c1911:In1 [label="Double"] + c0:Out1 -> c1912:In0 [label="Double"] + c0:Out1 -> c1912:In1 [label="Double"] + c1850:Out0 -> c1913:In0 [label="Double"] + c1911:Out0 -> c1913:In1 [label="Double"] + c1912:Out0 -> c1913:In2 [label="Double"] +} diff --git a/plugin/test/gold/902/magSqr-gradr-syn.golden b/plugin/test/gold/902/magSqr-gradr-syn.golden new file mode 100644 index 000000000..21f5ca1a0 --- /dev/null +++ b/plugin/test/gold/902/magSqr-gradr-syn.golden @@ -0,0 +1,362 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exl . exr . exl) . dup) . (id *** exl . exr . exl) . dup *** + ((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exr . exl) . dup) . (id *** exr . exr . exl) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . + (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . + apply . + ((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((exl *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . + dup) . + dup) . + apply . + ((curry + (apply . + (curry + (((exl . exr *** exl . exr . exl) . dup *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exr . exr *** + exr . exr . exl) . + dup) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exl . exr . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . + ((exr *** + abst . + abst . curry ((((const 0.0 *** const 0.0) . dup *** id) . dup) . exr)) . + dup) . + exr . exr) . + dup) . + ((id *** dup) . dup) . exl) . + dup) . +(dup *** + abst . + abst . + curry + (((addC . (exl . exr . exl *** exl . exr) . dup *** + addC . (exr . exr . exl *** exr . exr) . dup) . + dup) . + ((id *** exr . exl) . dup) . ((id *** exl) . dup) . exr)) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/magSqr-syn.golden b/plugin/test/gold/902/magSqr-syn.golden new file mode 100644 index 000000000..3cbccedb9 --- /dev/null +++ b/plugin/test/gold/902/magSqr-syn.golden @@ -0,0 +1,4 @@ +addC . +((mulC . ((exl *** exl) . dup) . exr *** mulC . ((exr *** exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/maximum-derf.golden b/plugin/test/gold/902/maximum-derf.golden new file mode 100644 index 000000000..e347ea3a9 --- /dev/null +++ b/plugin/test/gold/902/maximum-derf.golden @@ -0,0 +1 @@ +(7.0,2.0) \ No newline at end of file diff --git a/plugin/test/gold/902/maximum-derr.golden b/plugin/test/gold/902/maximum-derr.golden new file mode 100644 index 000000000..fd8a49770 --- /dev/null +++ b/plugin/test/gold/902/maximum-derr.golden @@ -0,0 +1 @@ +(7.0,Vector [7.0,7.0,7.0,7.0,7.0]) \ No newline at end of file diff --git a/plugin/test/gold/902/maximum-gradr.golden b/plugin/test/gold/902/maximum-gradr.golden new file mode 100644 index 000000000..d3f5183d7 --- /dev/null +++ b/plugin/test/gold/902/maximum-gradr.golden @@ -0,0 +1 @@ +(7.0,Vector [1.0,1.0,1.0,1.0,1.0]) \ No newline at end of file diff --git a/plugin/test/gold/902/sin-adf-dot.golden b/plugin/test/gold/902/sin-adf-dot.golden new file mode 100644 index 000000000..412357d29 --- /dev/null +++ b/plugin/test/gold/902/sin-adf-dot.golden @@ -0,0 +1,29 @@ +digraph sin_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc12 { label=""; color=white; margin=0; c12 [label="{{}|sin|{}}"] } + subgraph clusterc13 { label=""; color=white; margin=0; c13 [label="{{}|cos|{}}"] } + subgraph cluster_20 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c18 [label="{{|}|\|{}}"] + c17 [label="{In|{}}"] + c19 [label="{{}|Out}"] + c13:Out0 -> c18:In0 [label="Double"] + c17:Out0 -> c18:In1 [label="Double"] + c18:Out0 -> c19:In0 [label="Double"] + } + subgraph clusterc21 { label=""; color=white; margin=0; c21 [label="{{|}|Out}"] } + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c21:In0 [label="Double"] + c19 -> c21:In1 [ltail=cluster_20,label="Double Double"] +} diff --git a/plugin/test/gold/902/sin-adf-syn.golden b/plugin/test/gold/902/sin-adf-syn.golden new file mode 100644 index 000000000..c84410931 --- /dev/null +++ b/plugin/test/gold/902/sin-adf-syn.golden @@ -0,0 +1,7 @@ +second (id . repr) . +apply . +(curry + ((exr *** abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/sin-adr-dot.golden b/plugin/test/gold/902/sin-adr-dot.golden new file mode 100644 index 000000000..d017f0d9c --- /dev/null +++ b/plugin/test/gold/902/sin-adr-dot.golden @@ -0,0 +1,29 @@ +digraph sin_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc12 { label=""; color=white; margin=0; c12 [label="{{}|sin|{}}"] } + subgraph clusterc13 { label=""; color=white; margin=0; c13 [label="{{}|cos|{}}"] } + subgraph cluster_20 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c18 [label="{{|}|\|{}}"] + c17 [label="{In|{}}"] + c19 [label="{{}|Out}"] + c13:Out0 -> c18:In0 [label="Double"] + c17:Out0 -> c18:In1 [label="Double"] + c18:Out0 -> c19:In0 [label="Double"] + } + subgraph clusterc21 { label=""; color=white; margin=0; c21 [label="{{|}|Out}"] } + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c21:In0 [label="Double"] + c19 -> c21:In1 [ltail=cluster_20,label="Double Double"] +} diff --git a/plugin/test/gold/902/sin-adr-syn.golden b/plugin/test/gold/902/sin-adr-syn.golden new file mode 100644 index 000000000..23b07c29a --- /dev/null +++ b/plugin/test/gold/902/sin-adr-syn.golden @@ -0,0 +1,9 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/sin-gradr-dot.golden b/plugin/test/gold/902/sin-gradr-dot.golden new file mode 100644 index 000000000..ec826a311 --- /dev/null +++ b/plugin/test/gold/902/sin-gradr-dot.golden @@ -0,0 +1,17 @@ +digraph sin_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c12 [label="{{}|sin|{}}"] + c13 [label="{{}|cos|{}}"] + c22 [label="{{|}|Out}"] + c0:Out0 -> c12:In0 [label="Double"] + c0:Out0 -> c13:In0 [label="Double"] + c12:Out0 -> c22:In0 [label="Double"] + c13:Out0 -> c22:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/sin-gradr-syn.golden b/plugin/test/gold/902/sin-gradr-syn.golden new file mode 100644 index 000000000..16dcf2193 --- /dev/null +++ b/plugin/test/gold/902/sin-gradr-syn.golden @@ -0,0 +1,11 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +(curry + ((exr *** + abst . abst . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + dup) *** + sinC) . +dup \ No newline at end of file diff --git a/plugin/test/gold/902/sqr-adf-dot.golden b/plugin/test/gold/902/sqr-adf-dot.golden new file mode 100644 index 000000000..56369cc5b --- /dev/null +++ b/plugin/test/gold/902/sqr-adf-dot.golden @@ -0,0 +1,31 @@ +digraph sqr_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc27 { label=""; color=white; margin=0; c27 [label="{{|}|\|{}}"] } + subgraph cluster_101 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c98 [label="{{|}|\|{}}"] + c99 [label="{{|}|+|{}}"] + c97 [label="{In|{}}"] + c100 [label="{{}|Out}"] + c0:Out0 -> c98:In0 [label="Double"] + c97:Out0 -> c98:In1 [label="Double"] + c98:Out0 -> c99:In0 [label="Double"] + c98:Out0 -> c99:In1 [label="Double"] + c99:Out0 -> c100:In0 [label="Double"] + } + subgraph clusterc102 { label=""; color=white; margin=0; c102 [label="{{|}|Out}"] } + c0:Out0 -> c27:In0 [label="Double"] + c0:Out0 -> c27:In1 [label="Double"] + c27:Out0 -> c102:In0 [label="Double"] + c100 -> c102:In1 [ltail=cluster_101,label="Double Double"] +} diff --git a/plugin/test/gold/902/sqr-adf-syn.golden b/plugin/test/gold/902/sqr-adf-syn.golden new file mode 100644 index 000000000..7780b5cf2 --- /dev/null +++ b/plugin/test/gold/902/sqr-adf-syn.golden @@ -0,0 +1,35 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((coerce . + curry + (curry (addC . apply) . + apply . + (curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . exl *** + repr . exr) . + dup) . + abst . curry mulC . exr . exr *** + abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/sqr-adr-dot.golden b/plugin/test/gold/902/sqr-adr-dot.golden new file mode 100644 index 000000000..4993f8d95 --- /dev/null +++ b/plugin/test/gold/902/sqr-adr-dot.golden @@ -0,0 +1,31 @@ +digraph sqr_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc53 { label=""; color=white; margin=0; c53 [label="{{|}|\|{}}"] } + subgraph cluster_202 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c199 [label="{{|}|\|{}}"] + c200 [label="{{|}|+|{}}"] + c198 [label="{In|{}}"] + c201 [label="{{}|Out}"] + c0:Out0 -> c199:In0 [label="Double"] + c198:Out0 -> c199:In1 [label="Double"] + c199:Out0 -> c200:In0 [label="Double"] + c199:Out0 -> c200:In1 [label="Double"] + c200:Out0 -> c201:In0 [label="Double"] + } + subgraph clusterc203 { label=""; color=white; margin=0; c203 [label="{{|}|Out}"] } + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c203:In0 [label="Double"] + c201 -> c203:In1 [ltail=cluster_202,label="Double Double"] +} diff --git a/plugin/test/gold/902/sqr-adr-syn.golden b/plugin/test/gold/902/sqr-adr-syn.golden new file mode 100644 index 000000000..0edde29a4 --- /dev/null +++ b/plugin/test/gold/902/sqr-adr-syn.golden @@ -0,0 +1,53 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/sqr-dot.golden b/plugin/test/gold/902/sqr-dot.golden new file mode 100644 index 000000000..a9f70b531 --- /dev/null +++ b/plugin/test/gold/902/sqr-dot.golden @@ -0,0 +1,15 @@ +digraph sqr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|\|{}}"] + c2 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/sqr-gradr-dot.golden b/plugin/test/gold/902/sqr-gradr-dot.golden new file mode 100644 index 000000000..5980b83c1 --- /dev/null +++ b/plugin/test/gold/902/sqr-gradr-dot.golden @@ -0,0 +1,19 @@ +digraph sqr_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c53 [label="{{|}|\|{}}"] + c204 [label="{{|}|+|{}}"] + c205 [label="{{|}|Out}"] + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c0:Out0 -> c204:In0 [label="Double"] + c0:Out0 -> c204:In1 [label="Double"] + c53:Out0 -> c205:In0 [label="Double"] + c204:Out0 -> c205:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/sqr-gradr-syn.golden b/plugin/test/gold/902/sqr-gradr-syn.golden new file mode 100644 index 000000000..45ecdc00a --- /dev/null +++ b/plugin/test/gold/902/sqr-gradr-syn.golden @@ -0,0 +1,55 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((mulC *** + apply . + ((curry + (abst . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . + repr . repr . exl *** + repr . exr) . + dup *** + abst . curry (dup . exr)) . + dup) . + abst . abst . curry mulC . exr . exr *** + abst . abst . curry mulC . exl . exr) . + dup) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/sqr-syn.golden b/plugin/test/gold/902/sqr-syn.golden new file mode 100644 index 000000000..71c93dc16 --- /dev/null +++ b/plugin/test/gold/902/sqr-syn.golden @@ -0,0 +1 @@ +mulC . dup \ No newline at end of file diff --git a/plugin/test/gold/902/twice-adf-dot.golden b/plugin/test/gold/902/twice-adf-dot.golden new file mode 100644 index 000000000..01d49c491 --- /dev/null +++ b/plugin/test/gold/902/twice-adf-dot.golden @@ -0,0 +1,28 @@ +digraph twice_adf { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc27 { label=""; color=white; margin=0; c27 [label="{{|}|+|{}}"] } + subgraph cluster_51 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c49 [label="{{|}|+|{}}"] + c48 [label="{In|{}}"] + c50 [label="{{}|Out}"] + c48:Out0 -> c49:In0 [label="Double"] + c48:Out0 -> c49:In1 [label="Double"] + c49:Out0 -> c50:In0 [label="Double"] + } + subgraph clusterc52 { label=""; color=white; margin=0; c52 [label="{{|}|Out}"] } + c0:Out0 -> c27:In0 [label="Double"] + c0:Out0 -> c27:In1 [label="Double"] + c27:Out0 -> c52:In0 [label="Double"] + c50 -> c52:In1 [ltail=cluster_51,label="Double Double"] +} diff --git a/plugin/test/gold/902/twice-adf-syn.golden b/plugin/test/gold/902/twice-adf-syn.golden new file mode 100644 index 000000000..f09fd4faa --- /dev/null +++ b/plugin/test/gold/902/twice-adf-syn.golden @@ -0,0 +1,16 @@ +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . curry (addC . exr)) . dup) . exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/twice-adr-dot.golden b/plugin/test/gold/902/twice-adr-dot.golden new file mode 100644 index 000000000..632b5f131 --- /dev/null +++ b/plugin/test/gold/902/twice-adr-dot.golden @@ -0,0 +1,28 @@ +digraph twice_adr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{}}"] } + subgraph clusterc53 { label=""; color=white; margin=0; c53 [label="{{|}|+|{}}"] } + subgraph cluster_99 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c97 [label="{{|}|+|{}}"] + c96 [label="{In|{}}"] + c98 [label="{{}|Out}"] + c96:Out0 -> c97:In0 [label="Double"] + c96:Out0 -> c97:In1 [label="Double"] + c97:Out0 -> c98:In0 [label="Double"] + } + subgraph clusterc100 { label=""; color=white; margin=0; c100 [label="{{|}|Out}"] } + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c100:In0 [label="Double"] + c98 -> c100:In1 [ltail=cluster_99,label="Double Double"] +} diff --git a/plugin/test/gold/902/twice-adr-syn.golden b/plugin/test/gold/902/twice-adr-syn.golden new file mode 100644 index 000000000..52e2873c1 --- /dev/null +++ b/plugin/test/gold/902/twice-adr-syn.golden @@ -0,0 +1,24 @@ +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/twice-dot.golden b/plugin/test/gold/902/twice-dot.golden new file mode 100644 index 000000000..8286b1b80 --- /dev/null +++ b/plugin/test/gold/902/twice-dot.golden @@ -0,0 +1,15 @@ +digraph twice { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c1 [label="{{|}|+|{}}"] + c2 [label="{{}|Out}"] + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c2:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/twice-gradr-dot.golden b/plugin/test/gold/902/twice-gradr-dot.golden new file mode 100644 index 000000000..6c7b1b394 --- /dev/null +++ b/plugin/test/gold/902/twice-gradr-dot.golden @@ -0,0 +1,17 @@ +digraph twice_gradr { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{}}"] + c53 [label="{{|}|+|{}}"] + c101 [label="{2.0|{}}"] + c102 [label="{{|}|Out}"] + c0:Out0 -> c53:In0 [label="Double"] + c0:Out0 -> c53:In1 [label="Double"] + c53:Out0 -> c102:In0 [label="Double"] + c101:Out0 -> c102:In1 [label="Double"] +} diff --git a/plugin/test/gold/902/twice-gradr-syn.golden b/plugin/test/gold/902/twice-gradr-syn.golden new file mode 100644 index 000000000..feaa5c507 --- /dev/null +++ b/plugin/test/gold/902/twice-gradr-syn.golden @@ -0,0 +1,26 @@ +((exl . id *** + apply . ((repr . exr *** const 1.0) . dup) . (id *** exr . id) . dup) . + dup) . +second (id . repr) . +apply . +((curry + ((exl . exr *** + apply . + (coerce . + curry + (apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . + dup) . + exr . exr *** + exr . exl) . + dup) . + dup) *** + ((addC *** abst . abst . curry (dup . exr)) . dup) . exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/twice-syn.golden b/plugin/test/gold/902/twice-syn.golden new file mode 100644 index 000000000..9242c719e --- /dev/null +++ b/plugin/test/gold/902/twice-syn.golden @@ -0,0 +1 @@ +addC . dup \ No newline at end of file diff --git a/plugin/test/gold/902/xp3y-dot.golden b/plugin/test/gold/902/xp3y-dot.golden new file mode 100644 index 000000000..2da92fbf1 --- /dev/null +++ b/plugin/test/gold/902/xp3y-dot.golden @@ -0,0 +1,19 @@ +digraph xp3y { + margin=0 + compound=true + rankdir=LR + node [shape=Mrecord] + edge [fontsize=8,fontcolor=indigo] + bgcolor=transparent + nslimit=20 + c0 [label="{In|{|}}"] + c1 [label="{3.0|{}}"] + c2 [label="{{|}|\|{}}"] + c3 [label="{{|}|+|{}}"] + c4 [label="{{}|Out}"] + c0:Out1 -> c2:In0 [label="Double"] + c1:Out0 -> c2:In1 [label="Double"] + c0:Out0 -> c3:In0 [label="Double"] + c2:Out0 -> c3:In1 [label="Double"] + c3:Out0 -> c4:In0 [label="Double"] +} diff --git a/plugin/test/gold/902/xp3y-syn.golden b/plugin/test/gold/902/xp3y-syn.golden new file mode 100644 index 000000000..17158c9b9 --- /dev/null +++ b/plugin/test/gold/902/xp3y-syn.golden @@ -0,0 +1 @@ +addC . ((exl . exr *** mulC . (const 3.0 *** exr . exr) . dup) . dup) . dup \ No newline at end of file diff --git a/examples/test/gold/Makefile b/plugin/test/gold/Makefile similarity index 100% rename from examples/test/gold/Makefile rename to plugin/test/gold/Makefile diff --git a/satisfy/src/ConCat/BuildDictionary.hs b/satisfy/src/ConCat/BuildDictionary.hs index c35579b18..cd246b9f6 100644 --- a/satisfy/src/ConCat/BuildDictionary.hs +++ b/satisfy/src/ConCat/BuildDictionary.hs @@ -23,31 +23,55 @@ module ConCat.BuildDictionary ,WithType(..) , withType ,varWithType -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) ,uniqSetToList -#endif ,annotateEvidence ) where import Data.Monoid (Any(..)) import Data.Char (isSpace) import Control.Monad (filterM,when) - -import GhcPlugins - import Control.Arrow (second) +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import GHC.Core.Predicate +import GHC.Core.TyCo.Rep (CoercionHole(..), Type(..)) +import GHC.Core.TyCon (isTupleTyCon) +import GHC.HsToCore.Binds +import GHC.HsToCore.Monad +import GHC.Plugins +import GHC.Tc.Errors(warnAllUnsolved) +import GHC.Tc.Module +import GHC.Tc.Solver +import GHC.Tc.Solver.Interact (solveSimpleGivens) +import GHC.Tc.Solver.Monad -- (TcS,runTcS) +import GHC.Tc.Types +import GHC.Tc.Types.Constraint +import GHC.Tc.Types.Evidence (evBindMapBinds) +import GHC.Tc.Types.Origin +import qualified GHC.Tc.Utils.Instantiate as TcMType +import GHC.Tc.Utils.Monad (getCtLocM,traceTc) +import GHC.Tc.Utils.Zonk (emptyZonkEnv,zonkEvBinds) +import GHC.Types.Unique (mkUniqueGrimily) +import qualified GHC.Types.Unique.Set as NonDetSet +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import GHC.Runtime.Context (InteractiveContext (..), InteractiveImport (..)) +import GHC.Types.Error (getErrorMessages, getWarningMessages) +import GHC.Unit.Finder (FindResult (..), findExposedPackageModule) +import GHC.Unit.Module.Deps (Dependencies (..)) +import GHC.Utils.Error (pprMsgEnvelopeBagWithLoc) +#else +import GHC.Driver.Finder (findExposedPackageModule) +import GHC.Utils.Error (pprErrMsgBagWithLoc) +#endif +#else +import GhcPlugins import TyCoRep (CoercionHole(..), Type(..)) import TyCon (isTupleTyCon) import TcHsSyn (emptyZonkEnv,zonkEvBinds) import TcRnMonad (getCtLocM,traceTc) -#if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) import Constraint import TcOrigin import Predicate -#else -import TcRnTypes (cc_ev) -#endif import TcInteract (solveSimpleGivens) import TcSMonad -- (TcS,runTcS) import TcEvidence (evBindMapBinds) @@ -59,12 +83,10 @@ import DsBinds import TcSimplify import TcRnTypes import ErrUtils (pprErrMsgBagWithLoc) -import Encoding (zEncodeString) import Unique (mkUniqueGrimily) import Finder (findExposedPackageModule) import TcRnDriver -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) import qualified UniqSet as NonDetSet #endif -- Temp @@ -73,6 +95,9 @@ import qualified UniqSet as NonDetSet import ConCat.Simplify +isEvVarType' :: Type -> Bool +isEvVarType' = isEvVarType + isFound :: FindResult -> Bool isFound (Found _ _) = True isFound _ = False @@ -80,10 +105,22 @@ isFound _ = False moduleIsOkay :: HscEnv -> ModuleName -> IO Bool moduleIsOkay env mname = isFound <$> findExposedPackageModule env mname Nothing -#if MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) +mkLocalId' :: HasDebugCallStack => Name -> Type -> Id +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +mkLocalId' n = mkLocalId n One +#else +mkLocalId' = mkLocalId +#endif + +mkWildCase' :: CoreExpr -> Type -> Type -> [CoreAlt] -> CoreExpr +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +mkWildCase' ce t = mkWildCase ce (linear t) +#else +mkWildCase' = mkWildCase +#endif + uniqSetToList :: UniqSet a -> [a] uniqSetToList = NonDetSet.nonDetEltsUniqSet -#endif -- #define TRACING pprTrace' :: String -> SDoc -> a -> a @@ -105,9 +142,15 @@ runTcM env0 dflags guts m = do orphans <- filterM (moduleIsOkay env0) (moduleName <$> dep_orphs (mg_deps guts)) -- pprTrace' "runTcM orphans" (ppr orphans) (return ()) (msgs, mr) <- runTcInteractive (env orphans) m +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + let showMsgs msg = showSDoc dflags $ vcat $ + text "Errors:" : pprMsgEnvelopeBagWithLoc (getErrorMessages msg) + ++ text "Warnings:" : pprMsgEnvelopeBagWithLoc (getWarningMessages msg) +#else let showMsgs (warns, errs) = showSDoc dflags $ vcat $ text "Errors:" : pprErrMsgBagWithLoc errs ++ text "Warnings:" : pprErrMsgBagWithLoc warns +#endif maybe (fail $ showMsgs msgs) return mr where imports0 = ic_imports (hsc_IC env0) @@ -157,11 +200,7 @@ buildDictionary' env dflags guts evIds predTy = return z ) traceTc' "buildDictionary' back from runTcS" (ppr bnds0) -#if MIN_VERSION_GLASGOW_HASKELL(8,8,0,0) ez <- emptyZonkEnv -#else - let ez = emptyZonkEnv -#endif -- Use the newly exported zonkEvBinds. (_env',bnds) <- zonkEvBinds ez bnds0 -- traceTc "buildDictionary' _wCs'" (ppr _wCs') @@ -184,7 +223,7 @@ buildDictionary :: HscEnv -> DynFlags -> ModGuts -> UniqSupply -> InScopeEnv -> buildDictionary env dflags guts uniqSupply inScope evType@(TyConApp tyCon evTypes) ev goalTy | isTupleTyCon tyCon = reallyBuildDictionary env dflags guts uniqSupply inScope evType evTypes ev goalTy -- only 1-tuples in Haskell -buildDictionary env dflags guts uniqSupply inScope evType ev goalTy | isEvVarType evType = +buildDictionary env dflags guts uniqSupply inScope evType ev goalTy | isEvVarType' evType = reallyBuildDictionary env dflags guts uniqSupply inScope evType [evType] ev goalTy buildDictionary _env _dflags _guts _uniqSupply _inScope evT _ev _goalTy = pprPanic "evidence type mismatch" (ppr evT) @@ -196,7 +235,7 @@ reallyBuildDictionary env dflags guts uniqSupply _inScope evType evTypes ev goal where evIds = [ local | (evTy, unq) <- evTypes `zip` (uniqsFromSupply uniqSupply) - , let local = mkLocalId (mkSystemVarName unq evVarName) evTy ] + , let local = mkLocalId' (mkSystemVarName unq evVarName) evTy ] evIdSet = mkVarSet evIds reassemble Nothing = Left (text "unsolved constraints") @@ -220,7 +259,11 @@ reallyBuildDictionary env dflags guts uniqSupply _inScope evType evTypes ev goal then dict else case evIds of [evId] -> mkCoreLet (NonRec evId ev) dict - _ -> mkWildCase ev evType goalTy [(DataAlt (tupleDataCon Boxed (length evIds)), evIds, dict)] +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + _ -> mkWildCase' ev evType goalTy [Alt (DataAlt (tupleDataCon Boxed (length evIds))) evIds dict] +#else + _ -> mkWildCase' ev evType goalTy [(DataAlt (tupleDataCon Boxed (length evIds)), evIds, dict)] +#endif evVarName :: FastString evVarName = mkFastString "evidence" @@ -301,8 +344,13 @@ annotateExpr fnId fnId' typeArgsCount expr0 = go _evVars expr@(Type _) = expr go _evVars expr@(Coercion _) = expr +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + annotateAlt evVars (Alt con binders rhs) = + Alt con binders $ go (extendEvVarsList evVars binders) rhs +#else annotateAlt evVars (con, binders, rhs) = (con, binders, go (extendEvVarsList evVars binders) rhs) +#endif -- Maybe place in a GHC utils module. diff --git a/satisfy/src/ConCat/Satisfy/Plugin.hs b/satisfy/src/ConCat/Satisfy/Plugin.hs index 62d32148f..0f33cf26f 100644 --- a/satisfy/src/ConCat/Satisfy/Plugin.hs +++ b/satisfy/src/ConCat/Satisfy/Plugin.hs @@ -10,20 +10,31 @@ module ConCat.Satisfy.Plugin where import System.IO.Unsafe (unsafePerformIO) -- GHC API +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import GHC.Core.Unfold (defaultUnfoldingOpts) +import qualified GHC.Driver.Backend as Backend +import GHC.Utils.Logger (getLogger) +#endif +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import GHC.Core.Class (classAllSelIds) +import GHC.Core.Make (mkCoreTup) +import GHC.Plugins as GHC +import GHC.Runtime.Loader +import GHC.Types.Id.Make (mkDictSelRhs) +#else import GhcPlugins as GHC import Class (classAllSelIds) import MkId (mkDictSelRhs) import MkCore (mkCoreTup) import DynamicLoading +#endif import ConCat.BuildDictionary (buildDictionary, annotateEvidence) import ConCat.Inline.Plugin (findId) plugin :: Plugin plugin = defaultPlugin { installCoreToDos = install -#if MIN_VERSION_GLASGOW_HASKELL(8,6,0,0) , pluginRecompile = purePlugin -#endif } on_mg_rules :: ([CoreRule] -> [CoreRule]) -> (ModGuts -> ModGuts) @@ -35,12 +46,15 @@ install _opts todos = do dflags <- getDynFlags -- Unfortunately, the plugin doesn't work in GHCi. Until fixed, -- disable under GHCi, so we can at least type-check conveniently. +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + logger <- getLogger + if backend dflags == Backend.Interpreter then + return todos +#else if hscTarget dflags == HscInterpreted then return todos - else do -#if !MIN_VERSION_GLASGOW_HASKELL(8,2,0,0) - reinitializeGlobals #endif + else do hscEnv <- getHscEnv pprTrace "Install satisfyRule" empty (return ()) uniqSupply <- getUniqueSupplyM @@ -48,27 +62,26 @@ install _opts todos = addRule guts = do satisfyPV <- findId "ConCat.Satisfy" "satisfy'" pprTrace "adding satisfyRule" empty (return ()) - return (on_mg_rules (++ [satisfyRule hscEnv guts uniqSupply satisfyPV]) guts) + return (on_mg_rules (++ [satisfyRule hscEnv guts uniqSupply satisfyPV dflags]) guts) isOurRule r = (isBuiltinRule r) && (ru_name r == satisfyRuleName) delRule guts = do pprTrace "removing satisfyRule" empty (return ()) return (on_mg_rules (filter (not . isOurRule)) guts) - mode -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) - dflags -#else - _dflags -#endif + mode dflags = SimplMode { sm_names = ["Satisfy simplifier pass"] , sm_phase = Phase 3 -- ?? , sm_rules = True -- important , sm_inline = False -- important , sm_eta_expand = False -- ?? , sm_case_case = True -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) - , sm_dflags = dflags +#if MIN_VERSION_GLASGOW_HASKELL(9,2,2,0) + , sm_cast_swizzle = True + , sm_uf_opts = defaultUnfoldingOpts + , sm_pre_inline = False + , sm_logger = logger #endif + , sm_dflags = dflags } -- It really needs to be this early, otherwise ghc will -- break up the calls and the rule will not fire. @@ -89,12 +102,12 @@ satisfyRuleName :: FastString satisfyRuleName = fsLit "satisfy'Rule" -- satisfy :: forall c z. (c => z) -> z -satisfyRule :: HscEnv -> ModGuts -> UniqSupply -> Id -> CoreRule -satisfyRule env guts uniqSupply satisfyPV = BuiltinRule +satisfyRule :: HscEnv -> ModGuts -> UniqSupply -> Id -> DynFlags -> CoreRule +satisfyRule env guts uniqSupply satisfyPV dflags = BuiltinRule { ru_name = satisfyRuleName , ru_fn = varName satisfyPV , ru_nargs = 5 -- including type args - , ru_try = satisfy env guts uniqSupply + , ru_try = const $ satisfy env guts uniqSupply dflags } satisfy :: HscEnv -> ModGuts -> UniqSupply -> DynFlags -> InScopeEnv -> Id -> [CoreExpr] -> Maybe CoreExpr diff --git a/satisfy/src/ConCat/Simplify.hs b/satisfy/src/ConCat/Simplify.hs index c0e64d619..6abbfb2b7 100644 --- a/satisfy/src/ConCat/Simplify.hs +++ b/satisfy/src/ConCat/Simplify.hs @@ -22,6 +22,24 @@ module ConCat.Simplify (simplifyE) where import System.IO.Unsafe (unsafePerformIO) +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +#if !MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import GHC.Core (emptyRuleEnv) +#endif +import GHC.Core.FamInstEnv (emptyFamInstEnvs) +import GHC.Core.Opt.OccurAnal (occurAnalyseExpr) +import GHC.Core.Opt.Simplify (simplExpr) +import GHC.Core.Opt.Simplify.Env +import GHC.Core.Opt.Simplify.Monad (SimplM,initSmpl) +import GHC.Core.Stats (exprSize) +import GHC.Plugins +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +import GHC.Core.Unfold (defaultUnfoldingOpts) +import qualified GHC.Utils.Logger as Err +#else +import qualified GHC.Utils.Error as Err +#endif +#else import GhcPlugins import Simplify (simplExpr) import SimplMonad (SimplM,initSmpl) @@ -31,7 +49,19 @@ import SimplEnv import CoreStats (exprSize) import OccurAnal (occurAnalyseExpr) import FamInstEnv (emptyFamInstEnvs) +#endif +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +dumpIfSet_dyn' :: Err.Logger -> DynFlags -> DumpFlag -> String -> SDoc -> IO () +dumpIfSet_dyn' logger dflags dumpFlag str = + Err.dumpIfSet_dyn logger dflags dumpFlag str Err.FormatCore +#elif MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +dumpIfSet_dyn' :: DynFlags -> DumpFlag -> String -> SDoc -> IO () +dumpIfSet_dyn' dflags dumpFlag str = Err.dumpIfSet_dyn dflags dumpFlag str Err.FormatCore +#else +dumpIfSet_dyn' :: DynFlags -> DumpFlag -> String -> SDoc -> IO () +dumpIfSet_dyn' = Err.dumpIfSet_dyn +#endif {-------------------------------------------------------------------- Simplification @@ -53,15 +83,26 @@ simplifyExpr :: DynFlags -- includes spec of what core-to-core passes to do -- -- Also used by Template Haskell simplifyExpr dflags inline expr - = do us <- mkSplitUniqSupply 'r' - let sz = exprSize expr + = do let sz = exprSize expr +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) + logger <- Err.initLogger + (expr', counts) <- initSmpl logger dflags emptyRuleEnv + emptyFamInstEnvs sz + (simplExprGently (simplEnvForCcc dflags inline logger) expr) + Err.dumpIfSet logger dflags (dopt Opt_D_dump_simpl_stats dflags) + "Simplifier statistics" (pprSimplCount counts) + dumpIfSet_dyn' logger dflags Opt_D_dump_simpl "Simplified expression" + (ppr expr') +#else + us <- mkSplitUniqSupply 'r' (expr', counts) <- initSmpl dflags emptyRuleEnv emptyFamInstEnvs us sz (simplExprGently (simplEnvForCcc dflags inline) expr) Err.dumpIfSet dflags (dopt Opt_D_dump_simpl_stats dflags) "Simplifier statistics" (pprSimplCount counts) - Err.dumpIfSet_dyn dflags Opt_D_dump_simpl "Simplified expression" - (ppr expr') + dumpIfSet_dyn' dflags Opt_D_dump_simpl "Simplified expression" + (ppr expr') +#endif return expr' -- Copied from SimplCore (not exported) @@ -71,6 +112,27 @@ simplExprGently env expr = do simplExpr env (occurAnalyseExpr expr1) -- Like simplEnvForGHCi but with inlining. +#if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) +simplEnvForCcc :: DynFlags -> Bool -> Err.Logger -> SimplEnv +simplEnvForCcc dflags inline logger + = mkSimplEnv $ SimplMode { sm_names = ["Simplify for ccc"] + , sm_phase = Phase 0 -- Was InitialPhase + , sm_rules = rules_on + , sm_inline = inline -- was False + , sm_eta_expand = eta_expand_on + , sm_case_case = True + , sm_uf_opts = defaultUnfoldingOpts + , sm_pre_inline = inline + , sm_logger = logger + , sm_dflags = dflags +#if MIN_VERSION_GLASGOW_HASKELL(9,2,2,0) + , sm_cast_swizzle = True +#endif + } + where + rules_on = gopt Opt_EnableRewriteRules dflags + eta_expand_on = gopt Opt_DoLambdaEtaExpansion dflags +#else simplEnvForCcc :: DynFlags -> Bool -> SimplEnv simplEnvForCcc dflags inline = mkSimplEnv $ SimplMode { sm_names = ["Simplify for ccc"] @@ -79,10 +141,9 @@ simplEnvForCcc dflags inline , sm_inline = inline -- was False , sm_eta_expand = eta_expand_on , sm_case_case = True -#if MIN_VERSION_GLASGOW_HASKELL(8,4,0,0) , sm_dflags = dflags -#endif } where rules_on = gopt Opt_EnableRewriteRules dflags eta_expand_on = gopt Opt_DoLambdaEtaExpansion dflags +#endif diff --git a/shell.nix b/shell.nix index 6159b247c..72ff81e72 100644 --- a/shell.nix +++ b/shell.nix @@ -1,15 +1,22 @@ with import ./nix/pkgs.nix; -pkgs.haskellPackages.shellFor { - nativeBuildInputs = [ cabal-install ghc graphviz ]; - packages = p: - with pkgs.haskellPackages; [ - concat-classes - concat-examples - concat-graphics - concat-hardware - concat-inline - concat-known - concat-plugin - concat-satisfy + pkgs.haskellPackages.shellFor { + nativeBuildInputs = with pkgs; [ + cabal-install + ghc + graphviz + (pkgs.haskell-language-server.override { + supportedGhcVersions = ["8107" "902" "924"]; + }) ]; -} + packages = p: + with pkgs.haskellPackages; [ + concat-classes + concat-examples + concat-graphics + concat-hardware + concat-inline + concat-known + concat-plugin + concat-satisfy + ]; + }