From c74f4cbb901248381d3c7d9d54c45e499212a6d9 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 14 Mar 2022 09:41:49 -1000 Subject: [PATCH 01/28] Add CI via Github Actions. Maybe easier to maintain than Travis? --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ cabal.project | 5 ----- 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..23e39eac --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: concat +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ghc: + # - "8.0.2" # We've (temporarily?) lost support for these, but still + # - "8.2.2" # have conditional compilation for them. We should either + # - "8.4.1" # fix (some) of them or remove the CPP. + # - "8.6.1" + - "8.8.1" + - "8.10.1" + 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 9115b3df..b98dc105 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 From fe43fa47eb6cecf06e38d68575146f9c71a3dd0a Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 4 Jan 2022 18:53:44 -1000 Subject: [PATCH 02/28] Make `traverseC` category-polymorphic. --- classes/src/ConCat/AltCat.hs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/classes/src/ConCat/AltCat.hs b/classes/src/ConCat/AltCat.hs index 957ea0c1..f769971f 100644 --- a/classes/src/ConCat/AltCat.hs +++ b/classes/src/ConCat/AltCat.hs @@ -1064,9 +1064,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) From aed4963b8d3b933758f49cb8415b318266a3feee Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Fri, 11 Feb 2022 12:59:24 -1000 Subject: [PATCH 03/28] Add some missing Additive instances. --- classes/src/ConCat/Additive.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/classes/src/ConCat/Additive.hs b/classes/src/ConCat/Additive.hs index 001bdfed..a498595b 100644 --- a/classes/src/ConCat/Additive.hs +++ b/classes/src/ConCat/Additive.hs @@ -73,6 +73,10 @@ instance Additive () where {-# INLINE (^+^) #-} } ScalarType(Int) +ScalarType(Int16) +ScalarType(Int32) +ScalarType(Int64) +ScalarType(Int8) ScalarType(Integer) ScalarType(Float) ScalarType(Double) @@ -84,6 +88,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 From 48453ec7ac2129e5b44aba449e6ae063261fbde5 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Thu, 11 Aug 2022 14:58:52 +0200 Subject: [PATCH 04/28] Add missing imports for Additive instances ... from previous commit. --- classes/src/ConCat/Additive.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/src/ConCat/Additive.hs b/classes/src/ConCat/Additive.hs index a498595b..e2c718fa 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) From 60489f499d0da3e9f436389c71e27fdebdc1cc03 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 11 Jan 2022 13:39:33 -1000 Subject: [PATCH 05/28] Reverse examples/plugin dependency relationship. This moves tests that depend on the plugin from concat-examples to concat-plugin. The one shortcoming, IMO, is that it requries duplicating the SMT flag. --- examples/concat-examples.cabal | 120 ----------------- plugin/concat-plugin.cabal | 122 ++++++++++++++++++ {examples => plugin}/test/BasicTests.hs | 0 {examples => plugin}/test/Examples.hs | 0 {examples => plugin}/test/GoldTests.hs | 0 {examples => plugin}/test/Miscellany.hs | 0 {examples => plugin}/test/Utils.hs | 0 {examples => plugin}/test/gold/Makefile | 0 .../test/gold/add-adf-dot.golden | 0 .../test/gold/add-adf-syn.golden | 0 .../test/gold/add-adr-dot.golden | 0 .../test/gold/add-adr-syn.golden | 0 {examples => plugin}/test/gold/add-dot.golden | 0 .../test/gold/add-gradr-dot.golden | 0 .../test/gold/add-gradr-syn.golden | 0 {examples => plugin}/test/gold/add-syn.golden | 0 .../test/gold/add-uncurry-dot.golden | 0 .../test/gold/add-uncurry-syn.golden | 0 .../test/gold/complex-mul-a-dot.golden | 0 .../test/gold/complex-mul-a-syn.golden | 0 .../test/gold/complex-mul-dot.golden | 0 .../test/gold/complex-mul-syn.golden | 0 .../test/gold/cos-2x-adf-dot.golden | 0 .../test/gold/cos-2x-adf-syn.golden | 0 .../test/gold/cos-2x-adr-dot.golden | 0 .../test/gold/cos-2x-adr-syn.golden | 0 .../test/gold/cos-2x-gradr-dot.golden | 0 .../test/gold/cos-2x-gradr-syn.golden | 0 .../test/gold/cos-2xx-adf-dot.golden | 0 .../test/gold/cos-2xx-adf-syn.golden | 0 .../test/gold/cos-2xx-adr-dot.golden | 0 .../test/gold/cos-2xx-adr-syn.golden | 0 .../test/gold/cos-2xx-dot.golden | 0 .../test/gold/cos-2xx-gradr-dot.golden | 0 .../test/gold/cos-2xx-gradr-syn.golden | 0 .../test/gold/cos-2xx-syn.golden | 0 .../test/gold/cos-adf-dot.golden | 0 .../test/gold/cos-adf-syn.golden | 0 .../test/gold/cos-adr-dot.golden | 0 .../test/gold/cos-adr-syn.golden | 0 .../test/gold/cos-gradr-dot.golden | 0 .../test/gold/cos-gradr-syn.golden | 0 .../test/gold/cos-xpy-adf-dot.golden | 0 .../test/gold/cos-xpy-adf-syn.golden | 0 .../test/gold/cos-xpy-adr-dot.golden | 0 .../test/gold/cos-xpy-adr-syn.golden | 0 .../test/gold/cos-xpy-gradr-dot.golden | 0 .../test/gold/cos-xpy-gradr-syn.golden | 0 .../test/gold/cosSinProd-adr-dot.golden | 0 .../test/gold/cosSinProd-adr-syn.golden | 0 .../test/gold/cosSinProd-dot.golden | 0 .../test/gold/cosSinProd-syn.golden | 0 {examples => plugin}/test/gold/dup-dot.golden | 0 {examples => plugin}/test/gold/dup-syn.golden | 0 {examples => plugin}/test/gold/fst-dot.golden | 0 {examples => plugin}/test/gold/fst-syn.golden | 0 .../test/gold/horner-dot.golden | 0 .../test/gold/horner-syn.golden | 0 .../test/gold/log-2xx-dot.golden | 0 .../test/gold/log-2xx-syn.golden | 0 .../test/gold/magSqr-adf-dot.golden | 0 .../test/gold/magSqr-adf-syn.golden | 0 .../test/gold/magSqr-adr-dot.golden | 0 .../test/gold/magSqr-adr-syn.golden | 0 .../test/gold/magSqr-dot.golden | 0 .../test/gold/magSqr-gradr-dot.golden | 0 .../test/gold/magSqr-gradr-syn.golden | 0 .../test/gold/magSqr-syn.golden | 0 .../test/gold/sin-adf-dot.golden | 0 .../test/gold/sin-adf-syn.golden | 0 .../test/gold/sin-adr-dot.golden | 0 .../test/gold/sin-adr-syn.golden | 0 .../test/gold/sin-gradr-dot.golden | 0 .../test/gold/sin-gradr-syn.golden | 0 .../test/gold/sqr-adf-dot.golden | 0 .../test/gold/sqr-adf-syn.golden | 0 .../test/gold/sqr-adr-dot.golden | 0 .../test/gold/sqr-adr-syn.golden | 0 {examples => plugin}/test/gold/sqr-dot.golden | 0 .../test/gold/sqr-gradr-dot.golden | 0 .../test/gold/sqr-gradr-syn.golden | 0 {examples => plugin}/test/gold/sqr-syn.golden | 0 .../test/gold/twice-adf-dot.golden | 0 .../test/gold/twice-adf-syn.golden | 0 .../test/gold/twice-adr-dot.golden | 0 .../test/gold/twice-adr-syn.golden | 0 .../test/gold/twice-dot.golden | 0 .../test/gold/twice-gradr-dot.golden | 0 .../test/gold/twice-gradr-syn.golden | 0 .../test/gold/twice-syn.golden | 0 .../test/gold/xp3y-dot.golden | 0 .../test/gold/xp3y-syn.golden | 0 92 files changed, 122 insertions(+), 120 deletions(-) rename {examples => plugin}/test/BasicTests.hs (100%) rename {examples => plugin}/test/Examples.hs (100%) rename {examples => plugin}/test/GoldTests.hs (100%) rename {examples => plugin}/test/Miscellany.hs (100%) rename {examples => plugin}/test/Utils.hs (100%) rename {examples => plugin}/test/gold/Makefile (100%) rename {examples => plugin}/test/gold/add-adf-dot.golden (100%) rename {examples => plugin}/test/gold/add-adf-syn.golden (100%) rename {examples => plugin}/test/gold/add-adr-dot.golden (100%) rename {examples => plugin}/test/gold/add-adr-syn.golden (100%) rename {examples => plugin}/test/gold/add-dot.golden (100%) rename {examples => plugin}/test/gold/add-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/add-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/add-syn.golden (100%) rename {examples => plugin}/test/gold/add-uncurry-dot.golden (100%) rename {examples => plugin}/test/gold/add-uncurry-syn.golden (100%) rename {examples => plugin}/test/gold/complex-mul-a-dot.golden (100%) rename {examples => plugin}/test/gold/complex-mul-a-syn.golden (100%) rename {examples => plugin}/test/gold/complex-mul-dot.golden (100%) rename {examples => plugin}/test/gold/complex-mul-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2x-adf-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2x-adf-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2x-adr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2x-adr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2x-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2x-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-adf-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-adf-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-adr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-adr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-2xx-syn.golden (100%) rename {examples => plugin}/test/gold/cos-adf-dot.golden (100%) rename {examples => plugin}/test/gold/cos-adf-syn.golden (100%) rename {examples => plugin}/test/gold/cos-adr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-adr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-adf-dot.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-adf-syn.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-adr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-adr-syn.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/cos-xpy-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/cosSinProd-adr-dot.golden (100%) rename {examples => plugin}/test/gold/cosSinProd-adr-syn.golden (100%) rename {examples => plugin}/test/gold/cosSinProd-dot.golden (100%) rename {examples => plugin}/test/gold/cosSinProd-syn.golden (100%) rename {examples => plugin}/test/gold/dup-dot.golden (100%) rename {examples => plugin}/test/gold/dup-syn.golden (100%) rename {examples => plugin}/test/gold/fst-dot.golden (100%) rename {examples => plugin}/test/gold/fst-syn.golden (100%) rename {examples => plugin}/test/gold/horner-dot.golden (100%) rename {examples => plugin}/test/gold/horner-syn.golden (100%) rename {examples => plugin}/test/gold/log-2xx-dot.golden (100%) rename {examples => plugin}/test/gold/log-2xx-syn.golden (100%) rename {examples => plugin}/test/gold/magSqr-adf-dot.golden (100%) rename {examples => plugin}/test/gold/magSqr-adf-syn.golden (100%) rename {examples => plugin}/test/gold/magSqr-adr-dot.golden (100%) rename {examples => plugin}/test/gold/magSqr-adr-syn.golden (100%) rename {examples => plugin}/test/gold/magSqr-dot.golden (100%) rename {examples => plugin}/test/gold/magSqr-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/magSqr-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/magSqr-syn.golden (100%) rename {examples => plugin}/test/gold/sin-adf-dot.golden (100%) rename {examples => plugin}/test/gold/sin-adf-syn.golden (100%) rename {examples => plugin}/test/gold/sin-adr-dot.golden (100%) rename {examples => plugin}/test/gold/sin-adr-syn.golden (100%) rename {examples => plugin}/test/gold/sin-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/sin-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/sqr-adf-dot.golden (100%) rename {examples => plugin}/test/gold/sqr-adf-syn.golden (100%) rename {examples => plugin}/test/gold/sqr-adr-dot.golden (100%) rename {examples => plugin}/test/gold/sqr-adr-syn.golden (100%) rename {examples => plugin}/test/gold/sqr-dot.golden (100%) rename {examples => plugin}/test/gold/sqr-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/sqr-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/sqr-syn.golden (100%) rename {examples => plugin}/test/gold/twice-adf-dot.golden (100%) rename {examples => plugin}/test/gold/twice-adf-syn.golden (100%) rename {examples => plugin}/test/gold/twice-adr-dot.golden (100%) rename {examples => plugin}/test/gold/twice-adr-syn.golden (100%) rename {examples => plugin}/test/gold/twice-dot.golden (100%) rename {examples => plugin}/test/gold/twice-gradr-dot.golden (100%) rename {examples => plugin}/test/gold/twice-gradr-syn.golden (100%) rename {examples => plugin}/test/gold/twice-syn.golden (100%) rename {examples => plugin}/test/gold/xp3y-dot.golden (100%) rename {examples => plugin}/test/gold/xp3y-syn.golden (100%) diff --git a/examples/concat-examples.cabal b/examples/concat-examples.cabal index 60f6147b..a063bc13 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/plugin/concat-plugin.cabal b/plugin/concat-plugin.cabal index baffe004..3665a57a 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,121 @@ 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 +-- + +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 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/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 100% rename from examples/test/Utils.hs rename to plugin/test/Utils.hs 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/examples/test/gold/add-adf-dot.golden b/plugin/test/gold/add-adf-dot.golden similarity index 100% rename from examples/test/gold/add-adf-dot.golden rename to plugin/test/gold/add-adf-dot.golden diff --git a/examples/test/gold/add-adf-syn.golden b/plugin/test/gold/add-adf-syn.golden similarity index 100% rename from examples/test/gold/add-adf-syn.golden rename to plugin/test/gold/add-adf-syn.golden diff --git a/examples/test/gold/add-adr-dot.golden b/plugin/test/gold/add-adr-dot.golden similarity index 100% rename from examples/test/gold/add-adr-dot.golden rename to plugin/test/gold/add-adr-dot.golden diff --git a/examples/test/gold/add-adr-syn.golden b/plugin/test/gold/add-adr-syn.golden similarity index 100% rename from examples/test/gold/add-adr-syn.golden rename to plugin/test/gold/add-adr-syn.golden diff --git a/examples/test/gold/add-dot.golden b/plugin/test/gold/add-dot.golden similarity index 100% rename from examples/test/gold/add-dot.golden rename to plugin/test/gold/add-dot.golden diff --git a/examples/test/gold/add-gradr-dot.golden b/plugin/test/gold/add-gradr-dot.golden similarity index 100% rename from examples/test/gold/add-gradr-dot.golden rename to plugin/test/gold/add-gradr-dot.golden diff --git a/examples/test/gold/add-gradr-syn.golden b/plugin/test/gold/add-gradr-syn.golden similarity index 100% rename from examples/test/gold/add-gradr-syn.golden rename to plugin/test/gold/add-gradr-syn.golden diff --git a/examples/test/gold/add-syn.golden b/plugin/test/gold/add-syn.golden similarity index 100% rename from examples/test/gold/add-syn.golden rename to plugin/test/gold/add-syn.golden diff --git a/examples/test/gold/add-uncurry-dot.golden b/plugin/test/gold/add-uncurry-dot.golden similarity index 100% rename from examples/test/gold/add-uncurry-dot.golden rename to plugin/test/gold/add-uncurry-dot.golden diff --git a/examples/test/gold/add-uncurry-syn.golden b/plugin/test/gold/add-uncurry-syn.golden similarity index 100% rename from examples/test/gold/add-uncurry-syn.golden rename to plugin/test/gold/add-uncurry-syn.golden diff --git a/examples/test/gold/complex-mul-a-dot.golden b/plugin/test/gold/complex-mul-a-dot.golden similarity index 100% rename from examples/test/gold/complex-mul-a-dot.golden rename to plugin/test/gold/complex-mul-a-dot.golden diff --git a/examples/test/gold/complex-mul-a-syn.golden b/plugin/test/gold/complex-mul-a-syn.golden similarity index 100% rename from examples/test/gold/complex-mul-a-syn.golden rename to plugin/test/gold/complex-mul-a-syn.golden diff --git a/examples/test/gold/complex-mul-dot.golden b/plugin/test/gold/complex-mul-dot.golden similarity index 100% rename from examples/test/gold/complex-mul-dot.golden rename to plugin/test/gold/complex-mul-dot.golden diff --git a/examples/test/gold/complex-mul-syn.golden b/plugin/test/gold/complex-mul-syn.golden similarity index 100% rename from examples/test/gold/complex-mul-syn.golden rename to plugin/test/gold/complex-mul-syn.golden diff --git a/examples/test/gold/cos-2x-adf-dot.golden b/plugin/test/gold/cos-2x-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adf-dot.golden rename to plugin/test/gold/cos-2x-adf-dot.golden diff --git a/examples/test/gold/cos-2x-adf-syn.golden b/plugin/test/gold/cos-2x-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-adf-syn.golden rename to plugin/test/gold/cos-2x-adf-syn.golden diff --git a/examples/test/gold/cos-2x-adr-dot.golden b/plugin/test/gold/cos-2x-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adr-dot.golden rename to plugin/test/gold/cos-2x-adr-dot.golden diff --git a/examples/test/gold/cos-2x-adr-syn.golden b/plugin/test/gold/cos-2x-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-adr-syn.golden rename to plugin/test/gold/cos-2x-adr-syn.golden diff --git a/examples/test/gold/cos-2x-gradr-dot.golden b/plugin/test/gold/cos-2x-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-gradr-dot.golden rename to plugin/test/gold/cos-2x-gradr-dot.golden diff --git a/examples/test/gold/cos-2x-gradr-syn.golden b/plugin/test/gold/cos-2x-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-gradr-syn.golden rename to plugin/test/gold/cos-2x-gradr-syn.golden diff --git a/examples/test/gold/cos-2xx-adf-dot.golden b/plugin/test/gold/cos-2xx-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adf-dot.golden rename to plugin/test/gold/cos-2xx-adf-dot.golden diff --git a/examples/test/gold/cos-2xx-adf-syn.golden b/plugin/test/gold/cos-2xx-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-adf-syn.golden rename to plugin/test/gold/cos-2xx-adf-syn.golden diff --git a/examples/test/gold/cos-2xx-adr-dot.golden b/plugin/test/gold/cos-2xx-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adr-dot.golden rename to plugin/test/gold/cos-2xx-adr-dot.golden diff --git a/examples/test/gold/cos-2xx-adr-syn.golden b/plugin/test/gold/cos-2xx-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-adr-syn.golden rename to plugin/test/gold/cos-2xx-adr-syn.golden diff --git a/examples/test/gold/cos-2xx-dot.golden b/plugin/test/gold/cos-2xx-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-dot.golden rename to plugin/test/gold/cos-2xx-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-dot.golden b/plugin/test/gold/cos-2xx-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-gradr-dot.golden rename to plugin/test/gold/cos-2xx-gradr-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-syn.golden b/plugin/test/gold/cos-2xx-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-gradr-syn.golden rename to plugin/test/gold/cos-2xx-gradr-syn.golden diff --git a/examples/test/gold/cos-2xx-syn.golden b/plugin/test/gold/cos-2xx-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-syn.golden rename to plugin/test/gold/cos-2xx-syn.golden diff --git a/examples/test/gold/cos-adf-dot.golden b/plugin/test/gold/cos-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-adf-dot.golden rename to plugin/test/gold/cos-adf-dot.golden diff --git a/examples/test/gold/cos-adf-syn.golden b/plugin/test/gold/cos-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-adf-syn.golden rename to plugin/test/gold/cos-adf-syn.golden diff --git a/examples/test/gold/cos-adr-dot.golden b/plugin/test/gold/cos-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-adr-dot.golden rename to plugin/test/gold/cos-adr-dot.golden diff --git a/examples/test/gold/cos-adr-syn.golden b/plugin/test/gold/cos-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-adr-syn.golden rename to plugin/test/gold/cos-adr-syn.golden diff --git a/examples/test/gold/cos-gradr-dot.golden b/plugin/test/gold/cos-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-gradr-dot.golden rename to plugin/test/gold/cos-gradr-dot.golden diff --git a/examples/test/gold/cos-gradr-syn.golden b/plugin/test/gold/cos-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-gradr-syn.golden rename to plugin/test/gold/cos-gradr-syn.golden diff --git a/examples/test/gold/cos-xpy-adf-dot.golden b/plugin/test/gold/cos-xpy-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adf-dot.golden rename to plugin/test/gold/cos-xpy-adf-dot.golden diff --git a/examples/test/gold/cos-xpy-adf-syn.golden b/plugin/test/gold/cos-xpy-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-adf-syn.golden rename to plugin/test/gold/cos-xpy-adf-syn.golden diff --git a/examples/test/gold/cos-xpy-adr-dot.golden b/plugin/test/gold/cos-xpy-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adr-dot.golden rename to plugin/test/gold/cos-xpy-adr-dot.golden diff --git a/examples/test/gold/cos-xpy-adr-syn.golden b/plugin/test/gold/cos-xpy-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-adr-syn.golden rename to plugin/test/gold/cos-xpy-adr-syn.golden diff --git a/examples/test/gold/cos-xpy-gradr-dot.golden b/plugin/test/gold/cos-xpy-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-gradr-dot.golden rename to plugin/test/gold/cos-xpy-gradr-dot.golden diff --git a/examples/test/gold/cos-xpy-gradr-syn.golden b/plugin/test/gold/cos-xpy-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-gradr-syn.golden rename to plugin/test/gold/cos-xpy-gradr-syn.golden diff --git a/examples/test/gold/cosSinProd-adr-dot.golden b/plugin/test/gold/cosSinProd-adr-dot.golden similarity index 100% rename from examples/test/gold/cosSinProd-adr-dot.golden rename to plugin/test/gold/cosSinProd-adr-dot.golden diff --git a/examples/test/gold/cosSinProd-adr-syn.golden b/plugin/test/gold/cosSinProd-adr-syn.golden similarity index 100% rename from examples/test/gold/cosSinProd-adr-syn.golden rename to plugin/test/gold/cosSinProd-adr-syn.golden diff --git a/examples/test/gold/cosSinProd-dot.golden b/plugin/test/gold/cosSinProd-dot.golden similarity index 100% rename from examples/test/gold/cosSinProd-dot.golden rename to plugin/test/gold/cosSinProd-dot.golden diff --git a/examples/test/gold/cosSinProd-syn.golden b/plugin/test/gold/cosSinProd-syn.golden similarity index 100% rename from examples/test/gold/cosSinProd-syn.golden rename to plugin/test/gold/cosSinProd-syn.golden diff --git a/examples/test/gold/dup-dot.golden b/plugin/test/gold/dup-dot.golden similarity index 100% rename from examples/test/gold/dup-dot.golden rename to plugin/test/gold/dup-dot.golden diff --git a/examples/test/gold/dup-syn.golden b/plugin/test/gold/dup-syn.golden similarity index 100% rename from examples/test/gold/dup-syn.golden rename to plugin/test/gold/dup-syn.golden diff --git a/examples/test/gold/fst-dot.golden b/plugin/test/gold/fst-dot.golden similarity index 100% rename from examples/test/gold/fst-dot.golden rename to plugin/test/gold/fst-dot.golden diff --git a/examples/test/gold/fst-syn.golden b/plugin/test/gold/fst-syn.golden similarity index 100% rename from examples/test/gold/fst-syn.golden rename to plugin/test/gold/fst-syn.golden diff --git a/examples/test/gold/horner-dot.golden b/plugin/test/gold/horner-dot.golden similarity index 100% rename from examples/test/gold/horner-dot.golden rename to plugin/test/gold/horner-dot.golden diff --git a/examples/test/gold/horner-syn.golden b/plugin/test/gold/horner-syn.golden similarity index 100% rename from examples/test/gold/horner-syn.golden rename to plugin/test/gold/horner-syn.golden diff --git a/examples/test/gold/log-2xx-dot.golden b/plugin/test/gold/log-2xx-dot.golden similarity index 100% rename from examples/test/gold/log-2xx-dot.golden rename to plugin/test/gold/log-2xx-dot.golden diff --git a/examples/test/gold/log-2xx-syn.golden b/plugin/test/gold/log-2xx-syn.golden similarity index 100% rename from examples/test/gold/log-2xx-syn.golden rename to plugin/test/gold/log-2xx-syn.golden diff --git a/examples/test/gold/magSqr-adf-dot.golden b/plugin/test/gold/magSqr-adf-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adf-dot.golden rename to plugin/test/gold/magSqr-adf-dot.golden diff --git a/examples/test/gold/magSqr-adf-syn.golden b/plugin/test/gold/magSqr-adf-syn.golden similarity index 100% rename from examples/test/gold/magSqr-adf-syn.golden rename to plugin/test/gold/magSqr-adf-syn.golden diff --git a/examples/test/gold/magSqr-adr-dot.golden b/plugin/test/gold/magSqr-adr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adr-dot.golden rename to plugin/test/gold/magSqr-adr-dot.golden diff --git a/examples/test/gold/magSqr-adr-syn.golden b/plugin/test/gold/magSqr-adr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-adr-syn.golden rename to plugin/test/gold/magSqr-adr-syn.golden diff --git a/examples/test/gold/magSqr-dot.golden b/plugin/test/gold/magSqr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-dot.golden rename to plugin/test/gold/magSqr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-dot.golden b/plugin/test/gold/magSqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-gradr-dot.golden rename to plugin/test/gold/magSqr-gradr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-syn.golden b/plugin/test/gold/magSqr-gradr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-gradr-syn.golden rename to plugin/test/gold/magSqr-gradr-syn.golden diff --git a/examples/test/gold/magSqr-syn.golden b/plugin/test/gold/magSqr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-syn.golden rename to plugin/test/gold/magSqr-syn.golden diff --git a/examples/test/gold/sin-adf-dot.golden b/plugin/test/gold/sin-adf-dot.golden similarity index 100% rename from examples/test/gold/sin-adf-dot.golden rename to plugin/test/gold/sin-adf-dot.golden diff --git a/examples/test/gold/sin-adf-syn.golden b/plugin/test/gold/sin-adf-syn.golden similarity index 100% rename from examples/test/gold/sin-adf-syn.golden rename to plugin/test/gold/sin-adf-syn.golden diff --git a/examples/test/gold/sin-adr-dot.golden b/plugin/test/gold/sin-adr-dot.golden similarity index 100% rename from examples/test/gold/sin-adr-dot.golden rename to plugin/test/gold/sin-adr-dot.golden diff --git a/examples/test/gold/sin-adr-syn.golden b/plugin/test/gold/sin-adr-syn.golden similarity index 100% rename from examples/test/gold/sin-adr-syn.golden rename to plugin/test/gold/sin-adr-syn.golden diff --git a/examples/test/gold/sin-gradr-dot.golden b/plugin/test/gold/sin-gradr-dot.golden similarity index 100% rename from examples/test/gold/sin-gradr-dot.golden rename to plugin/test/gold/sin-gradr-dot.golden diff --git a/examples/test/gold/sin-gradr-syn.golden b/plugin/test/gold/sin-gradr-syn.golden similarity index 100% rename from examples/test/gold/sin-gradr-syn.golden rename to plugin/test/gold/sin-gradr-syn.golden diff --git a/examples/test/gold/sqr-adf-dot.golden b/plugin/test/gold/sqr-adf-dot.golden similarity index 100% rename from examples/test/gold/sqr-adf-dot.golden rename to plugin/test/gold/sqr-adf-dot.golden diff --git a/examples/test/gold/sqr-adf-syn.golden b/plugin/test/gold/sqr-adf-syn.golden similarity index 100% rename from examples/test/gold/sqr-adf-syn.golden rename to plugin/test/gold/sqr-adf-syn.golden diff --git a/examples/test/gold/sqr-adr-dot.golden b/plugin/test/gold/sqr-adr-dot.golden similarity index 100% rename from examples/test/gold/sqr-adr-dot.golden rename to plugin/test/gold/sqr-adr-dot.golden diff --git a/examples/test/gold/sqr-adr-syn.golden b/plugin/test/gold/sqr-adr-syn.golden similarity index 100% rename from examples/test/gold/sqr-adr-syn.golden rename to plugin/test/gold/sqr-adr-syn.golden diff --git a/examples/test/gold/sqr-dot.golden b/plugin/test/gold/sqr-dot.golden similarity index 100% rename from examples/test/gold/sqr-dot.golden rename to plugin/test/gold/sqr-dot.golden diff --git a/examples/test/gold/sqr-gradr-dot.golden b/plugin/test/gold/sqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/sqr-gradr-dot.golden rename to plugin/test/gold/sqr-gradr-dot.golden diff --git a/examples/test/gold/sqr-gradr-syn.golden b/plugin/test/gold/sqr-gradr-syn.golden similarity index 100% rename from examples/test/gold/sqr-gradr-syn.golden rename to plugin/test/gold/sqr-gradr-syn.golden diff --git a/examples/test/gold/sqr-syn.golden b/plugin/test/gold/sqr-syn.golden similarity index 100% rename from examples/test/gold/sqr-syn.golden rename to plugin/test/gold/sqr-syn.golden diff --git a/examples/test/gold/twice-adf-dot.golden b/plugin/test/gold/twice-adf-dot.golden similarity index 100% rename from examples/test/gold/twice-adf-dot.golden rename to plugin/test/gold/twice-adf-dot.golden diff --git a/examples/test/gold/twice-adf-syn.golden b/plugin/test/gold/twice-adf-syn.golden similarity index 100% rename from examples/test/gold/twice-adf-syn.golden rename to plugin/test/gold/twice-adf-syn.golden diff --git a/examples/test/gold/twice-adr-dot.golden b/plugin/test/gold/twice-adr-dot.golden similarity index 100% rename from examples/test/gold/twice-adr-dot.golden rename to plugin/test/gold/twice-adr-dot.golden diff --git a/examples/test/gold/twice-adr-syn.golden b/plugin/test/gold/twice-adr-syn.golden similarity index 100% rename from examples/test/gold/twice-adr-syn.golden rename to plugin/test/gold/twice-adr-syn.golden diff --git a/examples/test/gold/twice-dot.golden b/plugin/test/gold/twice-dot.golden similarity index 100% rename from examples/test/gold/twice-dot.golden rename to plugin/test/gold/twice-dot.golden diff --git a/examples/test/gold/twice-gradr-dot.golden b/plugin/test/gold/twice-gradr-dot.golden similarity index 100% rename from examples/test/gold/twice-gradr-dot.golden rename to plugin/test/gold/twice-gradr-dot.golden diff --git a/examples/test/gold/twice-gradr-syn.golden b/plugin/test/gold/twice-gradr-syn.golden similarity index 100% rename from examples/test/gold/twice-gradr-syn.golden rename to plugin/test/gold/twice-gradr-syn.golden diff --git a/examples/test/gold/twice-syn.golden b/plugin/test/gold/twice-syn.golden similarity index 100% rename from examples/test/gold/twice-syn.golden rename to plugin/test/gold/twice-syn.golden diff --git a/examples/test/gold/xp3y-dot.golden b/plugin/test/gold/xp3y-dot.golden similarity index 100% rename from examples/test/gold/xp3y-dot.golden rename to plugin/test/gold/xp3y-dot.golden diff --git a/examples/test/gold/xp3y-syn.golden b/plugin/test/gold/xp3y-syn.golden similarity index 100% rename from examples/test/gold/xp3y-syn.golden rename to plugin/test/gold/xp3y-syn.golden From 06ca984be3dede5b4c65238717ed97c048784c29 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Wed, 6 Apr 2022 15:34:51 +0200 Subject: [PATCH 06/28] checkpoint coercion analysis Experiments with encountering FunCo Minor cleanup Introduce polarity parameter Stash passing coercion arguments Undo [Coercion] passing Implement AppCo properly Improve comment use liftCoSubstWith (didn't seem too hard) Less warnings --- plugin/src/ConCat/Plugin.hs | 145 +++++++++++++++++++++++++++++++++--- 1 file changed, 135 insertions(+), 10 deletions(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 94d979ac..4a4a06db 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -49,7 +49,7 @@ 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) @@ -63,6 +63,7 @@ import CoreOpt (simpleOptExpr) #endif import TyCoRep import GHC.Classes +import CoAxiom import Unique (mkBuiltinUnique) -- For normaliseType etc import FamInstEnv @@ -279,11 +280,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 <- 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? @@ -683,6 +688,124 @@ 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) + , (t1 `mkAppTys` ts) `eqType` t1' + , (t2 `mkAppTys` ts) `eqType` t2' + = exp + | Just (t1',t2') <- tyArgs2_maybe (exprType exp) + = pprPanic "goCoercion mismatch:" $ + ppr pol $$ ppr co $$ ppr (coercionKind co) $$ ppr ts $$ ppr (Pair t1' t2') $$ ppr exp + | otherwise + = pprPanic "goCoercion not returning categorial arrow:" $ + ppr pol $$ ppr co $$ ppr (coercionKind co) $$ ppr ts $$ pprWithType exp + + where exp = 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 cos) ts | all isReflCo cos + -- = 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 cos) ts + = goCoercion pol (mkTransCo co1 co2) ts + where + co1 = AxiomInstCo ax 0 cos' + 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) cos (coAxBranchRHS ax_branch) + cos' = [ mkReflCo (coercionRole arg_co) (pFst (coercionKind arg_co)) | arg_co <- cos ] + + 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", then we can use the Functor instance for "(->) t" + | Just (ty1, _role) <- isReflCo_maybe co1 + = let h = mkTyConApp funTyCon [liftedRepTy, liftedRepTy, ty1] + in onDict (onDict (Var fmapV `mkTyApps` [cat, h, ty21, ty22])) `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])) @@ -940,10 +1063,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 +1080,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 = From 73aa32183f4e99dc7ffdba02122e895f38bc8aaa Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Thu, 7 Apr 2022 16:16:11 +0200 Subject: [PATCH 07/28] Less warnings --- plugin/src/ConCat/Plugin.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 4a4a06db..33318715 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -704,18 +704,18 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- 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) + | Just (t1',t2') <- tyArgs2_maybe (exprType exp_out) , (t1 `mkAppTys` ts) `eqType` t1' , (t2 `mkAppTys` ts) `eqType` t2' - = exp - | Just (t1',t2') <- tyArgs2_maybe (exprType exp) + = 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 + 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 + ppr pol $$ ppr co $$ ppr (coercionKind co) $$ ppr ts $$ pprWithType exp_out - where exp = goCoercion' pol co ts + where exp_out = goCoercion' pol co ts Pair t1 t2 = (if pol then id else swap) $ coercionKind co -- Reflexivity @@ -758,7 +758,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- 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 cos) ts | all isReflCo cos + 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] @@ -781,15 +781,15 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- This will probably loop for recursive newtypes (newtype Stream = MkS (Double, Stream)) -- -- TODO: think this through for pol = False - goCoercion' pol (AxiomInstCo ax 0 cos) ts + goCoercion' pol (AxiomInstCo ax 0 cos1) ts = goCoercion pol (mkTransCo co1 co2) ts where - co1 = AxiomInstCo ax 0 cos' + 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) cos (coAxBranchRHS ax_branch) - cos' = [ mkReflCo (coercionRole arg_co) (pFst (coercionKind arg_co)) | arg_co <- cos ] + 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) From eff8a10d809f266cc377b7624401d36aefed42e8 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Thu, 7 Apr 2022 16:44:19 +0200 Subject: [PATCH 08/28] If no FuncorCat instance is found, use coerce --- plugin/src/ConCat/Plugin.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 33318715..32a48ef7 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -795,10 +795,12 @@ ccc (CccEnv {..}) (Ops {..}) cat = | not (null ts) = pprPanic "goCoercion': oddly kinded FunCo" (ppr co $$ ppr ts) - -- If we have "_R -> co2", then we can use the Functor instance for "(->) t" + -- If we have "_R -> co2", and a suitable FuncorCat instance exists, + -- we can use fmapC | Just (ty1, _role) <- isReflCo_maybe co1 - = let h = mkTyConApp funTyCon [liftedRepTy, liftedRepTy, ty1] - in onDict (onDict (Var fmapV `mkTyApps` [cat, h, ty21, ty22])) `App` goCoercion pol co2 [] + , let h = mkTyConApp funTyCon [liftedRepTy, liftedRepTy, ty1] + , 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 From 8210dc3f90c70af59d321a225eb451a063607bb0 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Sun, 18 Sep 2022 13:32:09 +0200 Subject: [PATCH 09/28] Unbreak gold tests. Following the change from Coercible to RepCat in many cases. --- plugin/test/gold/add-adf-syn.golden | 2 +- plugin/test/gold/add-adr-syn.golden | 4 +- plugin/test/gold/add-gradr-syn.golden | 4 +- plugin/test/gold/cos-2x-adf-syn.golden | 34 +++---- plugin/test/gold/cos-2x-adr-syn.golden | 58 +++++------ plugin/test/gold/cos-2x-gradr-syn.golden | 58 +++++------ plugin/test/gold/cos-2xx-adf-syn.golden | 58 +++++------ plugin/test/gold/cos-2xx-adr-syn.golden | 99 +++++++++--------- plugin/test/gold/cos-2xx-gradr-syn.golden | 99 +++++++++--------- plugin/test/gold/cos-adf-syn.golden | 4 +- plugin/test/gold/cos-adr-syn.golden | 7 +- plugin/test/gold/cos-gradr-syn.golden | 7 +- plugin/test/gold/cos-xpy-adf-syn.golden | 10 +- plugin/test/gold/cos-xpy-adr-syn.golden | 15 +-- plugin/test/gold/cos-xpy-gradr-syn.golden | 15 +-- plugin/test/gold/magSqr-adf-syn.golden | 66 ++++++------ plugin/test/gold/magSqr-adr-syn.golden | 119 +++++++++++----------- plugin/test/gold/magSqr-gradr-syn.golden | 119 +++++++++++----------- plugin/test/gold/sin-adf-syn.golden | 5 +- plugin/test/gold/sin-adr-syn.golden | 6 +- plugin/test/gold/sin-gradr-syn.golden | 6 +- plugin/test/gold/sqr-adf-syn.golden | 16 +-- plugin/test/gold/sqr-adr-syn.golden | 30 +++--- plugin/test/gold/sqr-gradr-syn.golden | 30 +++--- plugin/test/gold/twice-adf-syn.golden | 2 +- plugin/test/gold/twice-adr-syn.golden | 14 +-- plugin/test/gold/twice-gradr-syn.golden | 14 +-- 27 files changed, 450 insertions(+), 451 deletions(-) diff --git a/plugin/test/gold/add-adf-syn.golden b/plugin/test/gold/add-adf-syn.golden index 9caeaff7..d446add7 100644 --- a/plugin/test/gold/add-adf-syn.golden +++ b/plugin/test/gold/add-adf-syn.golden @@ -1 +1 @@ -(addC *** coerce . coerce . curry (addC . exr)) . dup \ No newline at end of file +(addC *** id . repr . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/add-adr-syn.golden b/plugin/test/gold/add-adr-syn.golden index 2fa401b5..5c74c0f3 100644 --- a/plugin/test/gold/add-adr-syn.golden +++ b/plugin/test/gold/add-adr-syn.golden @@ -1,2 +1,2 @@ -((exl . id *** coerce . exr . id) . dup) . -(addC *** coerce . coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file +((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/add-gradr-syn.golden b/plugin/test/gold/add-gradr-syn.golden index d80989f5..0c5076e9 100644 --- a/plugin/test/gold/add-gradr-syn.golden +++ b/plugin/test/gold/add-gradr-syn.golden @@ -1,4 +1,4 @@ ((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) . -(addC *** coerce . coerce . coerce . curry (dup . exr)) . dup \ No newline at end of file +(addC *** id . repr . abst . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/cos-2x-adf-syn.golden b/plugin/test/gold/cos-2x-adf-syn.golden index 1902eba7..e577cfd3 100644 --- a/plugin/test/gold/cos-2x-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-2x-adr-syn.golden b/plugin/test/gold/cos-2x-adr-syn.golden index 4ca4af32..f6691e42 100644 --- a/plugin/test/gold/cos-2x-adr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-2x-gradr-syn.golden b/plugin/test/gold/cos-2x-gradr-syn.golden index d80ee565..b96057f3 100644 --- a/plugin/test/gold/cos-2x-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-2xx-adf-syn.golden b/plugin/test/gold/cos-2xx-adf-syn.golden index 708e4528..69fbd5a2 100644 --- a/plugin/test/gold/cos-2xx-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-2xx-adr-syn.golden b/plugin/test/gold/cos-2xx-adr-syn.golden index 23023e1d..9bfa5d2a 100644 --- a/plugin/test/gold/cos-2xx-adr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-2xx-gradr-syn.golden b/plugin/test/gold/cos-2xx-gradr-syn.golden index 55823e4d..6f8fccac 100644 --- a/plugin/test/gold/cos-2xx-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-adf-syn.golden b/plugin/test/gold/cos-adf-syn.golden index e875a912..1adb5632 100644 --- a/plugin/test/gold/cos-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-adr-syn.golden b/plugin/test/gold/cos-adr-syn.golden index 1b315fbb..1d1eac29 100644 --- a/plugin/test/gold/cos-adr-syn.golden +++ b/plugin/test/gold/cos-adr-syn.golden @@ -1,9 +1,10 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . (curry ((exr *** - coerce . + abst . + abst . curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . dup) *** cosC) . diff --git a/plugin/test/gold/cos-gradr-syn.golden b/plugin/test/gold/cos-gradr-syn.golden index 3e404ca3..09230108 100644 --- a/plugin/test/gold/cos-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-xpy-adf-syn.golden b/plugin/test/gold/cos-xpy-adf-syn.golden index 01ec3990..aae5d2cb 100644 --- a/plugin/test/gold/cos-xpy-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-xpy-adr-syn.golden b/plugin/test/gold/cos-xpy-adr-syn.golden index 6c16c135..14d7164a 100644 --- a/plugin/test/gold/cos-xpy-adr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/cos-xpy-gradr-syn.golden b/plugin/test/gold/cos-xpy-gradr-syn.golden index 29c4c537..2d5985c7 100644 --- a/plugin/test/gold/cos-xpy-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/magSqr-adf-syn.golden b/plugin/test/gold/magSqr-adf-syn.golden index b81df807..b40ce23d 100644 --- a/plugin/test/gold/magSqr-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/magSqr-adr-syn.golden b/plugin/test/gold/magSqr-adr-syn.golden index 3bb04dd2..dcd75cf3 100644 --- a/plugin/test/gold/magSqr-adr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/magSqr-gradr-syn.golden b/plugin/test/gold/magSqr-gradr-syn.golden index dfb62d10..1568a72c 100644 --- a/plugin/test/gold/magSqr-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/sin-adf-syn.golden b/plugin/test/gold/sin-adf-syn.golden index a44bc287..c8441093 100644 --- a/plugin/test/gold/sin-adf-syn.golden +++ b/plugin/test/gold/sin-adf-syn.golden @@ -1,8 +1,7 @@ -second coerce . +second (id . repr) . apply . (curry - ((exr *** - coerce . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + ((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/sin-adr-syn.golden b/plugin/test/gold/sin-adr-syn.golden index 3f3b4733..23b07c29 100644 --- a/plugin/test/gold/sin-adr-syn.golden +++ b/plugin/test/gold/sin-adr-syn.golden @@ -1,9 +1,9 @@ -((exl . id *** coerce . exr . id) . dup) . -second coerce . +((exl . id *** repr . exr . id) . dup) . +second (id . repr) . apply . (curry ((exr *** - coerce . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + 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/sin-gradr-syn.golden b/plugin/test/gold/sin-gradr-syn.golden index 98bc1f00..16dcf219 100644 --- a/plugin/test/gold/sin-gradr-syn.golden +++ b/plugin/test/gold/sin-gradr-syn.golden @@ -1,11 +1,11 @@ ((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 . curry mulC . apply . (curry exl . cosC . exl *** exr) . dup) . + 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/sqr-adf-syn.golden b/plugin/test/gold/sqr-adf-syn.golden index 78111781..e827d0b5 100644 --- a/plugin/test/gold/sqr-adf-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/sqr-adr-syn.golden b/plugin/test/gold/sqr-adr-syn.golden index a15d8d32..f052bad5 100644 --- a/plugin/test/gold/sqr-adr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/sqr-gradr-syn.golden b/plugin/test/gold/sqr-gradr-syn.golden index 81197dd5..6ada6a56 100644 --- a/plugin/test/gold/sqr-gradr-syn.golden +++ b/plugin/test/gold/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/plugin/test/gold/twice-adf-syn.golden b/plugin/test/gold/twice-adf-syn.golden index 79a321f1..8e8d72ec 100644 --- a/plugin/test/gold/twice-adf-syn.golden +++ b/plugin/test/gold/twice-adf-syn.golden @@ -1,3 +1,3 @@ (addC . dup *** - coerce . coerce . curry (addC . apply) . coerce . coerce . curry (dup . exr)) . + id . repr . abst . curry (addC . apply) . repr . abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/twice-adr-syn.golden b/plugin/test/gold/twice-adr-syn.golden index adbeb577..52e2873c 100644 --- a/plugin/test/gold/twice-adr-syn.golden +++ b/plugin/test/gold/twice-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,17 +8,17 @@ 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) . -(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/plugin/test/gold/twice-gradr-syn.golden b/plugin/test/gold/twice-gradr-syn.golden index dbc86ad3..feaa5c50 100644 --- a/plugin/test/gold/twice-gradr-syn.golden +++ b/plugin/test/gold/twice-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,17 +10,17 @@ 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) . -(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 From 4184beb2ad9269997ed2a4b752b22f50de369d4f Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 10:41:12 +0100 Subject: [PATCH 10/28] Add support for ghc 9.0.2, 9.2.4. Co-authored-by: Greg Pfeil Explicit support for ghc 8.10.7, ghc 9.0.2, ghc 9.2.4. Some support for older versions has been explicitly removed. Mostly updates to the new ghc API, with provisions for Linear Haskell. Also, new hack to prevent ghc from inlining toCcc''. The golden tests give slightly different results depending on the ghc version (coercions seem to move around), so their output files are now in different directories according to that version. --- .github/workflows/ci.yml | 9 +- classes/concat-classes.cabal | 1 + classes/src/ConCat/AltCat.hs | 2 - classes/src/ConCat/Category.hs | 7 +- classes/src/ConCat/Experimental/A.hs | 2 +- classes/src/ConCat/Misc.hs | 11 +- classes/src/ConCat/Oops.hs | 11 + examples/src/ConCat/ADFun.hs | 2 +- examples/src/ConCat/Choice.hs | 2 +- examples/src/ConCat/Circuit.hs | 2 - examples/src/ConCat/Dual.hs | 3 +- examples/src/ConCat/Nat.hs | 2 - examples/src/ConCat/StackVM.hs | 8 +- examples/src/ConCat/TArr.hs | 5 +- inline/src/ConCat/Inline/Plugin.hs | 27 +- nix/nixpkgs-pin.json | 9 +- plugin/src/ConCat/Plugin.hs | 282 ++++++++++-------- plugin/src/ConCat/Rebox.hs | 4 - plugin/test/Utils.hs | 5 +- plugin/test/gold/810/maximum-derf.golden | 1 + plugin/test/gold/810/maximum-derr.golden | 1 + plugin/test/gold/810/maximum-gradr.golden | 1 + plugin/test/gold/{ => 900}/add-adf-dot.golden | 0 plugin/test/gold/{ => 900}/add-adf-syn.golden | 0 plugin/test/gold/{ => 900}/add-adr-dot.golden | 0 plugin/test/gold/{ => 900}/add-adr-syn.golden | 0 plugin/test/gold/{ => 900}/add-dot.golden | 0 .../test/gold/{ => 900}/add-gradr-dot.golden | 0 .../test/gold/{ => 900}/add-gradr-syn.golden | 0 plugin/test/gold/{ => 900}/add-syn.golden | 0 .../gold/{ => 900}/add-uncurry-dot.golden | 0 .../gold/{ => 900}/add-uncurry-syn.golden | 0 .../gold/{ => 900}/complex-mul-dot.golden | 0 .../gold/{ => 900}/complex-mul-syn.golden | 0 .../test/gold/{ => 900}/cos-2x-adf-dot.golden | 0 plugin/test/gold/900/cos-2x-adf-syn.golden | 87 ++++++ .../test/gold/{ => 900}/cos-2x-adr-dot.golden | 0 .../test/gold/{ => 900}/cos-2x-adr-syn.golden | 0 .../gold/{ => 900}/cos-2x-gradr-dot.golden | 0 .../gold/{ => 900}/cos-2x-gradr-syn.golden | 0 .../gold/{ => 900}/cos-2xx-adf-dot.golden | 0 plugin/test/gold/900/cos-2xx-adf-syn.golden | 152 ++++++++++ .../gold/{ => 900}/cos-2xx-adr-dot.golden | 0 .../gold/{ => 900}/cos-2xx-adr-syn.golden | 0 plugin/test/gold/{ => 900}/cos-2xx-dot.golden | 0 .../gold/{ => 900}/cos-2xx-gradr-dot.golden | 0 .../gold/{ => 900}/cos-2xx-gradr-syn.golden | 0 plugin/test/gold/{ => 900}/cos-2xx-syn.golden | 0 plugin/test/gold/{ => 900}/cos-adf-dot.golden | 0 plugin/test/gold/{ => 900}/cos-adf-syn.golden | 0 plugin/test/gold/{ => 900}/cos-adr-dot.golden | 0 plugin/test/gold/{ => 900}/cos-adr-syn.golden | 0 .../test/gold/{ => 900}/cos-gradr-dot.golden | 0 .../test/gold/{ => 900}/cos-gradr-syn.golden | 0 .../gold/{ => 900}/cos-xpy-adf-dot.golden | 30 +- plugin/test/gold/900/cos-xpy-adf-syn.golden | 24 ++ .../gold/{ => 900}/cos-xpy-adr-dot.golden | 0 .../gold/{ => 900}/cos-xpy-adr-syn.golden | 0 .../gold/{ => 900}/cos-xpy-gradr-dot.golden | 0 .../gold/{ => 900}/cos-xpy-gradr-syn.golden | 0 .../test/gold/{ => 900}/cosSinProd-dot.golden | 0 .../test/gold/{ => 900}/cosSinProd-syn.golden | 0 plugin/test/gold/{ => 900}/dup-dot.golden | 0 plugin/test/gold/{ => 900}/dup-syn.golden | 0 plugin/test/gold/{ => 900}/fst-dot.golden | 0 plugin/test/gold/{ => 900}/fst-syn.golden | 0 plugin/test/gold/{ => 900}/horner-dot.golden | 0 plugin/test/gold/{ => 900}/horner-syn.golden | 0 plugin/test/gold/{ => 900}/log-2xx-dot.golden | 0 plugin/test/gold/{ => 900}/log-2xx-syn.golden | 0 plugin/test/gold/900/magSqr-adf-dot.golden | 46 +++ plugin/test/gold/900/magSqr-adf-syn.golden | 176 +++++++++++ .../test/gold/{ => 900}/magSqr-adr-dot.golden | 0 .../test/gold/{ => 900}/magSqr-adr-syn.golden | 0 plugin/test/gold/{ => 900}/magSqr-dot.golden | 0 .../gold/{ => 900}/magSqr-gradr-dot.golden | 0 .../gold/{ => 900}/magSqr-gradr-syn.golden | 0 plugin/test/gold/{ => 900}/magSqr-syn.golden | 0 plugin/test/gold/900/maximum-derf.golden | 1 + plugin/test/gold/900/maximum-derr.golden | 1 + plugin/test/gold/900/maximum-gradr.golden | 1 + plugin/test/gold/{ => 900}/sin-adf-dot.golden | 0 plugin/test/gold/{ => 900}/sin-adf-syn.golden | 0 plugin/test/gold/{ => 900}/sin-adr-dot.golden | 0 plugin/test/gold/{ => 900}/sin-adr-syn.golden | 0 .../test/gold/{ => 900}/sin-gradr-dot.golden | 0 .../test/gold/{ => 900}/sin-gradr-syn.golden | 0 plugin/test/gold/900/sqr-adf-dot.golden | 31 ++ plugin/test/gold/900/sqr-adf-syn.golden | 34 +++ plugin/test/gold/{ => 900}/sqr-adr-dot.golden | 0 plugin/test/gold/{ => 900}/sqr-adr-syn.golden | 0 plugin/test/gold/{ => 900}/sqr-dot.golden | 0 .../test/gold/{ => 900}/sqr-gradr-dot.golden | 0 .../test/gold/{ => 900}/sqr-gradr-syn.golden | 0 plugin/test/gold/{ => 900}/sqr-syn.golden | 0 plugin/test/gold/900/twice-adf-dot.golden | 28 ++ .../twice-adf-syn.golden} | 12 +- .../test/gold/{ => 900}/twice-adr-dot.golden | 0 .../test/gold/{ => 900}/twice-adr-syn.golden | 0 plugin/test/gold/{ => 900}/twice-dot.golden | 0 .../gold/{ => 900}/twice-gradr-dot.golden | 0 .../gold/{ => 900}/twice-gradr-syn.golden | 0 plugin/test/gold/{ => 900}/twice-syn.golden | 0 plugin/test/gold/{ => 900}/xp3y-dot.golden | 0 plugin/test/gold/{ => 900}/xp3y-syn.golden | 0 plugin/test/gold/902/add-adf-dot.golden | 28 ++ plugin/test/gold/902/add-adf-syn.golden | 1 + plugin/test/gold/902/add-adr-dot.golden | 26 ++ plugin/test/gold/902/add-adr-syn.golden | 2 + plugin/test/gold/902/add-dot.golden | 24 ++ plugin/test/gold/902/add-gradr-dot.golden | 18 ++ plugin/test/gold/902/add-gradr-syn.golden | 4 + plugin/test/gold/902/add-syn.golden | 1 + plugin/test/gold/902/add-uncurry-dot.golden | 15 + plugin/test/gold/902/add-uncurry-syn.golden | 1 + plugin/test/gold/902/complex-mul-dot.golden | 31 ++ plugin/test/gold/902/complex-mul-syn.golden | 16 + plugin/test/gold/902/cos-2x-adf-dot.golden | 38 +++ .../test/gold/{ => 902}/cos-2x-adf-syn.golden | 17 +- plugin/test/gold/902/cos-2x-adr-dot.golden | 38 +++ plugin/test/gold/902/cos-2x-adr-syn.golden | 125 ++++++++ plugin/test/gold/902/cos-2x-gradr-dot.golden | 26 ++ plugin/test/gold/902/cos-2x-gradr-syn.golden | 127 ++++++++ plugin/test/gold/902/cos-2xx-adf-dot.golden | 50 ++++ .../gold/{ => 902}/cos-2xx-adf-syn.golden | 17 +- plugin/test/gold/902/cos-2xx-adr-dot.golden | 50 ++++ plugin/test/gold/902/cos-2xx-adr-syn.golden | 215 +++++++++++++ plugin/test/gold/902/cos-2xx-dot.golden | 21 ++ plugin/test/gold/902/cos-2xx-gradr-dot.golden | 38 +++ plugin/test/gold/902/cos-2xx-gradr-syn.golden | 217 ++++++++++++++ plugin/test/gold/902/cos-2xx-syn.golden | 1 + plugin/test/gold/902/cos-adf-dot.golden | 31 ++ plugin/test/gold/902/cos-adf-syn.golden | 9 + plugin/test/gold/902/cos-adr-dot.golden | 31 ++ plugin/test/gold/902/cos-adr-syn.golden | 11 + plugin/test/gold/902/cos-gradr-dot.golden | 19 ++ plugin/test/gold/902/cos-gradr-syn.golden | 13 + plugin/test/gold/902/cos-xpy-adf-dot.golden | 37 +++ plugin/test/gold/902/cos-xpy-adf-syn.golden | 24 ++ plugin/test/gold/902/cos-xpy-adr-dot.golden | 35 +++ plugin/test/gold/902/cos-xpy-adr-syn.golden | 33 ++ plugin/test/gold/902/cos-xpy-gradr-dot.golden | 23 ++ plugin/test/gold/902/cos-xpy-gradr-syn.golden | 35 +++ plugin/test/gold/902/cosSinProd-dot.golden | 20 ++ plugin/test/gold/902/cosSinProd-syn.golden | 1 + plugin/test/gold/902/dup-dot.golden | 13 + plugin/test/gold/902/dup-syn.golden | 1 + plugin/test/gold/902/fst-dot.golden | 12 + plugin/test/gold/902/fst-syn.golden | 1 + plugin/test/gold/902/horner-dot.golden | 27 ++ plugin/test/gold/902/horner-syn.golden | 12 + plugin/test/gold/902/log-2xx-dot.golden | 21 ++ plugin/test/gold/902/log-2xx-syn.golden | 1 + plugin/test/gold/902/magSqr-adf-dot.golden | 46 +++ .../test/gold/{ => 902}/magSqr-adf-syn.golden | 15 +- plugin/test/gold/902/magSqr-adr-dot.golden | 44 +++ plugin/test/gold/902/magSqr-adr-syn.golden | 264 ++++++++++++++++ plugin/test/gold/902/magSqr-dot.golden | 21 ++ plugin/test/gold/902/magSqr-gradr-dot.golden | 29 ++ plugin/test/gold/902/magSqr-gradr-syn.golden | 266 +++++++++++++++++ plugin/test/gold/902/magSqr-syn.golden | 1 + plugin/test/gold/902/maximum-derf.golden | 1 + plugin/test/gold/902/maximum-derr.golden | 1 + plugin/test/gold/902/maximum-gradr.golden | 1 + plugin/test/gold/902/sin-adf-dot.golden | 29 ++ plugin/test/gold/902/sin-adf-syn.golden | 7 + plugin/test/gold/902/sin-adr-dot.golden | 29 ++ plugin/test/gold/902/sin-adr-syn.golden | 9 + plugin/test/gold/902/sin-gradr-dot.golden | 17 ++ plugin/test/gold/902/sin-gradr-syn.golden | 11 + plugin/test/gold/902/sqr-adf-dot.golden | 31 ++ plugin/test/gold/902/sqr-adf-syn.golden | 34 +++ plugin/test/gold/902/sqr-adr-dot.golden | 31 ++ plugin/test/gold/902/sqr-adr-syn.golden | 52 ++++ plugin/test/gold/902/sqr-dot.golden | 15 + plugin/test/gold/902/sqr-gradr-dot.golden | 19 ++ plugin/test/gold/902/sqr-gradr-syn.golden | 54 ++++ plugin/test/gold/902/sqr-syn.golden | 1 + plugin/test/gold/902/twice-adf-dot.golden | 28 ++ plugin/test/gold/902/twice-adf-syn.golden | 16 + plugin/test/gold/902/twice-adr-dot.golden | 28 ++ plugin/test/gold/902/twice-adr-syn.golden | 24 ++ plugin/test/gold/902/twice-dot.golden | 15 + plugin/test/gold/902/twice-gradr-dot.golden | 17 ++ plugin/test/gold/902/twice-gradr-syn.golden | 26 ++ plugin/test/gold/902/twice-syn.golden | 1 + plugin/test/gold/902/xp3y-dot.golden | 19 ++ plugin/test/gold/902/xp3y-syn.golden | 1 + plugin/test/gold/complex-mul-a-dot.golden | 31 -- plugin/test/gold/complex-mul-a-syn.golden | 21 -- plugin/test/gold/cosSinProd-adr-dot.golden | 46 --- plugin/test/gold/cosSinProd-adr-syn.golden | 86 ------ plugin/test/gold/magSqr-adf-dot.golden | 46 --- plugin/test/gold/sqr-adf-dot.golden | 31 -- plugin/test/gold/sqr-adf-syn.golden | 30 -- plugin/test/gold/twice-adf-dot.golden | 28 -- plugin/test/gold/twice-adf-syn.golden | 3 - satisfy/src/ConCat/BuildDictionary.hs | 88 ++++-- satisfy/src/ConCat/Satisfy/Plugin.hs | 47 +-- satisfy/src/ConCat/Simplify.hs | 73 ++++- shell.nix | 9 +- 201 files changed, 3731 insertions(+), 588 deletions(-) create mode 100644 classes/src/ConCat/Oops.hs create mode 100644 plugin/test/gold/810/maximum-derf.golden create mode 100644 plugin/test/gold/810/maximum-derr.golden create mode 100644 plugin/test/gold/810/maximum-gradr.golden rename plugin/test/gold/{ => 900}/add-adf-dot.golden (100%) rename plugin/test/gold/{ => 900}/add-adf-syn.golden (100%) rename plugin/test/gold/{ => 900}/add-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/add-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/add-dot.golden (100%) rename plugin/test/gold/{ => 900}/add-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/add-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/add-syn.golden (100%) rename plugin/test/gold/{ => 900}/add-uncurry-dot.golden (100%) rename plugin/test/gold/{ => 900}/add-uncurry-syn.golden (100%) rename plugin/test/gold/{ => 900}/complex-mul-dot.golden (100%) rename plugin/test/gold/{ => 900}/complex-mul-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-2x-adf-dot.golden (100%) create mode 100644 plugin/test/gold/900/cos-2x-adf-syn.golden rename plugin/test/gold/{ => 900}/cos-2x-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-2x-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-2x-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-2x-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-adf-dot.golden (100%) create mode 100644 plugin/test/gold/900/cos-2xx-adf-syn.golden rename plugin/test/gold/{ => 900}/cos-2xx-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-2xx-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-adf-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-adf-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-xpy-adf-dot.golden (55%) create mode 100644 plugin/test/gold/900/cos-xpy-adf-syn.golden rename plugin/test/gold/{ => 900}/cos-xpy-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-xpy-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cos-xpy-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/cos-xpy-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/cosSinProd-dot.golden (100%) rename plugin/test/gold/{ => 900}/cosSinProd-syn.golden (100%) rename plugin/test/gold/{ => 900}/dup-dot.golden (100%) rename plugin/test/gold/{ => 900}/dup-syn.golden (100%) rename plugin/test/gold/{ => 900}/fst-dot.golden (100%) rename plugin/test/gold/{ => 900}/fst-syn.golden (100%) rename plugin/test/gold/{ => 900}/horner-dot.golden (100%) rename plugin/test/gold/{ => 900}/horner-syn.golden (100%) rename plugin/test/gold/{ => 900}/log-2xx-dot.golden (100%) rename plugin/test/gold/{ => 900}/log-2xx-syn.golden (100%) create mode 100644 plugin/test/gold/900/magSqr-adf-dot.golden create mode 100644 plugin/test/gold/900/magSqr-adf-syn.golden rename plugin/test/gold/{ => 900}/magSqr-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/magSqr-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/magSqr-dot.golden (100%) rename plugin/test/gold/{ => 900}/magSqr-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/magSqr-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/magSqr-syn.golden (100%) create mode 100644 plugin/test/gold/900/maximum-derf.golden create mode 100644 plugin/test/gold/900/maximum-derr.golden create mode 100644 plugin/test/gold/900/maximum-gradr.golden rename plugin/test/gold/{ => 900}/sin-adf-dot.golden (100%) rename plugin/test/gold/{ => 900}/sin-adf-syn.golden (100%) rename plugin/test/gold/{ => 900}/sin-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/sin-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/sin-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/sin-gradr-syn.golden (100%) create mode 100644 plugin/test/gold/900/sqr-adf-dot.golden create mode 100644 plugin/test/gold/900/sqr-adf-syn.golden rename plugin/test/gold/{ => 900}/sqr-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/sqr-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/sqr-dot.golden (100%) rename plugin/test/gold/{ => 900}/sqr-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/sqr-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/sqr-syn.golden (100%) create mode 100644 plugin/test/gold/900/twice-adf-dot.golden rename plugin/test/gold/{cos-xpy-adf-syn.golden => 900/twice-adf-syn.golden} (59%) rename plugin/test/gold/{ => 900}/twice-adr-dot.golden (100%) rename plugin/test/gold/{ => 900}/twice-adr-syn.golden (100%) rename plugin/test/gold/{ => 900}/twice-dot.golden (100%) rename plugin/test/gold/{ => 900}/twice-gradr-dot.golden (100%) rename plugin/test/gold/{ => 900}/twice-gradr-syn.golden (100%) rename plugin/test/gold/{ => 900}/twice-syn.golden (100%) rename plugin/test/gold/{ => 900}/xp3y-dot.golden (100%) rename plugin/test/gold/{ => 900}/xp3y-syn.golden (100%) create mode 100644 plugin/test/gold/902/add-adf-dot.golden create mode 100644 plugin/test/gold/902/add-adf-syn.golden create mode 100644 plugin/test/gold/902/add-adr-dot.golden create mode 100644 plugin/test/gold/902/add-adr-syn.golden create mode 100644 plugin/test/gold/902/add-dot.golden create mode 100644 plugin/test/gold/902/add-gradr-dot.golden create mode 100644 plugin/test/gold/902/add-gradr-syn.golden create mode 100644 plugin/test/gold/902/add-syn.golden create mode 100644 plugin/test/gold/902/add-uncurry-dot.golden create mode 100644 plugin/test/gold/902/add-uncurry-syn.golden create mode 100644 plugin/test/gold/902/complex-mul-dot.golden create mode 100644 plugin/test/gold/902/complex-mul-syn.golden create mode 100644 plugin/test/gold/902/cos-2x-adf-dot.golden rename plugin/test/gold/{ => 902}/cos-2x-adf-syn.golden (88%) create mode 100644 plugin/test/gold/902/cos-2x-adr-dot.golden create mode 100644 plugin/test/gold/902/cos-2x-adr-syn.golden create mode 100644 plugin/test/gold/902/cos-2x-gradr-dot.golden create mode 100644 plugin/test/gold/902/cos-2x-gradr-syn.golden create mode 100644 plugin/test/gold/902/cos-2xx-adf-dot.golden rename plugin/test/gold/{ => 902}/cos-2xx-adf-syn.golden (93%) create mode 100644 plugin/test/gold/902/cos-2xx-adr-dot.golden create mode 100644 plugin/test/gold/902/cos-2xx-adr-syn.golden create mode 100644 plugin/test/gold/902/cos-2xx-dot.golden create mode 100644 plugin/test/gold/902/cos-2xx-gradr-dot.golden create mode 100644 plugin/test/gold/902/cos-2xx-gradr-syn.golden create mode 100644 plugin/test/gold/902/cos-2xx-syn.golden create mode 100644 plugin/test/gold/902/cos-adf-dot.golden create mode 100644 plugin/test/gold/902/cos-adf-syn.golden create mode 100644 plugin/test/gold/902/cos-adr-dot.golden create mode 100644 plugin/test/gold/902/cos-adr-syn.golden create mode 100644 plugin/test/gold/902/cos-gradr-dot.golden create mode 100644 plugin/test/gold/902/cos-gradr-syn.golden create mode 100644 plugin/test/gold/902/cos-xpy-adf-dot.golden create mode 100644 plugin/test/gold/902/cos-xpy-adf-syn.golden create mode 100644 plugin/test/gold/902/cos-xpy-adr-dot.golden create mode 100644 plugin/test/gold/902/cos-xpy-adr-syn.golden create mode 100644 plugin/test/gold/902/cos-xpy-gradr-dot.golden create mode 100644 plugin/test/gold/902/cos-xpy-gradr-syn.golden create mode 100644 plugin/test/gold/902/cosSinProd-dot.golden create mode 100644 plugin/test/gold/902/cosSinProd-syn.golden create mode 100644 plugin/test/gold/902/dup-dot.golden create mode 100644 plugin/test/gold/902/dup-syn.golden create mode 100644 plugin/test/gold/902/fst-dot.golden create mode 100644 plugin/test/gold/902/fst-syn.golden create mode 100644 plugin/test/gold/902/horner-dot.golden create mode 100644 plugin/test/gold/902/horner-syn.golden create mode 100644 plugin/test/gold/902/log-2xx-dot.golden create mode 100644 plugin/test/gold/902/log-2xx-syn.golden create mode 100644 plugin/test/gold/902/magSqr-adf-dot.golden rename plugin/test/gold/{ => 902}/magSqr-adf-syn.golden (92%) create mode 100644 plugin/test/gold/902/magSqr-adr-dot.golden create mode 100644 plugin/test/gold/902/magSqr-adr-syn.golden create mode 100644 plugin/test/gold/902/magSqr-dot.golden create mode 100644 plugin/test/gold/902/magSqr-gradr-dot.golden create mode 100644 plugin/test/gold/902/magSqr-gradr-syn.golden create mode 100644 plugin/test/gold/902/magSqr-syn.golden create mode 100644 plugin/test/gold/902/maximum-derf.golden create mode 100644 plugin/test/gold/902/maximum-derr.golden create mode 100644 plugin/test/gold/902/maximum-gradr.golden create mode 100644 plugin/test/gold/902/sin-adf-dot.golden create mode 100644 plugin/test/gold/902/sin-adf-syn.golden create mode 100644 plugin/test/gold/902/sin-adr-dot.golden create mode 100644 plugin/test/gold/902/sin-adr-syn.golden create mode 100644 plugin/test/gold/902/sin-gradr-dot.golden create mode 100644 plugin/test/gold/902/sin-gradr-syn.golden create mode 100644 plugin/test/gold/902/sqr-adf-dot.golden create mode 100644 plugin/test/gold/902/sqr-adf-syn.golden create mode 100644 plugin/test/gold/902/sqr-adr-dot.golden create mode 100644 plugin/test/gold/902/sqr-adr-syn.golden create mode 100644 plugin/test/gold/902/sqr-dot.golden create mode 100644 plugin/test/gold/902/sqr-gradr-dot.golden create mode 100644 plugin/test/gold/902/sqr-gradr-syn.golden create mode 100644 plugin/test/gold/902/sqr-syn.golden create mode 100644 plugin/test/gold/902/twice-adf-dot.golden create mode 100644 plugin/test/gold/902/twice-adf-syn.golden create mode 100644 plugin/test/gold/902/twice-adr-dot.golden create mode 100644 plugin/test/gold/902/twice-adr-syn.golden create mode 100644 plugin/test/gold/902/twice-dot.golden create mode 100644 plugin/test/gold/902/twice-gradr-dot.golden create mode 100644 plugin/test/gold/902/twice-gradr-syn.golden create mode 100644 plugin/test/gold/902/twice-syn.golden create mode 100644 plugin/test/gold/902/xp3y-dot.golden create mode 100644 plugin/test/gold/902/xp3y-syn.golden delete mode 100644 plugin/test/gold/complex-mul-a-dot.golden delete mode 100644 plugin/test/gold/complex-mul-a-syn.golden delete mode 100644 plugin/test/gold/cosSinProd-adr-dot.golden delete mode 100644 plugin/test/gold/cosSinProd-adr-syn.golden delete mode 100644 plugin/test/gold/magSqr-adf-dot.golden delete mode 100644 plugin/test/gold/sqr-adf-dot.golden delete mode 100644 plugin/test/gold/sqr-adf-syn.golden delete mode 100644 plugin/test/gold/twice-adf-dot.golden delete mode 100644 plugin/test/gold/twice-adf-syn.golden diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23e39eac..e1028a1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,9 @@ jobs: strategy: matrix: ghc: - # - "8.0.2" # We've (temporarily?) lost support for these, but still - # - "8.2.2" # have conditional compilation for them. We should either - # - "8.4.1" # fix (some) of them or remove the CPP. - # - "8.6.1" - - "8.8.1" - - "8.10.1" + - "8.10.7" + - "9.0.2" + - "9.2.4" steps: - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 diff --git a/classes/concat-classes.cabal b/classes/concat-classes.cabal index 942a2555..e4926705 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/AltCat.hs b/classes/src/ConCat/AltCat.hs index f769971f..fbd8ddf1 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 #-} diff --git a/classes/src/ConCat/Category.hs b/classes/src/ConCat/Category.hs index 2176d831..839a525f 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 #-} @@ -1815,7 +1812,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 +2072,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 diff --git a/classes/src/ConCat/Experimental/A.hs b/classes/src/ConCat/Experimental/A.hs index 846a12e4..346afa19 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 39ed8f01..5232a32e 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 00000000..f12c56b8 --- /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/src/ConCat/ADFun.hs b/examples/src/ConCat/ADFun.hs index 4d0d4fb2..cf1b97d8 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 aae50a05..65d4d551 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 7fe0e782..f7566536 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 diff --git a/examples/src/ConCat/Dual.hs b/examples/src/ConCat/Dual.hs index 1f16bcc1..3949ce09 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/Nat.hs b/examples/src/ConCat/Nat.hs index 83363d32..20702080 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 92b5d227..9ad118cd 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 fea08629..1c988c1a 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/inline/src/ConCat/Inline/Plugin.hs b/inline/src/ConCat/Inline/Plugin.hs index df58c718..444b66ec 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 = @@ -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/nixpkgs-pin.json b/nix/nixpkgs-pin.json index 66188340..f3807e20 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/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 32a48ef7..4f0bce01 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -36,13 +36,43 @@ 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) +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.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) +#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) @@ -57,33 +87,49 @@ 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 CoAxiom import Unique (mkBuiltinUnique) --- For normaliseType etc -import FamInstEnv +import CoAxiom (coAxiomNthBranch, coAxBranchTyVars, coAxBranchRHS) +#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 @@ -122,10 +168,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 @@ -192,7 +238,7 @@ 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 @@ -240,7 +286,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) -> @@ -270,7 +316,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 $ @@ -284,7 +330,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = | 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 <- co + | FunCo' Representational co1 co2 <- co --, Just coA <- mkCoerceC_maybe cat a a' --, Just coB <- mkCoerceC_maybe cat b' b , let coA = goCoercion True co1 [] -- a a' @@ -332,7 +378,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") @@ -480,13 +526,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 @@ -495,24 +537,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))) @@ -521,16 +559,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 @@ -541,7 +579,7 @@ 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 @@ -595,7 +633,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") @@ -791,14 +829,18 @@ ccc (CccEnv {..}) (Ops {..}) cat = 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 + 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 @@ -932,17 +974,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#") @@ -954,7 +992,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) $ @@ -964,18 +1002,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 @@ -1015,7 +1047,7 @@ 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) @@ -1032,7 +1064,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 @@ -1051,7 +1083,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 @@ -1275,7 +1307,11 @@ 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)) @@ -1386,7 +1422,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 @@ -1457,12 +1497,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 : _) -> @@ -1496,9 +1536,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". @@ -1513,13 +1551,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 @@ -1532,7 +1571,7 @@ 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 @@ -1546,7 +1585,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) ] @@ -1554,11 +1593,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) && @@ -1582,20 +1617,21 @@ 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 -#endif +#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 } mkCccEnv :: [CommandLineOption] -> CoreM CccEnv @@ -1614,13 +1650,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 @@ -1688,8 +1720,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 @@ -1787,8 +1831,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 @@ -1825,7 +1872,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 @@ -1874,45 +1925,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" @@ -1926,14 +1955,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 @@ -1970,10 +1994,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. @@ -1985,7 +2009,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 @@ -2040,10 +2068,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 @@ -2101,7 +2129,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. @@ -2116,11 +2144,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) @@ -2132,21 +2156,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 @@ -2214,10 +2234,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)])) + (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 50f635bf..1467f7d4 100644 --- a/plugin/src/ConCat/Rebox.hs +++ b/plugin/src/ConCat/Rebox.hs @@ -493,10 +493,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/plugin/test/Utils.hs b/plugin/test/Utils.hs index 765c07c5..3e6321f1 100644 --- a/plugin/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/plugin/test/gold/810/maximum-derf.golden b/plugin/test/gold/810/maximum-derf.golden new file mode 100644 index 00000000..e347ea3a --- /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 00000000..fd8a4977 --- /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 00000000..d3f5183d --- /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/plugin/test/gold/add-adf-dot.golden b/plugin/test/gold/900/add-adf-dot.golden similarity index 100% rename from plugin/test/gold/add-adf-dot.golden rename to plugin/test/gold/900/add-adf-dot.golden diff --git a/plugin/test/gold/add-adf-syn.golden b/plugin/test/gold/900/add-adf-syn.golden similarity index 100% rename from plugin/test/gold/add-adf-syn.golden rename to plugin/test/gold/900/add-adf-syn.golden diff --git a/plugin/test/gold/add-adr-dot.golden b/plugin/test/gold/900/add-adr-dot.golden similarity index 100% rename from plugin/test/gold/add-adr-dot.golden rename to plugin/test/gold/900/add-adr-dot.golden diff --git a/plugin/test/gold/add-adr-syn.golden b/plugin/test/gold/900/add-adr-syn.golden similarity index 100% rename from plugin/test/gold/add-adr-syn.golden rename to plugin/test/gold/900/add-adr-syn.golden diff --git a/plugin/test/gold/add-dot.golden b/plugin/test/gold/900/add-dot.golden similarity index 100% rename from plugin/test/gold/add-dot.golden rename to plugin/test/gold/900/add-dot.golden diff --git a/plugin/test/gold/add-gradr-dot.golden b/plugin/test/gold/900/add-gradr-dot.golden similarity index 100% rename from plugin/test/gold/add-gradr-dot.golden rename to plugin/test/gold/900/add-gradr-dot.golden diff --git a/plugin/test/gold/add-gradr-syn.golden b/plugin/test/gold/900/add-gradr-syn.golden similarity index 100% rename from plugin/test/gold/add-gradr-syn.golden rename to plugin/test/gold/900/add-gradr-syn.golden diff --git a/plugin/test/gold/add-syn.golden b/plugin/test/gold/900/add-syn.golden similarity index 100% rename from plugin/test/gold/add-syn.golden rename to plugin/test/gold/900/add-syn.golden diff --git a/plugin/test/gold/add-uncurry-dot.golden b/plugin/test/gold/900/add-uncurry-dot.golden similarity index 100% rename from plugin/test/gold/add-uncurry-dot.golden rename to plugin/test/gold/900/add-uncurry-dot.golden diff --git a/plugin/test/gold/add-uncurry-syn.golden b/plugin/test/gold/900/add-uncurry-syn.golden similarity index 100% rename from plugin/test/gold/add-uncurry-syn.golden rename to plugin/test/gold/900/add-uncurry-syn.golden diff --git a/plugin/test/gold/complex-mul-dot.golden b/plugin/test/gold/900/complex-mul-dot.golden similarity index 100% rename from plugin/test/gold/complex-mul-dot.golden rename to plugin/test/gold/900/complex-mul-dot.golden diff --git a/plugin/test/gold/complex-mul-syn.golden b/plugin/test/gold/900/complex-mul-syn.golden similarity index 100% rename from plugin/test/gold/complex-mul-syn.golden rename to plugin/test/gold/900/complex-mul-syn.golden diff --git a/plugin/test/gold/cos-2x-adf-dot.golden b/plugin/test/gold/900/cos-2x-adf-dot.golden similarity index 100% rename from plugin/test/gold/cos-2x-adf-dot.golden rename to plugin/test/gold/900/cos-2x-adf-dot.golden 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 00000000..021a8b37 --- /dev/null +++ b/plugin/test/gold/900/cos-2x-adf-syn.golden @@ -0,0 +1,87 @@ +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 *** + abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/cos-2x-adr-dot.golden b/plugin/test/gold/900/cos-2x-adr-dot.golden similarity index 100% rename from plugin/test/gold/cos-2x-adr-dot.golden rename to plugin/test/gold/900/cos-2x-adr-dot.golden diff --git a/plugin/test/gold/cos-2x-adr-syn.golden b/plugin/test/gold/900/cos-2x-adr-syn.golden similarity index 100% rename from plugin/test/gold/cos-2x-adr-syn.golden rename to plugin/test/gold/900/cos-2x-adr-syn.golden diff --git a/plugin/test/gold/cos-2x-gradr-dot.golden b/plugin/test/gold/900/cos-2x-gradr-dot.golden similarity index 100% rename from plugin/test/gold/cos-2x-gradr-dot.golden rename to plugin/test/gold/900/cos-2x-gradr-dot.golden diff --git a/plugin/test/gold/cos-2x-gradr-syn.golden b/plugin/test/gold/900/cos-2x-gradr-syn.golden similarity index 100% rename from plugin/test/gold/cos-2x-gradr-syn.golden rename to plugin/test/gold/900/cos-2x-gradr-syn.golden diff --git a/plugin/test/gold/cos-2xx-adf-dot.golden b/plugin/test/gold/900/cos-2xx-adf-dot.golden similarity index 100% rename from plugin/test/gold/cos-2xx-adf-dot.golden rename to plugin/test/gold/900/cos-2xx-adf-dot.golden 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 00000000..0b7319df --- /dev/null +++ b/plugin/test/gold/900/cos-2xx-adf-syn.golden @@ -0,0 +1,152 @@ +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 *** + abst . curry mulC . exl) . + 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 *** + abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/cos-2xx-adr-dot.golden b/plugin/test/gold/900/cos-2xx-adr-dot.golden similarity index 100% rename from plugin/test/gold/cos-2xx-adr-dot.golden rename to plugin/test/gold/900/cos-2xx-adr-dot.golden diff --git a/plugin/test/gold/cos-2xx-adr-syn.golden b/plugin/test/gold/900/cos-2xx-adr-syn.golden similarity index 100% rename from plugin/test/gold/cos-2xx-adr-syn.golden rename to plugin/test/gold/900/cos-2xx-adr-syn.golden diff --git a/plugin/test/gold/cos-2xx-dot.golden b/plugin/test/gold/900/cos-2xx-dot.golden similarity index 100% rename from plugin/test/gold/cos-2xx-dot.golden rename to plugin/test/gold/900/cos-2xx-dot.golden diff --git a/plugin/test/gold/cos-2xx-gradr-dot.golden b/plugin/test/gold/900/cos-2xx-gradr-dot.golden similarity index 100% rename from plugin/test/gold/cos-2xx-gradr-dot.golden rename to plugin/test/gold/900/cos-2xx-gradr-dot.golden diff --git a/plugin/test/gold/cos-2xx-gradr-syn.golden b/plugin/test/gold/900/cos-2xx-gradr-syn.golden similarity index 100% rename from plugin/test/gold/cos-2xx-gradr-syn.golden rename to plugin/test/gold/900/cos-2xx-gradr-syn.golden diff --git a/plugin/test/gold/cos-2xx-syn.golden b/plugin/test/gold/900/cos-2xx-syn.golden similarity index 100% rename from plugin/test/gold/cos-2xx-syn.golden rename to plugin/test/gold/900/cos-2xx-syn.golden diff --git a/plugin/test/gold/cos-adf-dot.golden b/plugin/test/gold/900/cos-adf-dot.golden similarity index 100% rename from plugin/test/gold/cos-adf-dot.golden rename to plugin/test/gold/900/cos-adf-dot.golden diff --git a/plugin/test/gold/cos-adf-syn.golden b/plugin/test/gold/900/cos-adf-syn.golden similarity index 100% rename from plugin/test/gold/cos-adf-syn.golden rename to plugin/test/gold/900/cos-adf-syn.golden diff --git a/plugin/test/gold/cos-adr-dot.golden b/plugin/test/gold/900/cos-adr-dot.golden similarity index 100% rename from plugin/test/gold/cos-adr-dot.golden rename to plugin/test/gold/900/cos-adr-dot.golden diff --git a/plugin/test/gold/cos-adr-syn.golden b/plugin/test/gold/900/cos-adr-syn.golden similarity index 100% rename from plugin/test/gold/cos-adr-syn.golden rename to plugin/test/gold/900/cos-adr-syn.golden diff --git a/plugin/test/gold/cos-gradr-dot.golden b/plugin/test/gold/900/cos-gradr-dot.golden similarity index 100% rename from plugin/test/gold/cos-gradr-dot.golden rename to plugin/test/gold/900/cos-gradr-dot.golden diff --git a/plugin/test/gold/cos-gradr-syn.golden b/plugin/test/gold/900/cos-gradr-syn.golden similarity index 100% rename from plugin/test/gold/cos-gradr-syn.golden rename to plugin/test/gold/900/cos-gradr-syn.golden diff --git a/plugin/test/gold/cos-xpy-adf-dot.golden b/plugin/test/gold/900/cos-xpy-adf-dot.golden similarity index 55% rename from plugin/test/gold/cos-xpy-adf-dot.golden rename to plugin/test/gold/900/cos-xpy-adf-dot.golden index 74a1e5f7..e89e109f 100644 --- a/plugin/test/gold/cos-xpy-adf-dot.golden +++ b/plugin/test/gold/900/cos-xpy-adf-dot.golden @@ -10,28 +10,28 @@ digraph cos_xpy_adf { 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_81 { + subgraph cluster_77 { margin=8 fontsize=20 labeljust=r color=DarkGreen - c78 [label="{{|}|\|{}}"] - c77 [label="{{|}|+|{}}"] - c76 [label="{In|{|}}"] - c80 [label="{{}|Out}"] - c79 [label="{{}|negate|{}}"] - c44:Out0 -> c78:In0 [label="Double"] - c77:Out0 -> c78:In1 [label="Double"] - c76:Out0 -> c77:In0 [label="Double"] - c76:Out1 -> c77:In1 [label="Double"] - c79:Out0 -> c80:In0 [label="Double"] - c78:Out0 -> c79:In0 [label="Double"] + 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 clusterc82 { label=""; color=white; margin=0; c82 [label="{{|}|Out}"] } + 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 -> c82:In0 [label="Double"] - c80 -> c82:In1 [ltail=cluster_81,label="Double Double 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 00000000..f9c57c95 --- /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/cos-xpy-adr-dot.golden b/plugin/test/gold/900/cos-xpy-adr-dot.golden similarity index 100% rename from plugin/test/gold/cos-xpy-adr-dot.golden rename to plugin/test/gold/900/cos-xpy-adr-dot.golden diff --git a/plugin/test/gold/cos-xpy-adr-syn.golden b/plugin/test/gold/900/cos-xpy-adr-syn.golden similarity index 100% rename from plugin/test/gold/cos-xpy-adr-syn.golden rename to plugin/test/gold/900/cos-xpy-adr-syn.golden diff --git a/plugin/test/gold/cos-xpy-gradr-dot.golden b/plugin/test/gold/900/cos-xpy-gradr-dot.golden similarity index 100% rename from plugin/test/gold/cos-xpy-gradr-dot.golden rename to plugin/test/gold/900/cos-xpy-gradr-dot.golden diff --git a/plugin/test/gold/cos-xpy-gradr-syn.golden b/plugin/test/gold/900/cos-xpy-gradr-syn.golden similarity index 100% rename from plugin/test/gold/cos-xpy-gradr-syn.golden rename to plugin/test/gold/900/cos-xpy-gradr-syn.golden diff --git a/plugin/test/gold/cosSinProd-dot.golden b/plugin/test/gold/900/cosSinProd-dot.golden similarity index 100% rename from plugin/test/gold/cosSinProd-dot.golden rename to plugin/test/gold/900/cosSinProd-dot.golden diff --git a/plugin/test/gold/cosSinProd-syn.golden b/plugin/test/gold/900/cosSinProd-syn.golden similarity index 100% rename from plugin/test/gold/cosSinProd-syn.golden rename to plugin/test/gold/900/cosSinProd-syn.golden diff --git a/plugin/test/gold/dup-dot.golden b/plugin/test/gold/900/dup-dot.golden similarity index 100% rename from plugin/test/gold/dup-dot.golden rename to plugin/test/gold/900/dup-dot.golden diff --git a/plugin/test/gold/dup-syn.golden b/plugin/test/gold/900/dup-syn.golden similarity index 100% rename from plugin/test/gold/dup-syn.golden rename to plugin/test/gold/900/dup-syn.golden diff --git a/plugin/test/gold/fst-dot.golden b/plugin/test/gold/900/fst-dot.golden similarity index 100% rename from plugin/test/gold/fst-dot.golden rename to plugin/test/gold/900/fst-dot.golden diff --git a/plugin/test/gold/fst-syn.golden b/plugin/test/gold/900/fst-syn.golden similarity index 100% rename from plugin/test/gold/fst-syn.golden rename to plugin/test/gold/900/fst-syn.golden diff --git a/plugin/test/gold/horner-dot.golden b/plugin/test/gold/900/horner-dot.golden similarity index 100% rename from plugin/test/gold/horner-dot.golden rename to plugin/test/gold/900/horner-dot.golden diff --git a/plugin/test/gold/horner-syn.golden b/plugin/test/gold/900/horner-syn.golden similarity index 100% rename from plugin/test/gold/horner-syn.golden rename to plugin/test/gold/900/horner-syn.golden diff --git a/plugin/test/gold/log-2xx-dot.golden b/plugin/test/gold/900/log-2xx-dot.golden similarity index 100% rename from plugin/test/gold/log-2xx-dot.golden rename to plugin/test/gold/900/log-2xx-dot.golden diff --git a/plugin/test/gold/log-2xx-syn.golden b/plugin/test/gold/900/log-2xx-syn.golden similarity index 100% rename from plugin/test/gold/log-2xx-syn.golden rename to plugin/test/gold/900/log-2xx-syn.golden 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 00000000..fd901411 --- /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 clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } + subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } + subgraph clusterc797 { label=""; color=white; margin=0; c797 [label="{{|}|+|{}}"] } + subgraph cluster_825 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c819 [label="{{|}|\|{}}"] + c821 [label="{{|}|\|{}}"] + c820 [label="{{|}|+|{}}"] + c823 [label="{{|}|+|{}}"] + c822 [label="{{|}|+|{}}"] + c818 [label="{In|{|}}"] + c824 [label="{{}|Out}"] + c0:Out0 -> c819:In0 [label="Double"] + c818:Out0 -> c819:In1 [label="Double"] + c0:Out1 -> c821:In0 [label="Double"] + c818:Out1 -> c821:In1 [label="Double"] + c819:Out0 -> c820:In0 [label="Double"] + c819:Out0 -> c820:In1 [label="Double"] + c820:Out0 -> c823:In0 [label="Double"] + c822:Out0 -> c823:In1 [label="Double"] + c821:Out0 -> c822:In0 [label="Double"] + c821:Out0 -> c822:In1 [label="Double"] + c823:Out0 -> c824:In0 [label="Double"] + } + subgraph clusterc826 { label=""; color=white; margin=0; c826 [label="{{|}|Out}"] } + c0:Out1 -> c401:In0 [label="Double"] + c0:Out1 -> c401:In1 [label="Double"] + c0:Out0 -> c638:In0 [label="Double"] + c0:Out0 -> c638:In1 [label="Double"] + c401:Out0 -> c797:In0 [label="Double"] + c638:Out0 -> c797:In1 [label="Double"] + c797:Out0 -> c826:In0 [label="Double"] + c824 -> c826:In1 [ltail=cluster_825,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 00000000..9dd98c54 --- /dev/null +++ b/plugin/test/gold/900/magSqr-adf-syn.golden @@ -0,0 +1,176 @@ +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) . +((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 *** + abst . curry mulC . exl) . + 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) *** + ((exl *** abst . curry (exl . exr)) . dup) . exl . exl) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exr) . + dup) . + dup . exl . 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 *** + abst . curry mulC . exl) . + 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) *** + ((exr *** abst . curry (exr . exr)) . dup) . exl . exl) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exr) . + dup) . + dup . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/magSqr-adr-dot.golden b/plugin/test/gold/900/magSqr-adr-dot.golden similarity index 100% rename from plugin/test/gold/magSqr-adr-dot.golden rename to plugin/test/gold/900/magSqr-adr-dot.golden diff --git a/plugin/test/gold/magSqr-adr-syn.golden b/plugin/test/gold/900/magSqr-adr-syn.golden similarity index 100% rename from plugin/test/gold/magSqr-adr-syn.golden rename to plugin/test/gold/900/magSqr-adr-syn.golden diff --git a/plugin/test/gold/magSqr-dot.golden b/plugin/test/gold/900/magSqr-dot.golden similarity index 100% rename from plugin/test/gold/magSqr-dot.golden rename to plugin/test/gold/900/magSqr-dot.golden diff --git a/plugin/test/gold/magSqr-gradr-dot.golden b/plugin/test/gold/900/magSqr-gradr-dot.golden similarity index 100% rename from plugin/test/gold/magSqr-gradr-dot.golden rename to plugin/test/gold/900/magSqr-gradr-dot.golden diff --git a/plugin/test/gold/magSqr-gradr-syn.golden b/plugin/test/gold/900/magSqr-gradr-syn.golden similarity index 100% rename from plugin/test/gold/magSqr-gradr-syn.golden rename to plugin/test/gold/900/magSqr-gradr-syn.golden diff --git a/plugin/test/gold/magSqr-syn.golden b/plugin/test/gold/900/magSqr-syn.golden similarity index 100% rename from plugin/test/gold/magSqr-syn.golden rename to plugin/test/gold/900/magSqr-syn.golden diff --git a/plugin/test/gold/900/maximum-derf.golden b/plugin/test/gold/900/maximum-derf.golden new file mode 100644 index 00000000..e347ea3a --- /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 00000000..fd8a4977 --- /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 00000000..d3f5183d --- /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/sin-adf-dot.golden b/plugin/test/gold/900/sin-adf-dot.golden similarity index 100% rename from plugin/test/gold/sin-adf-dot.golden rename to plugin/test/gold/900/sin-adf-dot.golden diff --git a/plugin/test/gold/sin-adf-syn.golden b/plugin/test/gold/900/sin-adf-syn.golden similarity index 100% rename from plugin/test/gold/sin-adf-syn.golden rename to plugin/test/gold/900/sin-adf-syn.golden diff --git a/plugin/test/gold/sin-adr-dot.golden b/plugin/test/gold/900/sin-adr-dot.golden similarity index 100% rename from plugin/test/gold/sin-adr-dot.golden rename to plugin/test/gold/900/sin-adr-dot.golden diff --git a/plugin/test/gold/sin-adr-syn.golden b/plugin/test/gold/900/sin-adr-syn.golden similarity index 100% rename from plugin/test/gold/sin-adr-syn.golden rename to plugin/test/gold/900/sin-adr-syn.golden diff --git a/plugin/test/gold/sin-gradr-dot.golden b/plugin/test/gold/900/sin-gradr-dot.golden similarity index 100% rename from plugin/test/gold/sin-gradr-dot.golden rename to plugin/test/gold/900/sin-gradr-dot.golden diff --git a/plugin/test/gold/sin-gradr-syn.golden b/plugin/test/gold/900/sin-gradr-syn.golden similarity index 100% rename from plugin/test/gold/sin-gradr-syn.golden rename to plugin/test/gold/900/sin-gradr-syn.golden 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 00000000..56369cc5 --- /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 00000000..9af8f3e9 --- /dev/null +++ b/plugin/test/gold/900/sqr-adf-syn.golden @@ -0,0 +1,34 @@ +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 *** + abst . curry mulC . exl) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/sqr-adr-dot.golden b/plugin/test/gold/900/sqr-adr-dot.golden similarity index 100% rename from plugin/test/gold/sqr-adr-dot.golden rename to plugin/test/gold/900/sqr-adr-dot.golden diff --git a/plugin/test/gold/sqr-adr-syn.golden b/plugin/test/gold/900/sqr-adr-syn.golden similarity index 100% rename from plugin/test/gold/sqr-adr-syn.golden rename to plugin/test/gold/900/sqr-adr-syn.golden diff --git a/plugin/test/gold/sqr-dot.golden b/plugin/test/gold/900/sqr-dot.golden similarity index 100% rename from plugin/test/gold/sqr-dot.golden rename to plugin/test/gold/900/sqr-dot.golden diff --git a/plugin/test/gold/sqr-gradr-dot.golden b/plugin/test/gold/900/sqr-gradr-dot.golden similarity index 100% rename from plugin/test/gold/sqr-gradr-dot.golden rename to plugin/test/gold/900/sqr-gradr-dot.golden diff --git a/plugin/test/gold/sqr-gradr-syn.golden b/plugin/test/gold/900/sqr-gradr-syn.golden similarity index 100% rename from plugin/test/gold/sqr-gradr-syn.golden rename to plugin/test/gold/900/sqr-gradr-syn.golden diff --git a/plugin/test/gold/sqr-syn.golden b/plugin/test/gold/900/sqr-syn.golden similarity index 100% rename from plugin/test/gold/sqr-syn.golden rename to plugin/test/gold/900/sqr-syn.golden 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 00000000..01d49c49 --- /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/cos-xpy-adf-syn.golden b/plugin/test/gold/900/twice-adf-syn.golden similarity index 59% rename from plugin/test/gold/cos-xpy-adf-syn.golden rename to plugin/test/gold/900/twice-adf-syn.golden index aae5d2cb..f09fd4fa 100644 --- a/plugin/test/gold/cos-xpy-adf-syn.golden +++ b/plugin/test/gold/900/twice-adf-syn.golden @@ -1,18 +1,16 @@ second (id . repr) . apply . ((curry - ((exr *** + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . - abst . - curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup *** - abst . curry (addC . exr)) . + repr . exr . exr *** + exr . exl) . dup) . dup) *** - cosC) . + ((addC *** abst . curry (addC . exr)) . dup) . exl) . dup) . -addC \ No newline at end of file +(dup *** abst . curry (dup . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/twice-adr-dot.golden b/plugin/test/gold/900/twice-adr-dot.golden similarity index 100% rename from plugin/test/gold/twice-adr-dot.golden rename to plugin/test/gold/900/twice-adr-dot.golden diff --git a/plugin/test/gold/twice-adr-syn.golden b/plugin/test/gold/900/twice-adr-syn.golden similarity index 100% rename from plugin/test/gold/twice-adr-syn.golden rename to plugin/test/gold/900/twice-adr-syn.golden diff --git a/plugin/test/gold/twice-dot.golden b/plugin/test/gold/900/twice-dot.golden similarity index 100% rename from plugin/test/gold/twice-dot.golden rename to plugin/test/gold/900/twice-dot.golden diff --git a/plugin/test/gold/twice-gradr-dot.golden b/plugin/test/gold/900/twice-gradr-dot.golden similarity index 100% rename from plugin/test/gold/twice-gradr-dot.golden rename to plugin/test/gold/900/twice-gradr-dot.golden diff --git a/plugin/test/gold/twice-gradr-syn.golden b/plugin/test/gold/900/twice-gradr-syn.golden similarity index 100% rename from plugin/test/gold/twice-gradr-syn.golden rename to plugin/test/gold/900/twice-gradr-syn.golden diff --git a/plugin/test/gold/twice-syn.golden b/plugin/test/gold/900/twice-syn.golden similarity index 100% rename from plugin/test/gold/twice-syn.golden rename to plugin/test/gold/900/twice-syn.golden diff --git a/plugin/test/gold/xp3y-dot.golden b/plugin/test/gold/900/xp3y-dot.golden similarity index 100% rename from plugin/test/gold/xp3y-dot.golden rename to plugin/test/gold/900/xp3y-dot.golden diff --git a/plugin/test/gold/xp3y-syn.golden b/plugin/test/gold/900/xp3y-syn.golden similarity index 100% rename from plugin/test/gold/xp3y-syn.golden rename to plugin/test/gold/900/xp3y-syn.golden 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 00000000..296ee412 --- /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 00000000..d446add7 --- /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 00000000..708ec4c9 --- /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 00000000..5c74c0f3 --- /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 00000000..7b4f837a --- /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 00000000..82746d29 --- /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 00000000..0c5076e9 --- /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 00000000..d543240d --- /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 00000000..e7c65890 --- /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 00000000..c4a4e484 --- /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 00000000..2f88826f --- /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 00000000..b33ab087 --- /dev/null +++ b/plugin/test/gold/902/complex-mul-syn.golden @@ -0,0 +1,16 @@ +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 \ 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 00000000..20339b5e --- /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/cos-2x-adf-syn.golden b/plugin/test/gold/902/cos-2x-adf-syn.golden similarity index 88% rename from plugin/test/gold/cos-2x-adf-syn.golden rename to plugin/test/gold/902/cos-2x-adf-syn.golden index e577cfd3..2e7e4cc5 100644 --- a/plugin/test/gold/cos-2x-adf-syn.golden +++ b/plugin/test/gold/902/cos-2x-adf-syn.golden @@ -1,20 +1,25 @@ second (id . repr) . apply . ((curry - ((exr *** + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . - abst . - curry mulC . - apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** + repr . exr . exr *** exr . exl) . dup) . dup) *** - cosC . exl) . + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . dup) . apply . ((curry 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 00000000..eaeb8528 --- /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 00000000..f6691e42 --- /dev/null +++ b/plugin/test/gold/902/cos-2x-adr-syn.golden @@ -0,0 +1,125 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + 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 00000000..4882aa74 --- /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 00000000..b96057f3 --- /dev/null +++ b/plugin/test/gold/902/cos-2x-gradr-syn.golden @@ -0,0 +1,127 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + 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 00000000..8ea7e8ec --- /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/cos-2xx-adf-syn.golden b/plugin/test/gold/902/cos-2xx-adf-syn.golden similarity index 93% rename from plugin/test/gold/cos-2xx-adf-syn.golden rename to plugin/test/gold/902/cos-2xx-adf-syn.golden index 69fbd5a2..1f4e907b 100644 --- a/plugin/test/gold/cos-2xx-adf-syn.golden +++ b/plugin/test/gold/902/cos-2xx-adf-syn.golden @@ -1,20 +1,25 @@ second (id . repr) . apply . ((curry - ((exr *** + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . - repr . - abst . - curry mulC . - apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** + repr . exr . exr *** exr . exl) . dup) . dup) *** - cosC . exl) . + apply . + ((curry + ((exr *** + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup) . + dup) *** + cosC) . + dup) . + exl) . dup) . apply . ((curry 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 00000000..1e0de33d --- /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 00000000..9bfa5d2a --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-adr-syn.golden @@ -0,0 +1,215 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + 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 00000000..ab90b5f5 --- /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 00000000..a2b56205 --- /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 00000000..6f8fccac --- /dev/null +++ b/plugin/test/gold/902/cos-2xx-gradr-syn.golden @@ -0,0 +1,217 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + 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 00000000..6c236aa2 --- /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 00000000..1b4deacf --- /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 00000000..1adb5632 --- /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 00000000..52707dac --- /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 00000000..1d1eac29 --- /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 00000000..bec73cbf --- /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 00000000..09230108 --- /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 00000000..e89e109f --- /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 00000000..f9c57c95 --- /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 00000000..7b42f75d --- /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 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/902/cos-xpy-adr-syn.golden b/plugin/test/gold/902/cos-xpy-adr-syn.golden new file mode 100644 index 00000000..14d7164a --- /dev/null +++ b/plugin/test/gold/902/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/902/cos-xpy-gradr-dot.golden b/plugin/test/gold/902/cos-xpy-gradr-dot.golden new file mode 100644 index 00000000..0128caf2 --- /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|{|}}"] + 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/902/cos-xpy-gradr-syn.golden b/plugin/test/gold/902/cos-xpy-gradr-syn.golden new file mode 100644 index 00000000..2d5985c7 --- /dev/null +++ b/plugin/test/gold/902/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/902/cosSinProd-dot.golden b/plugin/test/gold/902/cosSinProd-dot.golden new file mode 100644 index 00000000..3cf075e6 --- /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 00000000..7b951500 --- /dev/null +++ b/plugin/test/gold/902/cosSinProd-syn.golden @@ -0,0 +1 @@ +((cosC *** sinC) . dup) . mulC \ 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 00000000..ed6525c8 --- /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 00000000..5d487a85 --- /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 00000000..01f192d8 --- /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 00000000..438c6f21 --- /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 00000000..4c99cd78 --- /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 00000000..dc3a8396 --- /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 00000000..1e8454d6 --- /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 00000000..58d8e5c2 --- /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 00000000..fd901411 --- /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 clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } + subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } + subgraph clusterc797 { label=""; color=white; margin=0; c797 [label="{{|}|+|{}}"] } + subgraph cluster_825 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c819 [label="{{|}|\|{}}"] + c821 [label="{{|}|\|{}}"] + c820 [label="{{|}|+|{}}"] + c823 [label="{{|}|+|{}}"] + c822 [label="{{|}|+|{}}"] + c818 [label="{In|{|}}"] + c824 [label="{{}|Out}"] + c0:Out0 -> c819:In0 [label="Double"] + c818:Out0 -> c819:In1 [label="Double"] + c0:Out1 -> c821:In0 [label="Double"] + c818:Out1 -> c821:In1 [label="Double"] + c819:Out0 -> c820:In0 [label="Double"] + c819:Out0 -> c820:In1 [label="Double"] + c820:Out0 -> c823:In0 [label="Double"] + c822:Out0 -> c823:In1 [label="Double"] + c821:Out0 -> c822:In0 [label="Double"] + c821:Out0 -> c822:In1 [label="Double"] + c823:Out0 -> c824:In0 [label="Double"] + } + subgraph clusterc826 { label=""; color=white; margin=0; c826 [label="{{|}|Out}"] } + c0:Out1 -> c401:In0 [label="Double"] + c0:Out1 -> c401:In1 [label="Double"] + c0:Out0 -> c638:In0 [label="Double"] + c0:Out0 -> c638:In1 [label="Double"] + c401:Out0 -> c797:In0 [label="Double"] + c638:Out0 -> c797:In1 [label="Double"] + c797:Out0 -> c826:In0 [label="Double"] + c824 -> c826:In1 [ltail=cluster_825,label="Double Double Double"] +} diff --git a/plugin/test/gold/magSqr-adf-syn.golden b/plugin/test/gold/902/magSqr-adf-syn.golden similarity index 92% rename from plugin/test/gold/magSqr-adf-syn.golden rename to plugin/test/gold/902/magSqr-adf-syn.golden index b40ce23d..942a0826 100644 --- a/plugin/test/gold/magSqr-adf-syn.golden +++ b/plugin/test/gold/902/magSqr-adf-syn.golden @@ -1,5 +1,18 @@ second (id . repr) . -((addC . exl *** abst . curry (addC . apply) . repr . exr) . 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) *** + ((addC *** abst . curry (addC . exr)) . dup) . exl) . + dup) . ((exl *** apply . (coerce . 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 00000000..6d43a27d --- /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 clusterc704 { label=""; color=white; margin=0; c704 [label="{{|}|\|{}}"] } + subgraph clusterc1130 { label=""; color=white; margin=0; c1130 [label="{{|}|\|{}}"] } + subgraph clusterc1440 { label=""; color=white; margin=0; c1440 [label="{{|}|+|{}}"] } + subgraph cluster_1498 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1492 [label="{{|}|\|{}}"] + c1495 [label="{{|}|\|{}}"] + c1494 [label="{{|}|+|{}}"] + c1496 [label="{{|}|+|{}}"] + c1491 [label="{In|{}}"] + c1497 [label="{{|}|Out}"] + c0:Out0 -> c1492:In0 [label="Double"] + c1491:Out0 -> c1492:In1 [label="Double"] + c0:Out1 -> c1495:In0 [label="Double"] + c1491:Out0 -> c1495:In1 [label="Double"] + c1492:Out0 -> c1494:In0 [label="Double"] + c1492:Out0 -> c1494:In1 [label="Double"] + c1495:Out0 -> c1496:In0 [label="Double"] + c1495:Out0 -> c1496:In1 [label="Double"] + c1494:Out0 -> c1497:In0 [label="Double"] + c1496:Out0 -> c1497:In1 [label="Double"] + } + subgraph clusterc1499 { label=""; color=white; margin=0; c1499 [label="{{|}|Out}"] } + c0:Out1 -> c704:In0 [label="Double"] + c0:Out1 -> c704:In1 [label="Double"] + c0:Out0 -> c1130:In0 [label="Double"] + c0:Out0 -> c1130:In1 [label="Double"] + c704:Out0 -> c1440:In0 [label="Double"] + c1130:Out0 -> c1440:In1 [label="Double"] + c1440:Out0 -> c1499:In0 [label="Double"] + c1497 -> c1499:In1 [ltail=cluster_1498,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 00000000..dcd75cf3 --- /dev/null +++ b/plugin/test/gold/902/magSqr-adr-syn.golden @@ -0,0 +1,264 @@ +((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) . +((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) *** + 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exl . 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exr) . + dup) . +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 00000000..6beba561 --- /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 00000000..024b9931 --- /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|{|}}"] + c704 [label="{{|}|\|{}}"] + c1130 [label="{{|}|\|{}}"] + c1440 [label="{{|}|+|{}}"] + c1501 [label="{{|}|+|{}}"] + c1502 [label="{{|}|+|{}}"] + c1503 [label="{{||}|Out}"] + c0:Out1 -> c704:In0 [label="Double"] + c0:Out1 -> c704:In1 [label="Double"] + c0:Out0 -> c1130:In0 [label="Double"] + c0:Out0 -> c1130:In1 [label="Double"] + c704:Out0 -> c1440:In0 [label="Double"] + c1130:Out0 -> c1440:In1 [label="Double"] + c0:Out0 -> c1501:In0 [label="Double"] + c0:Out0 -> c1501:In1 [label="Double"] + c0:Out1 -> c1502:In0 [label="Double"] + c0:Out1 -> c1502:In1 [label="Double"] + c1440:Out0 -> c1503:In0 [label="Double"] + c1501:Out0 -> c1503:In1 [label="Double"] + c1502:Out0 -> c1503: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 00000000..1568a72c --- /dev/null +++ b/plugin/test/gold/902/magSqr-gradr-syn.golden @@ -0,0 +1,266 @@ +((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) . +((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) *** + 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exl . 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exr) . + dup) . +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 00000000..28f26c2b --- /dev/null +++ b/plugin/test/gold/902/magSqr-syn.golden @@ -0,0 +1 @@ +addC . (mulC . (exl *** exl) . dup *** mulC . (exr *** 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 00000000..e347ea3a --- /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 00000000..fd8a4977 --- /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 00000000..d3f5183d --- /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 00000000..412357d2 --- /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 00000000..c8441093 --- /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 00000000..d017f0d9 --- /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 00000000..23b07c29 --- /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 00000000..ec826a31 --- /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 00000000..16dcf219 --- /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 00000000..56369cc5 --- /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 00000000..4e0c3229 --- /dev/null +++ b/plugin/test/gold/902/sqr-adf-syn.golden @@ -0,0 +1,34 @@ +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 *** + abst . curry mulC . exl) . + 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 00000000..4993f8d9 --- /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 00000000..f052bad5 --- /dev/null +++ b/plugin/test/gold/902/sqr-adr-syn.golden @@ -0,0 +1,52 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 00000000..a9f70b53 --- /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 00000000..5980b83c --- /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 00000000..6ada6a56 --- /dev/null +++ b/plugin/test/gold/902/sqr-gradr-syn.golden @@ -0,0 +1,54 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 00000000..71c93dc1 --- /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 00000000..01d49c49 --- /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 00000000..f09fd4fa --- /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 00000000..632b5f13 --- /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 00000000..52e2873c --- /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 00000000..8286b1b8 --- /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 00000000..6c7b1b39 --- /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 00000000..feaa5c50 --- /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 00000000..9242c719 --- /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 00000000..2da92fbf --- /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 00000000..0b0fd1bd --- /dev/null +++ b/plugin/test/gold/902/xp3y-syn.golden @@ -0,0 +1 @@ +addC . (exl *** mulC . (const 3.0 *** exr) . dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/complex-mul-a-dot.golden b/plugin/test/gold/complex-mul-a-dot.golden deleted file mode 100644 index 35bf7958..00000000 --- a/plugin/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/plugin/test/gold/complex-mul-a-syn.golden b/plugin/test/gold/complex-mul-a-syn.golden deleted file mode 100644 index 3a2c72e1..00000000 --- a/plugin/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/plugin/test/gold/cosSinProd-adr-dot.golden b/plugin/test/gold/cosSinProd-adr-dot.golden deleted file mode 100644 index 20ff96c0..00000000 --- a/plugin/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/plugin/test/gold/cosSinProd-adr-syn.golden b/plugin/test/gold/cosSinProd-adr-syn.golden deleted file mode 100644 index ac798d44..00000000 --- a/plugin/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/plugin/test/gold/magSqr-adf-dot.golden b/plugin/test/gold/magSqr-adf-dot.golden deleted file mode 100644 index cde2bc2f..00000000 --- a/plugin/test/gold/magSqr-adf-dot.golden +++ /dev/null @@ -1,46 +0,0 @@ -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 clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } - subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } - subgraph clusterc770 { label=""; color=white; margin=0; c770 [label="{{|}|+|{}}"] } - subgraph cluster_778 { - margin=8 - fontsize=20 - labeljust=r - color=DarkGreen - c772 [label="{{|}|\|{}}"] - c774 [label="{{|}|\|{}}"] - c773 [label="{{|}|+|{}}"] - c776 [label="{{|}|+|{}}"] - c775 [label="{{|}|+|{}}"] - c771 [label="{In|{|}}"] - c777 [label="{{}|Out}"] - c0:Out0 -> c772:In0 [label="Double"] - c771:Out0 -> c772:In1 [label="Double"] - c0:Out1 -> c774:In0 [label="Double"] - c771:Out1 -> c774:In1 [label="Double"] - c772:Out0 -> c773:In0 [label="Double"] - c772:Out0 -> c773:In1 [label="Double"] - c773:Out0 -> c776:In0 [label="Double"] - c775:Out0 -> c776:In1 [label="Double"] - c774:Out0 -> c775:In0 [label="Double"] - c774:Out0 -> c775:In1 [label="Double"] - c776:Out0 -> c777:In0 [label="Double"] - } - subgraph clusterc779 { label=""; color=white; margin=0; c779 [label="{{|}|Out}"] } - c0:Out1 -> c401:In0 [label="Double"] - c0:Out1 -> c401:In1 [label="Double"] - c0:Out0 -> c638:In0 [label="Double"] - c0:Out0 -> c638:In1 [label="Double"] - c401:Out0 -> c770:In0 [label="Double"] - c638:Out0 -> c770:In1 [label="Double"] - c770:Out0 -> c779:In0 [label="Double"] - c777 -> c779:In1 [ltail=cluster_778,label="Double Double Double"] -} diff --git a/plugin/test/gold/sqr-adf-dot.golden b/plugin/test/gold/sqr-adf-dot.golden deleted file mode 100644 index 633d3eaa..00000000 --- a/plugin/test/gold/sqr-adf-dot.golden +++ /dev/null @@ -1,31 +0,0 @@ -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 clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|\|{}}"] } - subgraph cluster_78 { - margin=8 - fontsize=20 - labeljust=r - color=DarkGreen - c75 [label="{{|}|\|{}}"] - c76 [label="{{|}|+|{}}"] - c74 [label="{In|{}}"] - c77 [label="{{}|Out}"] - c0:Out0 -> c75:In0 [label="Double"] - c74:Out0 -> c75:In1 [label="Double"] - c75:Out0 -> c76:In0 [label="Double"] - c75:Out0 -> c76:In1 [label="Double"] - c76:Out0 -> c77:In0 [label="Double"] - } - subgraph clusterc79 { label=""; color=white; margin=0; c79 [label="{{|}|Out}"] } - c0:Out0 -> c1:In0 [label="Double"] - c0:Out0 -> c1:In1 [label="Double"] - c1:Out0 -> c79:In0 [label="Double"] - c77 -> c79:In1 [ltail=cluster_78,label="Double Double"] -} diff --git a/plugin/test/gold/sqr-adf-syn.golden b/plugin/test/gold/sqr-adf-syn.golden deleted file mode 100644 index e827d0b5..00000000 --- a/plugin/test/gold/sqr-adf-syn.golden +++ /dev/null @@ -1,30 +0,0 @@ -second (id . repr) . -((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) . -((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 *** - abst . curry mulC . exl) . - dup) . - dup) . -dup \ No newline at end of file diff --git a/plugin/test/gold/twice-adf-dot.golden b/plugin/test/gold/twice-adf-dot.golden deleted file mode 100644 index a9abe573..00000000 --- a/plugin/test/gold/twice-adf-dot.golden +++ /dev/null @@ -1,28 +0,0 @@ -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 clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } - subgraph cluster_8 { - margin=8 - fontsize=20 - labeljust=r - color=DarkGreen - c6 [label="{{|}|+|{}}"] - c5 [label="{In|{}}"] - c7 [label="{{}|Out}"] - c5:Out0 -> c6:In0 [label="Double"] - c5:Out0 -> c6:In1 [label="Double"] - c6:Out0 -> c7:In0 [label="Double"] - } - subgraph clusterc9 { label=""; color=white; margin=0; c9 [label="{{|}|Out}"] } - c0:Out0 -> c1:In0 [label="Double"] - c0:Out0 -> c1:In1 [label="Double"] - c1:Out0 -> c9:In0 [label="Double"] - c7 -> c9:In1 [ltail=cluster_8,label="Double Double"] -} diff --git a/plugin/test/gold/twice-adf-syn.golden b/plugin/test/gold/twice-adf-syn.golden deleted file mode 100644 index 8e8d72ec..00000000 --- a/plugin/test/gold/twice-adf-syn.golden +++ /dev/null @@ -1,3 +0,0 @@ -(addC . dup *** - id . repr . abst . curry (addC . apply) . repr . abst . curry (dup . exr)) . -dup \ No newline at end of file diff --git a/satisfy/src/ConCat/BuildDictionary.hs b/satisfy/src/ConCat/BuildDictionary.hs index c35579b1..cd246b9f 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 62d32148..0f33cf26 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 c0e64d61..6abbfb2b 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 6159b247..4e63f896 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,13 @@ with import ./nix/pkgs.nix; pkgs.haskellPackages.shellFor { - nativeBuildInputs = [ cabal-install ghc graphviz ]; + nativeBuildInputs = with pkgs; + [ cabal-install + ghc + graphviz + (pkgs.haskell-language-server.override { + supportedGhcVersions = [ "8107" "902" "924" ]; + }) + ]; packages = p: with pkgs.haskellPackages; [ concat-classes From 2f3817f421201cb5cda38ba8e32cd2f3edb1926c Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 10:47:09 +0100 Subject: [PATCH 11/28] Add HLS config file. --- hie.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 hie.yaml diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 00000000..3140911c --- /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" From 4bc24919d4181b7a09c4d542b828139722d087e8 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 10:47:40 +0100 Subject: [PATCH 12/28] Fix comment about the command to update the Nix pin. --- nix/pinned-nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/pinned-nixpkgs.nix b/nix/pinned-nixpkgs.nix index 79b0d207..3aeb9b38 100644 --- a/nix/pinned-nixpkgs.nix +++ b/nix/pinned-nixpkgs.nix @@ -1,7 +1,7 @@ let 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; From c498072add0273ee108c8aca31cbed437fb780f5 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 11:13:06 +0100 Subject: [PATCH 13/28] INLINE crossF This is needed for derivatives that go to a different target category like Syn - the crossF results from the derivative of fmapC. --- classes/src/ConCat/Category.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/src/ConCat/Category.hs b/classes/src/ConCat/Category.hs index 839a525f..e22a7f66 100644 --- a/classes/src/ConCat/Category.hs +++ b/classes/src/ConCat/Category.hs @@ -2327,7 +2327,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) From adaa333cddc12d7d247256285c5d3ff3bc2a1ba2 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 11:39:21 +0100 Subject: [PATCH 14/28] Add tanh to FloatingCat. From a patch by Raoul Schlotterbeck. --- classes/src/ConCat/AltCat.hs | 1 + classes/src/ConCat/Category.hs | 9 ++++++++- examples/src/ConCat/GAD.hs | 2 ++ plugin/src/ConCat/Rebox.hs | 7 +++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/classes/src/ConCat/AltCat.hs b/classes/src/ConCat/AltCat.hs index fbd8ddf1..aee8f942 100644 --- a/classes/src/ConCat/AltCat.hs +++ b/classes/src/ConCat/AltCat.hs @@ -379,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) diff --git a/classes/src/ConCat/Category.hs b/classes/src/ConCat/Category.hs index e22a7f66..c6ae3384 100644 --- a/classes/src/ConCat/Category.hs +++ b/classes/src/ConCat/Category.hs @@ -1365,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 @@ -1695,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 @@ -1707,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 @@ -1721,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 @@ -1730,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 @@ -1738,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) diff --git a/examples/src/ConCat/GAD.hs b/examples/src/ConCat/GAD.hs index 85bced34..1d01094b 100644 --- a/examples/src/ConCat/GAD.hs +++ b/examples/src/ConCat/GAD.hs @@ -249,11 +249,13 @@ instance (ScalarCat k s, Ok k s, Floating s) => FloatingCat (GD k) s where sinC = scalarX sin cos cosC = scalarX cos (negate . sin) sqrtC = scalarX sqrt (recip . scale 2 . sqrt) + 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/plugin/src/ConCat/Rebox.hs b/plugin/src/ConCat/Rebox.hs index 1467f7d4..c5f88db5 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: @@ -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 From 38b15a8d8d4b107a45f64e41e7bbb83bc21e70f4 Mon Sep 17 00:00:00 2001 From: raoul Date: Tue, 24 Jan 2023 09:29:18 +0100 Subject: [PATCH 15/28] Optimize sqrtC derivative. --- examples/src/ConCat/GAD.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/src/ConCat/GAD.hs b/examples/src/ConCat/GAD.hs index 1d01094b..8c2138a4 100644 --- a/examples/src/ConCat/GAD.hs +++ b/examples/src/ConCat/GAD.hs @@ -248,7 +248,7 @@ 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 #-} From 84900a2937cdfdfe7fcc773f18b4a4ddcf5251ee Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 11:54:01 +0100 Subject: [PATCH 16/28] Unbreak compile of concat-graphics on ghc 9. Just a matter of adding FlexibleContexts. --- graphics/src/ConCat/Graphics/Color.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/graphics/src/ConCat/Graphics/Color.hs b/graphics/src/ConCat/Graphics/Color.hs index a85dff09..e9f0fc7b 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 #-} From 39c3a0514b87eebe078c7589f8583d8f2c70af58 Mon Sep 17 00:00:00 2001 From: raoul Date: Thu, 17 Jun 2021 16:20:41 +0200 Subject: [PATCH 17/28] Catify min, max. --- plugin/src/ConCat/Rebox.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/ConCat/Rebox.hs b/plugin/src/ConCat/Rebox.hs index c5f88db5..0e46ffde 100644 --- a/plugin/src/ConCat/Rebox.hs +++ b/plugin/src/ConCat/Rebox.hs @@ -411,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) From 999d8a7c6dbec117ff04371149077e293001200f Mon Sep 17 00:00:00 2001 From: raoul Date: Mon, 10 Oct 2022 10:29:40 +0200 Subject: [PATCH 18/28] Add ghc rule. --- classes/src/ConCat/AltCat.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/src/ConCat/AltCat.hs b/classes/src/ConCat/AltCat.hs index aee8f942..c512bb9d 100644 --- a/classes/src/ConCat/AltCat.hs +++ b/classes/src/ConCat/AltCat.hs @@ -1155,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 From 04d367c92ef43f5b621953ff5bd95477295d0348 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Thu, 9 Jun 2022 16:47:30 +0200 Subject: [PATCH 19/28] Call optimizeCoercion before checking for FunCo. This brings FunCo to the top in many cases. --- plugin/src/ConCat/Plugin.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 4f0bce01..cd44028e 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -55,6 +55,9 @@ 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.Driver.Config (initOptCoercionOpts) import GHC.Data.Pair (Pair(..), swap) import GHC.Driver.Backend (Backend(..)) import GHC.Plugins as GHC hiding (substTy,cat) @@ -96,6 +99,8 @@ import qualified UniqDFM as DFMap import TyCoRep import Unique (mkBuiltinUnique) import CoAxiom (coAxiomNthBranch, coAxBranchTyVars, coAxBranchRHS) +import OptCoercion (optCoercion) +import TyCoSubst (emptyTCvSubst) #endif import GHC.Classes @@ -330,7 +335,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = | 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 <- co + | 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' @@ -952,6 +957,7 @@ data Ops = Ops , isPseudoApp :: CoreExpr -> Bool , normType :: Role -> Type -> (Coercion, Type) , okType :: Type -> Bool + , optimizeCoercion :: Coercion -> Coercion } mkOps :: CccEnv -> ModGuts -> AnnEnv -> FamInstEnvs @@ -1385,6 +1391,11 @@ 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 From f0013c4afeb01be339185464d3135c454f088ba6 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Wed, 7 Sep 2022 09:31:59 +0200 Subject: [PATCH 20/28] Make TypeRep bindings let-float. --- plugin/src/ConCat/Plugin.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index cd44028e..cbb4ba5a 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -43,7 +43,8 @@ import Data.IORef #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import GHC.Builtin.Names (leftDataConName,rightDataConName ,floatTyConKey,doubleTyConKey,integerTyConKey - ,intTyConKey,boolTyConKey) + ,intTyConKey,boolTyConKey + ,typeRepTyConName) import GHC.Builtin.Types.Prim (intPrimTyCon) import GHC.Core.Class (classAllSelIds) -- For normaliseType etc @@ -85,7 +86,8 @@ import MkId (mkDictSelRhs,coerceId) 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) @@ -1407,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) @@ -1455,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" From c191dedbf11479b3fc8be1019cf0c8a92fe3aa5b Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Tue, 5 Apr 2022 16:21:55 +0200 Subject: [PATCH 21/28] Try lam Let compose later. lam Let can occasionally do a better job. --- plugin/src/ConCat/Plugin.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index cbb4ba5a..38b3d811 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -466,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') -> @@ -504,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") From aaca2f9eb0491c333bd1b31a34b9c53095f7a182 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 16:45:12 +0100 Subject: [PATCH 22/28] Unbreak plugin build on ghc 9.0.2 --- plugin/src/ConCat/Plugin.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 38b3d811..005c78e4 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -58,7 +58,6 @@ import GHC.Core.Type (coreView) import GHC.Core.Coercion.Axiom import GHC.Core.Coercion.Opt (optCoercion) import GHC.Core.TyCo.Subst (emptyTCvSubst) -import GHC.Driver.Config (initOptCoercionOpts) import GHC.Data.Pair (Pair(..), swap) import GHC.Driver.Backend (Backend(..)) import GHC.Plugins as GHC hiding (substTy,cat) @@ -71,6 +70,7 @@ 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) From 00ae6bc12a1da50ca4943d63319d3860b18415b6 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 13 Feb 2023 17:06:03 +0100 Subject: [PATCH 23/28] Unbreak gold test. Moving lam let compose moved a few subexpressions. --- plugin/test/gold/810/add-adf-dot.golden | 28 ++ plugin/test/gold/810/add-adf-syn.golden | 1 + plugin/test/gold/810/add-adr-dot.golden | 26 + plugin/test/gold/810/add-adr-syn.golden | 2 + plugin/test/gold/810/add-dot.golden | 24 + plugin/test/gold/810/add-gradr-dot.golden | 18 + plugin/test/gold/810/add-gradr-syn.golden | 4 + plugin/test/gold/810/add-syn.golden | 1 + plugin/test/gold/810/add-uncurry-dot.golden | 15 + plugin/test/gold/810/add-uncurry-syn.golden | 1 + plugin/test/gold/810/complex-mul-dot.golden | 31 ++ plugin/test/gold/810/complex-mul-syn.golden | 16 + plugin/test/gold/810/cos-2x-adf-dot.golden | 38 ++ plugin/test/gold/810/cos-2x-adf-syn.golden | 82 +++ plugin/test/gold/810/cos-2x-adr-dot.golden | 38 ++ plugin/test/gold/810/cos-2x-adr-syn.golden | 125 +++++ plugin/test/gold/810/cos-2x-gradr-dot.golden | 26 + plugin/test/gold/810/cos-2x-gradr-syn.golden | 127 +++++ plugin/test/gold/810/cos-2xx-adf-dot.golden | 50 ++ plugin/test/gold/810/cos-2xx-adf-syn.golden | 147 ++++++ plugin/test/gold/810/cos-2xx-adr-dot.golden | 50 ++ plugin/test/gold/810/cos-2xx-adr-syn.golden | 215 ++++++++ plugin/test/gold/810/cos-2xx-dot.golden | 21 + plugin/test/gold/810/cos-2xx-gradr-dot.golden | 38 ++ plugin/test/gold/810/cos-2xx-gradr-syn.golden | 217 ++++++++ plugin/test/gold/810/cos-2xx-syn.golden | 1 + plugin/test/gold/810/cos-adf-dot.golden | 31 ++ plugin/test/gold/810/cos-adf-syn.golden | 9 + plugin/test/gold/810/cos-adr-dot.golden | 31 ++ plugin/test/gold/810/cos-adr-syn.golden | 11 + plugin/test/gold/810/cos-gradr-dot.golden | 19 + plugin/test/gold/810/cos-gradr-syn.golden | 13 + plugin/test/gold/810/cos-xpy-adf-dot.golden | 37 ++ plugin/test/gold/810/cos-xpy-adf-syn.golden | 18 + plugin/test/gold/810/cos-xpy-adr-dot.golden | 35 ++ plugin/test/gold/810/cos-xpy-adr-syn.golden | 33 ++ plugin/test/gold/810/cos-xpy-gradr-dot.golden | 23 + plugin/test/gold/810/cos-xpy-gradr-syn.golden | 35 ++ plugin/test/gold/810/cosSinProd-dot.golden | 20 + plugin/test/gold/810/cosSinProd-syn.golden | 1 + plugin/test/gold/810/dup-dot.golden | 13 + plugin/test/gold/810/dup-syn.golden | 1 + plugin/test/gold/810/fst-dot.golden | 12 + plugin/test/gold/810/fst-syn.golden | 1 + plugin/test/gold/810/horner-dot.golden | 27 + plugin/test/gold/810/horner-syn.golden | 12 + plugin/test/gold/810/log-2xx-dot.golden | 21 + plugin/test/gold/810/log-2xx-syn.golden | 1 + plugin/test/gold/810/magSqr-adf-dot.golden | 46 ++ plugin/test/gold/810/magSqr-adf-syn.golden | 163 ++++++ plugin/test/gold/810/magSqr-adr-dot.golden | 44 ++ plugin/test/gold/810/magSqr-adr-syn.golden | 264 ++++++++++ plugin/test/gold/810/magSqr-dot.golden | 21 + plugin/test/gold/810/magSqr-gradr-dot.golden | 29 ++ plugin/test/gold/810/magSqr-gradr-syn.golden | 266 ++++++++++ plugin/test/gold/810/magSqr-syn.golden | 1 + plugin/test/gold/810/sin-adf-dot.golden | 29 ++ plugin/test/gold/810/sin-adf-syn.golden | 7 + plugin/test/gold/810/sin-adr-dot.golden | 29 ++ plugin/test/gold/810/sin-adr-syn.golden | 9 + plugin/test/gold/810/sin-gradr-dot.golden | 17 + plugin/test/gold/810/sin-gradr-syn.golden | 11 + plugin/test/gold/810/sqr-adf-dot.golden | 31 ++ plugin/test/gold/810/sqr-adf-syn.golden | 30 ++ plugin/test/gold/810/sqr-adr-dot.golden | 31 ++ plugin/test/gold/810/sqr-adr-syn.golden | 52 ++ plugin/test/gold/810/sqr-dot.golden | 15 + plugin/test/gold/810/sqr-gradr-dot.golden | 19 + plugin/test/gold/810/sqr-gradr-syn.golden | 54 ++ plugin/test/gold/810/sqr-syn.golden | 1 + plugin/test/gold/810/twice-adf-dot.golden | 28 ++ plugin/test/gold/810/twice-adf-syn.golden | 3 + plugin/test/gold/810/twice-adr-dot.golden | 28 ++ plugin/test/gold/810/twice-adr-syn.golden | 24 + plugin/test/gold/810/twice-dot.golden | 15 + plugin/test/gold/810/twice-gradr-dot.golden | 17 + plugin/test/gold/810/twice-gradr-syn.golden | 26 + plugin/test/gold/810/twice-syn.golden | 1 + plugin/test/gold/810/xp3y-dot.golden | 19 + plugin/test/gold/810/xp3y-syn.golden | 1 + plugin/test/gold/900/complex-mul-syn.golden | 3 +- plugin/test/gold/900/cos-2x-adf-syn.golden | 33 +- plugin/test/gold/900/cos-2x-adr-syn.golden | 45 +- plugin/test/gold/900/cos-2x-gradr-syn.golden | 45 +- plugin/test/gold/900/cos-2xx-adf-syn.golden | 65 +-- plugin/test/gold/900/cos-2xx-adr-syn.golden | 89 ++-- plugin/test/gold/900/cos-2xx-gradr-syn.golden | 89 ++-- plugin/test/gold/900/magSqr-adf-dot.golden | 62 +-- plugin/test/gold/900/magSqr-adf-syn.golden | 289 ++++++----- plugin/test/gold/900/magSqr-adr-dot.golden | 58 +-- plugin/test/gold/900/magSqr-adr-syn.golden | 466 +++++++++++------- plugin/test/gold/900/magSqr-gradr-dot.golden | 38 +- plugin/test/gold/900/magSqr-gradr-syn.golden | 466 +++++++++++------- plugin/test/gold/900/magSqr-syn.golden | 5 +- plugin/test/gold/900/sqr-adf-syn.golden | 27 +- plugin/test/gold/900/sqr-adr-syn.golden | 39 +- plugin/test/gold/900/sqr-gradr-syn.golden | 39 +- plugin/test/gold/900/xp3y-syn.golden | 2 +- plugin/test/gold/902/complex-mul-syn.golden | 3 +- plugin/test/gold/902/cos-2x-adf-syn.golden | 33 +- plugin/test/gold/902/cos-2x-adr-syn.golden | 45 +- plugin/test/gold/902/cos-2x-gradr-syn.golden | 45 +- plugin/test/gold/902/cos-2xx-adf-syn.golden | 65 +-- plugin/test/gold/902/cos-2xx-adr-syn.golden | 89 ++-- plugin/test/gold/902/cos-2xx-gradr-syn.golden | 89 ++-- plugin/test/gold/902/cos-xpy-adr-dot.golden | 40 +- plugin/test/gold/902/cos-xpy-adr-syn.golden | 56 ++- plugin/test/gold/902/cos-xpy-gradr-dot.golden | 26 +- plugin/test/gold/902/cos-xpy-gradr-syn.golden | 56 ++- plugin/test/gold/902/cosSinProd-syn.golden | 2 +- plugin/test/gold/902/magSqr-adf-dot.golden | 62 +-- plugin/test/gold/902/magSqr-adf-syn.golden | 289 ++++++----- plugin/test/gold/902/magSqr-adr-dot.golden | 58 +-- plugin/test/gold/902/magSqr-adr-syn.golden | 466 +++++++++++------- plugin/test/gold/902/magSqr-gradr-dot.golden | 38 +- plugin/test/gold/902/magSqr-gradr-syn.golden | 466 +++++++++++------- plugin/test/gold/902/magSqr-syn.golden | 5 +- plugin/test/gold/902/sqr-adf-syn.golden | 27 +- plugin/test/gold/902/sqr-adr-syn.golden | 39 +- plugin/test/gold/902/sqr-gradr-syn.golden | 39 +- plugin/test/gold/902/xp3y-syn.golden | 2 +- 121 files changed, 5339 insertions(+), 1638 deletions(-) create mode 100644 plugin/test/gold/810/add-adf-dot.golden create mode 100644 plugin/test/gold/810/add-adf-syn.golden create mode 100644 plugin/test/gold/810/add-adr-dot.golden create mode 100644 plugin/test/gold/810/add-adr-syn.golden create mode 100644 plugin/test/gold/810/add-dot.golden create mode 100644 plugin/test/gold/810/add-gradr-dot.golden create mode 100644 plugin/test/gold/810/add-gradr-syn.golden create mode 100644 plugin/test/gold/810/add-syn.golden create mode 100644 plugin/test/gold/810/add-uncurry-dot.golden create mode 100644 plugin/test/gold/810/add-uncurry-syn.golden create mode 100644 plugin/test/gold/810/complex-mul-dot.golden create mode 100644 plugin/test/gold/810/complex-mul-syn.golden create mode 100644 plugin/test/gold/810/cos-2x-adf-dot.golden create mode 100644 plugin/test/gold/810/cos-2x-adf-syn.golden create mode 100644 plugin/test/gold/810/cos-2x-adr-dot.golden create mode 100644 plugin/test/gold/810/cos-2x-adr-syn.golden create mode 100644 plugin/test/gold/810/cos-2x-gradr-dot.golden create mode 100644 plugin/test/gold/810/cos-2x-gradr-syn.golden create mode 100644 plugin/test/gold/810/cos-2xx-adf-dot.golden create mode 100644 plugin/test/gold/810/cos-2xx-adf-syn.golden create mode 100644 plugin/test/gold/810/cos-2xx-adr-dot.golden create mode 100644 plugin/test/gold/810/cos-2xx-adr-syn.golden create mode 100644 plugin/test/gold/810/cos-2xx-dot.golden create mode 100644 plugin/test/gold/810/cos-2xx-gradr-dot.golden create mode 100644 plugin/test/gold/810/cos-2xx-gradr-syn.golden create mode 100644 plugin/test/gold/810/cos-2xx-syn.golden create mode 100644 plugin/test/gold/810/cos-adf-dot.golden create mode 100644 plugin/test/gold/810/cos-adf-syn.golden create mode 100644 plugin/test/gold/810/cos-adr-dot.golden create mode 100644 plugin/test/gold/810/cos-adr-syn.golden create mode 100644 plugin/test/gold/810/cos-gradr-dot.golden create mode 100644 plugin/test/gold/810/cos-gradr-syn.golden create mode 100644 plugin/test/gold/810/cos-xpy-adf-dot.golden create mode 100644 plugin/test/gold/810/cos-xpy-adf-syn.golden create mode 100644 plugin/test/gold/810/cos-xpy-adr-dot.golden create mode 100644 plugin/test/gold/810/cos-xpy-adr-syn.golden create mode 100644 plugin/test/gold/810/cos-xpy-gradr-dot.golden create mode 100644 plugin/test/gold/810/cos-xpy-gradr-syn.golden create mode 100644 plugin/test/gold/810/cosSinProd-dot.golden create mode 100644 plugin/test/gold/810/cosSinProd-syn.golden create mode 100644 plugin/test/gold/810/dup-dot.golden create mode 100644 plugin/test/gold/810/dup-syn.golden create mode 100644 plugin/test/gold/810/fst-dot.golden create mode 100644 plugin/test/gold/810/fst-syn.golden create mode 100644 plugin/test/gold/810/horner-dot.golden create mode 100644 plugin/test/gold/810/horner-syn.golden create mode 100644 plugin/test/gold/810/log-2xx-dot.golden create mode 100644 plugin/test/gold/810/log-2xx-syn.golden create mode 100644 plugin/test/gold/810/magSqr-adf-dot.golden create mode 100644 plugin/test/gold/810/magSqr-adf-syn.golden create mode 100644 plugin/test/gold/810/magSqr-adr-dot.golden create mode 100644 plugin/test/gold/810/magSqr-adr-syn.golden create mode 100644 plugin/test/gold/810/magSqr-dot.golden create mode 100644 plugin/test/gold/810/magSqr-gradr-dot.golden create mode 100644 plugin/test/gold/810/magSqr-gradr-syn.golden create mode 100644 plugin/test/gold/810/magSqr-syn.golden create mode 100644 plugin/test/gold/810/sin-adf-dot.golden create mode 100644 plugin/test/gold/810/sin-adf-syn.golden create mode 100644 plugin/test/gold/810/sin-adr-dot.golden create mode 100644 plugin/test/gold/810/sin-adr-syn.golden create mode 100644 plugin/test/gold/810/sin-gradr-dot.golden create mode 100644 plugin/test/gold/810/sin-gradr-syn.golden create mode 100644 plugin/test/gold/810/sqr-adf-dot.golden create mode 100644 plugin/test/gold/810/sqr-adf-syn.golden create mode 100644 plugin/test/gold/810/sqr-adr-dot.golden create mode 100644 plugin/test/gold/810/sqr-adr-syn.golden create mode 100644 plugin/test/gold/810/sqr-dot.golden create mode 100644 plugin/test/gold/810/sqr-gradr-dot.golden create mode 100644 plugin/test/gold/810/sqr-gradr-syn.golden create mode 100644 plugin/test/gold/810/sqr-syn.golden create mode 100644 plugin/test/gold/810/twice-adf-dot.golden create mode 100644 plugin/test/gold/810/twice-adf-syn.golden create mode 100644 plugin/test/gold/810/twice-adr-dot.golden create mode 100644 plugin/test/gold/810/twice-adr-syn.golden create mode 100644 plugin/test/gold/810/twice-dot.golden create mode 100644 plugin/test/gold/810/twice-gradr-dot.golden create mode 100644 plugin/test/gold/810/twice-gradr-syn.golden create mode 100644 plugin/test/gold/810/twice-syn.golden create mode 100644 plugin/test/gold/810/xp3y-dot.golden create mode 100644 plugin/test/gold/810/xp3y-syn.golden diff --git a/plugin/test/gold/810/add-adf-dot.golden b/plugin/test/gold/810/add-adf-dot.golden new file mode 100644 index 00000000..296ee412 --- /dev/null +++ b/plugin/test/gold/810/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/810/add-adf-syn.golden b/plugin/test/gold/810/add-adf-syn.golden new file mode 100644 index 00000000..d446add7 --- /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/plugin/test/gold/810/add-adr-dot.golden b/plugin/test/gold/810/add-adr-dot.golden new file mode 100644 index 00000000..708ec4c9 --- /dev/null +++ b/plugin/test/gold/810/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/810/add-adr-syn.golden b/plugin/test/gold/810/add-adr-syn.golden new file mode 100644 index 00000000..5c74c0f3 --- /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/plugin/test/gold/810/add-dot.golden b/plugin/test/gold/810/add-dot.golden new file mode 100644 index 00000000..7b4f837a --- /dev/null +++ b/plugin/test/gold/810/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/810/add-gradr-dot.golden b/plugin/test/gold/810/add-gradr-dot.golden new file mode 100644 index 00000000..82746d29 --- /dev/null +++ b/plugin/test/gold/810/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/810/add-gradr-syn.golden b/plugin/test/gold/810/add-gradr-syn.golden new file mode 100644 index 00000000..0c5076e9 --- /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/plugin/test/gold/810/add-syn.golden b/plugin/test/gold/810/add-syn.golden new file mode 100644 index 00000000..d543240d --- /dev/null +++ b/plugin/test/gold/810/add-syn.golden @@ -0,0 +1 @@ +curry addC \ No newline at end of file diff --git a/plugin/test/gold/810/add-uncurry-dot.golden b/plugin/test/gold/810/add-uncurry-dot.golden new file mode 100644 index 00000000..e7c65890 --- /dev/null +++ b/plugin/test/gold/810/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/810/add-uncurry-syn.golden b/plugin/test/gold/810/add-uncurry-syn.golden new file mode 100644 index 00000000..c4a4e484 --- /dev/null +++ b/plugin/test/gold/810/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/810/complex-mul-dot.golden b/plugin/test/gold/810/complex-mul-dot.golden new file mode 100644 index 00000000..2f88826f --- /dev/null +++ b/plugin/test/gold/810/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/810/complex-mul-syn.golden b/plugin/test/gold/810/complex-mul-syn.golden new file mode 100644 index 00000000..b33ab087 --- /dev/null +++ b/plugin/test/gold/810/complex-mul-syn.golden @@ -0,0 +1,16 @@ +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 \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2x-adf-dot.golden b/plugin/test/gold/810/cos-2x-adf-dot.golden new file mode 100644 index 00000000..20339b5e --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2x-adf-syn.golden b/plugin/test/gold/810/cos-2x-adf-syn.golden new file mode 100644 index 00000000..e577cfd3 --- /dev/null +++ b/plugin/test/gold/810/cos-2x-adf-syn.golden @@ -0,0 +1,82 @@ +second (id . repr) . +apply . +((curry + ((exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + abst . + curry mulC . + apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** + exr . exl) . + dup) . + dup) *** + cosC . 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 *** + abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2x-adr-dot.golden b/plugin/test/gold/810/cos-2x-adr-dot.golden new file mode 100644 index 00000000..eaeb8528 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2x-adr-syn.golden b/plugin/test/gold/810/cos-2x-adr-syn.golden new file mode 100644 index 00000000..f6691e42 --- /dev/null +++ b/plugin/test/gold/810/cos-2x-adr-syn.golden @@ -0,0 +1,125 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2x-gradr-dot.golden b/plugin/test/gold/810/cos-2x-gradr-dot.golden new file mode 100644 index 00000000..4882aa74 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2x-gradr-syn.golden b/plugin/test/gold/810/cos-2x-gradr-syn.golden new file mode 100644 index 00000000..b96057f3 --- /dev/null +++ b/plugin/test/gold/810/cos-2x-gradr-syn.golden @@ -0,0 +1,127 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2xx-adf-dot.golden b/plugin/test/gold/810/cos-2xx-adf-dot.golden new file mode 100644 index 00000000..8ea7e8ec --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2xx-adf-syn.golden b/plugin/test/gold/810/cos-2xx-adf-syn.golden new file mode 100644 index 00000000..69fbd5a2 --- /dev/null +++ b/plugin/test/gold/810/cos-2xx-adf-syn.golden @@ -0,0 +1,147 @@ +second (id . repr) . +apply . +((curry + ((exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + abst . + curry mulC . + apply . (curry exl . negateC . sinC . exl . exl *** exr) . dup *** + exr . exl) . + dup) . + dup) *** + cosC . 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 *** + abst . curry mulC . exl) . + 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 *** + abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2xx-adr-dot.golden b/plugin/test/gold/810/cos-2xx-adr-dot.golden new file mode 100644 index 00000000..1e0de33d --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2xx-adr-syn.golden b/plugin/test/gold/810/cos-2xx-adr-syn.golden new file mode 100644 index 00000000..9bfa5d2a --- /dev/null +++ b/plugin/test/gold/810/cos-2xx-adr-syn.golden @@ -0,0 +1,215 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2xx-dot.golden b/plugin/test/gold/810/cos-2xx-dot.golden new file mode 100644 index 00000000..ab90b5f5 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2xx-gradr-dot.golden b/plugin/test/gold/810/cos-2xx-gradr-dot.golden new file mode 100644 index 00000000..a2b56205 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-2xx-gradr-syn.golden b/plugin/test/gold/810/cos-2xx-gradr-syn.golden new file mode 100644 index 00000000..6f8fccac --- /dev/null +++ b/plugin/test/gold/810/cos-2xx-gradr-syn.golden @@ -0,0 +1,217 @@ +((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 *** + abst . abst . curry mulC . exl) . + 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 *** + abst . abst . curry mulC . exl) . + 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 . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . + dup . exl . exl) . + dup) *** + ((id *** abst . abst . curry exr) . dup) . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/cos-2xx-syn.golden b/plugin/test/gold/810/cos-2xx-syn.golden new file mode 100644 index 00000000..6c236aa2 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-adf-dot.golden b/plugin/test/gold/810/cos-adf-dot.golden new file mode 100644 index 00000000..1b4deacf --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-adf-syn.golden b/plugin/test/gold/810/cos-adf-syn.golden new file mode 100644 index 00000000..1adb5632 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-adr-dot.golden b/plugin/test/gold/810/cos-adr-dot.golden new file mode 100644 index 00000000..52707dac --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-adr-syn.golden b/plugin/test/gold/810/cos-adr-syn.golden new file mode 100644 index 00000000..1d1eac29 --- /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/plugin/test/gold/810/cos-gradr-dot.golden b/plugin/test/gold/810/cos-gradr-dot.golden new file mode 100644 index 00000000..bec73cbf --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-gradr-syn.golden b/plugin/test/gold/810/cos-gradr-syn.golden new file mode 100644 index 00000000..09230108 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-xpy-adf-dot.golden b/plugin/test/gold/810/cos-xpy-adf-dot.golden new file mode 100644 index 00000000..74a1e5f7 --- /dev/null +++ b/plugin/test/gold/810/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_81 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c78 [label="{{|}|\|{}}"] + c77 [label="{{|}|+|{}}"] + c76 [label="{In|{|}}"] + c80 [label="{{}|Out}"] + c79 [label="{{}|negate|{}}"] + c44:Out0 -> c78:In0 [label="Double"] + c77:Out0 -> c78:In1 [label="Double"] + c76:Out0 -> c77:In0 [label="Double"] + c76:Out1 -> c77:In1 [label="Double"] + c79:Out0 -> c80:In0 [label="Double"] + c78:Out0 -> c79:In0 [label="Double"] + } + subgraph clusterc82 { label=""; color=white; margin=0; c82 [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 -> c82:In0 [label="Double"] + c80 -> c82:In1 [ltail=cluster_81,label="Double Double Double"] +} diff --git a/plugin/test/gold/810/cos-xpy-adf-syn.golden b/plugin/test/gold/810/cos-xpy-adf-syn.golden new file mode 100644 index 00000000..aae5d2cb --- /dev/null +++ b/plugin/test/gold/810/cos-xpy-adf-syn.golden @@ -0,0 +1,18 @@ +second (id . repr) . +apply . +((curry + ((exr *** + apply . + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry + (curry (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . + abst . + curry mulC . apply . (curry exl . negateC . sinC . exl *** exr) . dup *** + abst . curry (addC . exr)) . + dup) . + dup) *** + cosC) . + dup) . +addC \ No newline at end of file diff --git a/plugin/test/gold/810/cos-xpy-adr-dot.golden b/plugin/test/gold/810/cos-xpy-adr-dot.golden new file mode 100644 index 00000000..7b42f75d --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-xpy-adr-syn.golden b/plugin/test/gold/810/cos-xpy-adr-syn.golden new file mode 100644 index 00000000..14d7164a --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-xpy-gradr-dot.golden b/plugin/test/gold/810/cos-xpy-gradr-dot.golden new file mode 100644 index 00000000..0128caf2 --- /dev/null +++ b/plugin/test/gold/810/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/810/cos-xpy-gradr-syn.golden b/plugin/test/gold/810/cos-xpy-gradr-syn.golden new file mode 100644 index 00000000..2d5985c7 --- /dev/null +++ b/plugin/test/gold/810/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/810/cosSinProd-dot.golden b/plugin/test/gold/810/cosSinProd-dot.golden new file mode 100644 index 00000000..3cf075e6 --- /dev/null +++ b/plugin/test/gold/810/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/810/cosSinProd-syn.golden b/plugin/test/gold/810/cosSinProd-syn.golden new file mode 100644 index 00000000..7b951500 --- /dev/null +++ b/plugin/test/gold/810/cosSinProd-syn.golden @@ -0,0 +1 @@ +((cosC *** sinC) . dup) . mulC \ No newline at end of file diff --git a/plugin/test/gold/810/dup-dot.golden b/plugin/test/gold/810/dup-dot.golden new file mode 100644 index 00000000..ed6525c8 --- /dev/null +++ b/plugin/test/gold/810/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/810/dup-syn.golden b/plugin/test/gold/810/dup-syn.golden new file mode 100644 index 00000000..5d487a85 --- /dev/null +++ b/plugin/test/gold/810/dup-syn.golden @@ -0,0 +1 @@ +dup \ No newline at end of file diff --git a/plugin/test/gold/810/fst-dot.golden b/plugin/test/gold/810/fst-dot.golden new file mode 100644 index 00000000..01f192d8 --- /dev/null +++ b/plugin/test/gold/810/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/810/fst-syn.golden b/plugin/test/gold/810/fst-syn.golden new file mode 100644 index 00000000..438c6f21 --- /dev/null +++ b/plugin/test/gold/810/fst-syn.golden @@ -0,0 +1 @@ +exl \ No newline at end of file diff --git a/plugin/test/gold/810/horner-dot.golden b/plugin/test/gold/810/horner-dot.golden new file mode 100644 index 00000000..4c99cd78 --- /dev/null +++ b/plugin/test/gold/810/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/810/horner-syn.golden b/plugin/test/gold/810/horner-syn.golden new file mode 100644 index 00000000..dc3a8396 --- /dev/null +++ b/plugin/test/gold/810/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/810/log-2xx-dot.golden b/plugin/test/gold/810/log-2xx-dot.golden new file mode 100644 index 00000000..1e8454d6 --- /dev/null +++ b/plugin/test/gold/810/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/810/log-2xx-syn.golden b/plugin/test/gold/810/log-2xx-syn.golden new file mode 100644 index 00000000..58d8e5c2 --- /dev/null +++ b/plugin/test/gold/810/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/810/magSqr-adf-dot.golden b/plugin/test/gold/810/magSqr-adf-dot.golden new file mode 100644 index 00000000..cde2bc2f --- /dev/null +++ b/plugin/test/gold/810/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 clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } + subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } + subgraph clusterc770 { label=""; color=white; margin=0; c770 [label="{{|}|+|{}}"] } + subgraph cluster_778 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c772 [label="{{|}|\|{}}"] + c774 [label="{{|}|\|{}}"] + c773 [label="{{|}|+|{}}"] + c776 [label="{{|}|+|{}}"] + c775 [label="{{|}|+|{}}"] + c771 [label="{In|{|}}"] + c777 [label="{{}|Out}"] + c0:Out0 -> c772:In0 [label="Double"] + c771:Out0 -> c772:In1 [label="Double"] + c0:Out1 -> c774:In0 [label="Double"] + c771:Out1 -> c774:In1 [label="Double"] + c772:Out0 -> c773:In0 [label="Double"] + c772:Out0 -> c773:In1 [label="Double"] + c773:Out0 -> c776:In0 [label="Double"] + c775:Out0 -> c776:In1 [label="Double"] + c774:Out0 -> c775:In0 [label="Double"] + c774:Out0 -> c775:In1 [label="Double"] + c776:Out0 -> c777:In0 [label="Double"] + } + subgraph clusterc779 { label=""; color=white; margin=0; c779 [label="{{|}|Out}"] } + c0:Out1 -> c401:In0 [label="Double"] + c0:Out1 -> c401:In1 [label="Double"] + c0:Out0 -> c638:In0 [label="Double"] + c0:Out0 -> c638:In1 [label="Double"] + c401:Out0 -> c770:In0 [label="Double"] + c638:Out0 -> c770:In1 [label="Double"] + c770:Out0 -> c779:In0 [label="Double"] + c777 -> c779:In1 [ltail=cluster_778,label="Double Double Double"] +} diff --git a/plugin/test/gold/810/magSqr-adf-syn.golden b/plugin/test/gold/810/magSqr-adf-syn.golden new file mode 100644 index 00000000..b40ce23d --- /dev/null +++ b/plugin/test/gold/810/magSqr-adf-syn.golden @@ -0,0 +1,163 @@ +second (id . repr) . +((addC . exl *** abst . curry (addC . apply) . repr . exr) . 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 *** + abst . curry mulC . exl) . + 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) *** + ((exl *** abst . curry (exl . exr)) . dup) . exl . exl) . + dup) *** + ((exl *** abst . curry (exl . exr)) . dup) . exr) . + dup) . + dup . exl . 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 *** + abst . curry mulC . exl) . + 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) *** + ((exr *** abst . curry (exr . exr)) . dup) . exl . exl) . + dup) *** + ((exr *** abst . curry (exr . exr)) . dup) . exr) . + dup) . + dup . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/magSqr-adr-dot.golden b/plugin/test/gold/810/magSqr-adr-dot.golden new file mode 100644 index 00000000..6d43a27d --- /dev/null +++ b/plugin/test/gold/810/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 clusterc704 { label=""; color=white; margin=0; c704 [label="{{|}|\|{}}"] } + subgraph clusterc1130 { label=""; color=white; margin=0; c1130 [label="{{|}|\|{}}"] } + subgraph clusterc1440 { label=""; color=white; margin=0; c1440 [label="{{|}|+|{}}"] } + subgraph cluster_1498 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c1492 [label="{{|}|\|{}}"] + c1495 [label="{{|}|\|{}}"] + c1494 [label="{{|}|+|{}}"] + c1496 [label="{{|}|+|{}}"] + c1491 [label="{In|{}}"] + c1497 [label="{{|}|Out}"] + c0:Out0 -> c1492:In0 [label="Double"] + c1491:Out0 -> c1492:In1 [label="Double"] + c0:Out1 -> c1495:In0 [label="Double"] + c1491:Out0 -> c1495:In1 [label="Double"] + c1492:Out0 -> c1494:In0 [label="Double"] + c1492:Out0 -> c1494:In1 [label="Double"] + c1495:Out0 -> c1496:In0 [label="Double"] + c1495:Out0 -> c1496:In1 [label="Double"] + c1494:Out0 -> c1497:In0 [label="Double"] + c1496:Out0 -> c1497:In1 [label="Double"] + } + subgraph clusterc1499 { label=""; color=white; margin=0; c1499 [label="{{|}|Out}"] } + c0:Out1 -> c704:In0 [label="Double"] + c0:Out1 -> c704:In1 [label="Double"] + c0:Out0 -> c1130:In0 [label="Double"] + c0:Out0 -> c1130:In1 [label="Double"] + c704:Out0 -> c1440:In0 [label="Double"] + c1130:Out0 -> c1440:In1 [label="Double"] + c1440:Out0 -> c1499:In0 [label="Double"] + c1497 -> c1499:In1 [ltail=cluster_1498,label="Double Double Double"] +} diff --git a/plugin/test/gold/810/magSqr-adr-syn.golden b/plugin/test/gold/810/magSqr-adr-syn.golden new file mode 100644 index 00000000..dcd75cf3 --- /dev/null +++ b/plugin/test/gold/810/magSqr-adr-syn.golden @@ -0,0 +1,264 @@ +((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) . +((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) *** + 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exl . 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/magSqr-dot.golden b/plugin/test/gold/810/magSqr-dot.golden new file mode 100644 index 00000000..6beba561 --- /dev/null +++ b/plugin/test/gold/810/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/810/magSqr-gradr-dot.golden b/plugin/test/gold/810/magSqr-gradr-dot.golden new file mode 100644 index 00000000..024b9931 --- /dev/null +++ b/plugin/test/gold/810/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|{|}}"] + c704 [label="{{|}|\|{}}"] + c1130 [label="{{|}|\|{}}"] + c1440 [label="{{|}|+|{}}"] + c1501 [label="{{|}|+|{}}"] + c1502 [label="{{|}|+|{}}"] + c1503 [label="{{||}|Out}"] + c0:Out1 -> c704:In0 [label="Double"] + c0:Out1 -> c704:In1 [label="Double"] + c0:Out0 -> c1130:In0 [label="Double"] + c0:Out0 -> c1130:In1 [label="Double"] + c704:Out0 -> c1440:In0 [label="Double"] + c1130:Out0 -> c1440:In1 [label="Double"] + c0:Out0 -> c1501:In0 [label="Double"] + c0:Out0 -> c1501:In1 [label="Double"] + c0:Out1 -> c1502:In0 [label="Double"] + c0:Out1 -> c1502:In1 [label="Double"] + c1440:Out0 -> c1503:In0 [label="Double"] + c1501:Out0 -> c1503:In1 [label="Double"] + c1502:Out0 -> c1503:In2 [label="Double"] +} diff --git a/plugin/test/gold/810/magSqr-gradr-syn.golden b/plugin/test/gold/810/magSqr-gradr-syn.golden new file mode 100644 index 00000000..1568a72c --- /dev/null +++ b/plugin/test/gold/810/magSqr-gradr-syn.golden @@ -0,0 +1,266 @@ +((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) . +((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) *** + 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exl . 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 *** + abst . abst . curry mulC . exl) . + 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 . (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 . exl) . + dup) *** + ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . + exr) . + dup) . + dup . exr) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/magSqr-syn.golden b/plugin/test/gold/810/magSqr-syn.golden new file mode 100644 index 00000000..28f26c2b --- /dev/null +++ b/plugin/test/gold/810/magSqr-syn.golden @@ -0,0 +1 @@ +addC . (mulC . (exl *** exl) . dup *** mulC . (exr *** exr) . dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/810/sin-adf-dot.golden b/plugin/test/gold/810/sin-adf-dot.golden new file mode 100644 index 00000000..412357d2 --- /dev/null +++ b/plugin/test/gold/810/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/810/sin-adf-syn.golden b/plugin/test/gold/810/sin-adf-syn.golden new file mode 100644 index 00000000..c8441093 --- /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/plugin/test/gold/810/sin-adr-dot.golden b/plugin/test/gold/810/sin-adr-dot.golden new file mode 100644 index 00000000..d017f0d9 --- /dev/null +++ b/plugin/test/gold/810/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/810/sin-adr-syn.golden b/plugin/test/gold/810/sin-adr-syn.golden new file mode 100644 index 00000000..23b07c29 --- /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/plugin/test/gold/810/sin-gradr-dot.golden b/plugin/test/gold/810/sin-gradr-dot.golden new file mode 100644 index 00000000..ec826a31 --- /dev/null +++ b/plugin/test/gold/810/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/810/sin-gradr-syn.golden b/plugin/test/gold/810/sin-gradr-syn.golden new file mode 100644 index 00000000..16dcf219 --- /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/plugin/test/gold/810/sqr-adf-dot.golden b/plugin/test/gold/810/sqr-adf-dot.golden new file mode 100644 index 00000000..633d3eaa --- /dev/null +++ b/plugin/test/gold/810/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 clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|\|{}}"] } + subgraph cluster_78 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c75 [label="{{|}|\|{}}"] + c76 [label="{{|}|+|{}}"] + c74 [label="{In|{}}"] + c77 [label="{{}|Out}"] + c0:Out0 -> c75:In0 [label="Double"] + c74:Out0 -> c75:In1 [label="Double"] + c75:Out0 -> c76:In0 [label="Double"] + c75:Out0 -> c76:In1 [label="Double"] + c76:Out0 -> c77:In0 [label="Double"] + } + subgraph clusterc79 { label=""; color=white; margin=0; c79 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c79:In0 [label="Double"] + c77 -> c79:In1 [ltail=cluster_78,label="Double Double"] +} diff --git a/plugin/test/gold/810/sqr-adf-syn.golden b/plugin/test/gold/810/sqr-adf-syn.golden new file mode 100644 index 00000000..e827d0b5 --- /dev/null +++ b/plugin/test/gold/810/sqr-adf-syn.golden @@ -0,0 +1,30 @@ +second (id . repr) . +((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) . +((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 *** + abst . curry mulC . exl) . + dup) . + dup) . +dup \ No newline at end of file diff --git a/plugin/test/gold/810/sqr-adr-dot.golden b/plugin/test/gold/810/sqr-adr-dot.golden new file mode 100644 index 00000000..4993f8d9 --- /dev/null +++ b/plugin/test/gold/810/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/810/sqr-adr-syn.golden b/plugin/test/gold/810/sqr-adr-syn.golden new file mode 100644 index 00000000..f052bad5 --- /dev/null +++ b/plugin/test/gold/810/sqr-adr-syn.golden @@ -0,0 +1,52 @@ +((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 *** + abst . abst . curry mulC . exl) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/810/sqr-dot.golden b/plugin/test/gold/810/sqr-dot.golden new file mode 100644 index 00000000..a9f70b53 --- /dev/null +++ b/plugin/test/gold/810/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/810/sqr-gradr-dot.golden b/plugin/test/gold/810/sqr-gradr-dot.golden new file mode 100644 index 00000000..5980b83c --- /dev/null +++ b/plugin/test/gold/810/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/810/sqr-gradr-syn.golden b/plugin/test/gold/810/sqr-gradr-syn.golden new file mode 100644 index 00000000..6ada6a56 --- /dev/null +++ b/plugin/test/gold/810/sqr-gradr-syn.golden @@ -0,0 +1,54 @@ +((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 *** + abst . abst . curry mulC . exl) . + dup) . + dup) . + exl) . + dup) . +(dup *** abst . abst . curry (addC . exr)) . dup \ No newline at end of file diff --git a/plugin/test/gold/810/sqr-syn.golden b/plugin/test/gold/810/sqr-syn.golden new file mode 100644 index 00000000..71c93dc1 --- /dev/null +++ b/plugin/test/gold/810/sqr-syn.golden @@ -0,0 +1 @@ +mulC . dup \ No newline at end of file diff --git a/plugin/test/gold/810/twice-adf-dot.golden b/plugin/test/gold/810/twice-adf-dot.golden new file mode 100644 index 00000000..a9abe573 --- /dev/null +++ b/plugin/test/gold/810/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 clusterc1 { label=""; color=white; margin=0; c1 [label="{{|}|+|{}}"] } + subgraph cluster_8 { + margin=8 + fontsize=20 + labeljust=r + color=DarkGreen + c6 [label="{{|}|+|{}}"] + c5 [label="{In|{}}"] + c7 [label="{{}|Out}"] + c5:Out0 -> c6:In0 [label="Double"] + c5:Out0 -> c6:In1 [label="Double"] + c6:Out0 -> c7:In0 [label="Double"] + } + subgraph clusterc9 { label=""; color=white; margin=0; c9 [label="{{|}|Out}"] } + c0:Out0 -> c1:In0 [label="Double"] + c0:Out0 -> c1:In1 [label="Double"] + c1:Out0 -> c9:In0 [label="Double"] + c7 -> c9:In1 [ltail=cluster_8,label="Double Double"] +} 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 00000000..8e8d72ec --- /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/plugin/test/gold/810/twice-adr-dot.golden b/plugin/test/gold/810/twice-adr-dot.golden new file mode 100644 index 00000000..632b5f13 --- /dev/null +++ b/plugin/test/gold/810/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/810/twice-adr-syn.golden b/plugin/test/gold/810/twice-adr-syn.golden new file mode 100644 index 00000000..52e2873c --- /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/plugin/test/gold/810/twice-dot.golden b/plugin/test/gold/810/twice-dot.golden new file mode 100644 index 00000000..8286b1b8 --- /dev/null +++ b/plugin/test/gold/810/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/810/twice-gradr-dot.golden b/plugin/test/gold/810/twice-gradr-dot.golden new file mode 100644 index 00000000..6c7b1b39 --- /dev/null +++ b/plugin/test/gold/810/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/810/twice-gradr-syn.golden b/plugin/test/gold/810/twice-gradr-syn.golden new file mode 100644 index 00000000..feaa5c50 --- /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/plugin/test/gold/810/twice-syn.golden b/plugin/test/gold/810/twice-syn.golden new file mode 100644 index 00000000..9242c719 --- /dev/null +++ b/plugin/test/gold/810/twice-syn.golden @@ -0,0 +1 @@ +addC . dup \ No newline at end of file diff --git a/plugin/test/gold/810/xp3y-dot.golden b/plugin/test/gold/810/xp3y-dot.golden new file mode 100644 index 00000000..2da92fbf --- /dev/null +++ b/plugin/test/gold/810/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/810/xp3y-syn.golden b/plugin/test/gold/810/xp3y-syn.golden new file mode 100644 index 00000000..0b0fd1bd --- /dev/null +++ b/plugin/test/gold/810/xp3y-syn.golden @@ -0,0 +1 @@ +addC . (exl *** mulC . (const 3.0 *** exr) . dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/complex-mul-syn.golden b/plugin/test/gold/900/complex-mul-syn.golden index b33ab087..77b77100 100644 --- a/plugin/test/gold/900/complex-mul-syn.golden +++ b/plugin/test/gold/900/complex-mul-syn.golden @@ -10,7 +10,8 @@ apply . mulC . (exr . exr . exl *** exl . exr) . dup) . dup) . dup) . - ((id *** repr . exr . exl) . dup) . (id *** repr . exl) . 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-syn.golden b/plugin/test/gold/900/cos-2x-adf-syn.golden index 021a8b37..1a093f26 100644 --- a/plugin/test/gold/900/cos-2x-adf-syn.golden +++ b/plugin/test/gold/900/cos-2x-adf-syn.golden @@ -35,20 +35,21 @@ apply . dup) *** ((mulC *** apply . - (curry - (abst . - curry (addC . apply) . - apply . - (curry + ((curry + (abst . + curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -80,8 +81,8 @@ apply . exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2x-adr-syn.golden b/plugin/test/gold/900/cos-2x-adr-syn.golden index f6691e42..bbe23cf1 100644 --- a/plugin/test/gold/900/cos-2x-adr-syn.golden +++ b/plugin/test/gold/900/cos-2x-adr-syn.golden @@ -51,30 +51,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -118,8 +119,8 @@ apply . abst . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2x-gradr-syn.golden b/plugin/test/gold/900/cos-2x-gradr-syn.golden index b96057f3..0393e913 100644 --- a/plugin/test/gold/900/cos-2x-gradr-syn.golden +++ b/plugin/test/gold/900/cos-2x-gradr-syn.golden @@ -53,30 +53,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -120,8 +121,8 @@ apply . abst . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-adf-syn.golden b/plugin/test/gold/900/cos-2xx-adf-syn.golden index 0b7319df..e4689af7 100644 --- a/plugin/test/gold/900/cos-2xx-adf-syn.golden +++ b/plugin/test/gold/900/cos-2xx-adf-syn.golden @@ -35,20 +35,21 @@ apply . dup) *** ((mulC *** apply . - (curry - (abst . - curry (addC . apply) . - apply . - (curry + ((curry + (abst . + curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -95,20 +96,21 @@ apply . dup) *** ((mulC *** apply . - (curry - (abst . - curry (addC . apply) . - apply . - (curry + ((curry + (abst . + curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -141,12 +143,13 @@ apply . exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . + exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-adr-syn.golden b/plugin/test/gold/900/cos-2xx-adr-syn.golden index 9bfa5d2a..af35a5df 100644 --- a/plugin/test/gold/900/cos-2xx-adr-syn.golden +++ b/plugin/test/gold/900/cos-2xx-adr-syn.golden @@ -51,30 +51,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -135,30 +136,32 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -204,12 +207,12 @@ apply . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/900/cos-2xx-gradr-syn.golden b/plugin/test/gold/900/cos-2xx-gradr-syn.golden index 6f8fccac..01de18c1 100644 --- a/plugin/test/gold/900/cos-2xx-gradr-syn.golden +++ b/plugin/test/gold/900/cos-2xx-gradr-syn.golden @@ -53,30 +53,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -137,30 +138,32 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -206,12 +209,12 @@ apply . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . 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 index fd901411..f9b3fa46 100644 --- a/plugin/test/gold/900/magSqr-adf-dot.golden +++ b/plugin/test/gold/900/magSqr-adf-dot.golden @@ -7,40 +7,40 @@ digraph magSqr_adf { bgcolor=transparent nslimit=20 subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } - subgraph clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } - subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } - subgraph clusterc797 { label=""; color=white; margin=0; c797 [label="{{|}|+|{}}"] } - subgraph cluster_825 { + 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 - c819 [label="{{|}|\|{}}"] - c821 [label="{{|}|\|{}}"] - c820 [label="{{|}|+|{}}"] - c823 [label="{{|}|+|{}}"] - c822 [label="{{|}|+|{}}"] - c818 [label="{In|{|}}"] - c824 [label="{{}|Out}"] - c0:Out0 -> c819:In0 [label="Double"] - c818:Out0 -> c819:In1 [label="Double"] - c0:Out1 -> c821:In0 [label="Double"] - c818:Out1 -> c821:In1 [label="Double"] - c819:Out0 -> c820:In0 [label="Double"] - c819:Out0 -> c820:In1 [label="Double"] - c820:Out0 -> c823:In0 [label="Double"] - c822:Out0 -> c823:In1 [label="Double"] - c821:Out0 -> c822:In0 [label="Double"] - c821:Out0 -> c822:In1 [label="Double"] - c823:Out0 -> c824:In0 [label="Double"] + 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 clusterc826 { label=""; color=white; margin=0; c826 [label="{{|}|Out}"] } - c0:Out1 -> c401:In0 [label="Double"] - c0:Out1 -> c401:In1 [label="Double"] - c0:Out0 -> c638:In0 [label="Double"] - c0:Out0 -> c638:In1 [label="Double"] - c401:Out0 -> c797:In0 [label="Double"] - c638:Out0 -> c797:In1 [label="Double"] - c797:Out0 -> c826:In0 [label="Double"] - c824 -> c826:In1 [ltail=cluster_825,label="Double Double 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 index 9dd98c54..519a449e 100644 --- a/plugin/test/gold/900/magSqr-adf-syn.golden +++ b/plugin/test/gold/900/magSqr-adf-syn.golden @@ -13,164 +13,211 @@ apply . dup) *** ((addC *** abst . curry (addC . exr)) . 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) *** + ((exl . exr *** apply . - ((curry - ((exl . exr *** + (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 *** apply . (exr . exl *** exr) . dup) . dup)) . + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . repr . exr . exr *** - exr . exl) . + exr . exr . exl) . dup) . dup) *** - ((mulC *** - apply . - (curry - (abst . - curry (addC . apply) . + apply . + ((curry + ((exl . exr *** apply . - (curry + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . dup) . - abst . curry mulC . exr *** - abst . curry mulC . 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) . - 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 *** + ((curry + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . repr . exr . exr *** - exr . exr . exl) . + exr . exl) . dup) . dup) *** - ((exl *** abst . curry (exl . exr)) . dup) . exl . exl) . - dup) *** - ((exl *** abst . curry (exl . exr)) . dup) . exr) . - dup) . - dup . exl . 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) . + ((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) *** - ((mulC *** - apply . - (curry - (abst . - curry (addC . apply) . + apply . + ((curry + ((exl . exr *** apply . - (curry + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . + (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) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . - dup) . + dup) . + exl) . 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 *** + ((curry + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . repr . exr . exr *** - exr . exr . exl) . + exr . exl) . dup) . dup) *** - ((exr *** abst . curry (exr . exr)) . dup) . exl . exl) . - dup) *** - ((exr *** abst . curry (exr . exr)) . dup) . exr) . + ((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) . - dup . exr) . + ((id *** dup) . dup) . exl) . dup) . -dup \ No newline at end of file +(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 index 6d43a27d..235748b0 100644 --- a/plugin/test/gold/900/magSqr-adr-dot.golden +++ b/plugin/test/gold/900/magSqr-adr-dot.golden @@ -7,38 +7,38 @@ digraph magSqr_adr { bgcolor=transparent nslimit=20 subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } - subgraph clusterc704 { label=""; color=white; margin=0; c704 [label="{{|}|\|{}}"] } - subgraph clusterc1130 { label=""; color=white; margin=0; c1130 [label="{{|}|\|{}}"] } - subgraph clusterc1440 { label=""; color=white; margin=0; c1440 [label="{{|}|+|{}}"] } - subgraph cluster_1498 { + 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 - c1492 [label="{{|}|\|{}}"] - c1495 [label="{{|}|\|{}}"] - c1494 [label="{{|}|+|{}}"] - c1496 [label="{{|}|+|{}}"] - c1491 [label="{In|{}}"] - c1497 [label="{{|}|Out}"] - c0:Out0 -> c1492:In0 [label="Double"] - c1491:Out0 -> c1492:In1 [label="Double"] - c0:Out1 -> c1495:In0 [label="Double"] - c1491:Out0 -> c1495:In1 [label="Double"] - c1492:Out0 -> c1494:In0 [label="Double"] - c1492:Out0 -> c1494:In1 [label="Double"] - c1495:Out0 -> c1496:In0 [label="Double"] - c1495:Out0 -> c1496:In1 [label="Double"] - c1494:Out0 -> c1497:In0 [label="Double"] - c1496:Out0 -> c1497:In1 [label="Double"] + 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 clusterc1499 { label=""; color=white; margin=0; c1499 [label="{{|}|Out}"] } - c0:Out1 -> c704:In0 [label="Double"] - c0:Out1 -> c704:In1 [label="Double"] - c0:Out0 -> c1130:In0 [label="Double"] - c0:Out0 -> c1130:In1 [label="Double"] - c704:Out0 -> c1440:In0 [label="Double"] - c1130:Out0 -> c1440:In1 [label="Double"] - c1440:Out0 -> c1499:In0 [label="Double"] - c1497 -> c1499:In1 [ltail=cluster_1498,label="Double Double 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 index dcd75cf3..ff7eee66 100644 --- a/plugin/test/gold/900/magSqr-adr-syn.golden +++ b/plugin/test/gold/900/magSqr-adr-syn.golden @@ -21,46 +21,203 @@ apply . dup) *** ((addC *** abst . abst . curry (dup . exr)) . 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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . - coerce . + 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 *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . repr . exr . exr *** - exr . exr . exl) . + (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 @@ -83,182 +240,121 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (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) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . dup) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . - dup) . - exl . exl) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . - exr) . - dup) . - dup . exl . 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) . + exr . exr *** + exr . exl) . dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((mulC *** - apply . - (curry - (abst . + dup) *** + ((exl *** 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)) . + (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) . - abst . abst . curry mulC . exr *** - abst . abst . curry mulC . exl) . - 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 . (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 + apply . + ((curry + (apply . (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 . exl) . - dup) *** - ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . - exr) . + (((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) . - dup . exr) . + ((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-gradr-dot.golden b/plugin/test/gold/900/magSqr-gradr-dot.golden index 024b9931..54141195 100644 --- a/plugin/test/gold/900/magSqr-gradr-dot.golden +++ b/plugin/test/gold/900/magSqr-gradr-dot.golden @@ -7,23 +7,23 @@ digraph magSqr_gradr { bgcolor=transparent nslimit=20 c0 [label="{In|{|}}"] - c704 [label="{{|}|\|{}}"] - c1130 [label="{{|}|\|{}}"] - c1440 [label="{{|}|+|{}}"] - c1501 [label="{{|}|+|{}}"] - c1502 [label="{{|}|+|{}}"] - c1503 [label="{{||}|Out}"] - c0:Out1 -> c704:In0 [label="Double"] - c0:Out1 -> c704:In1 [label="Double"] - c0:Out0 -> c1130:In0 [label="Double"] - c0:Out0 -> c1130:In1 [label="Double"] - c704:Out0 -> c1440:In0 [label="Double"] - c1130:Out0 -> c1440:In1 [label="Double"] - c0:Out0 -> c1501:In0 [label="Double"] - c0:Out0 -> c1501:In1 [label="Double"] - c0:Out1 -> c1502:In0 [label="Double"] - c0:Out1 -> c1502:In1 [label="Double"] - c1440:Out0 -> c1503:In0 [label="Double"] - c1501:Out0 -> c1503:In1 [label="Double"] - c1502:Out0 -> c1503:In2 [label="Double"] + 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 index 1568a72c..21f5ca1a 100644 --- a/plugin/test/gold/900/magSqr-gradr-syn.golden +++ b/plugin/test/gold/900/magSqr-gradr-syn.golden @@ -23,46 +23,203 @@ apply . dup) *** ((addC *** abst . abst . curry (dup . exr)) . 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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . - coerce . + 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 *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . repr . exr . exr *** - exr . exr . exl) . + (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 @@ -85,182 +242,121 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (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) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . dup) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . - dup) . - exl . exl) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . - exr) . - dup) . - dup . exl . 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) . + exr . exr *** + exr . exl) . dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((mulC *** - apply . - (curry - (abst . + dup) *** + ((exl *** 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)) . + (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) . - abst . abst . curry mulC . exr *** - abst . abst . curry mulC . exl) . - 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 . (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 + apply . + ((curry + (apply . (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 . exl) . - dup) *** - ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . - exr) . + (((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) . - dup . exr) . + ((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 index 28f26c2b..3cbccedb 100644 --- a/plugin/test/gold/900/magSqr-syn.golden +++ b/plugin/test/gold/900/magSqr-syn.golden @@ -1 +1,4 @@ -addC . (mulC . (exl *** exl) . dup *** mulC . (exr *** exr) . dup) . dup \ No newline at end of file +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/sqr-adf-syn.golden b/plugin/test/gold/900/sqr-adf-syn.golden index 9af8f3e9..4ab7b6c6 100644 --- a/plugin/test/gold/900/sqr-adf-syn.golden +++ b/plugin/test/gold/900/sqr-adf-syn.golden @@ -13,20 +13,21 @@ apply . dup) *** ((mulC *** apply . - (curry - (abst . - curry (addC . apply) . - apply . - (curry + ((curry + (abst . + curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/900/sqr-adr-syn.golden b/plugin/test/gold/900/sqr-adr-syn.golden index f052bad5..0edde29a 100644 --- a/plugin/test/gold/900/sqr-adr-syn.golden +++ b/plugin/test/gold/900/sqr-adr-syn.golden @@ -21,30 +21,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/900/sqr-gradr-syn.golden b/plugin/test/gold/900/sqr-gradr-syn.golden index 6ada6a56..45ecdc00 100644 --- a/plugin/test/gold/900/sqr-gradr-syn.golden +++ b/plugin/test/gold/900/sqr-gradr-syn.golden @@ -23,30 +23,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/900/xp3y-syn.golden b/plugin/test/gold/900/xp3y-syn.golden index 0b0fd1bd..17158c9b 100644 --- a/plugin/test/gold/900/xp3y-syn.golden +++ b/plugin/test/gold/900/xp3y-syn.golden @@ -1 +1 @@ -addC . (exl *** mulC . (const 3.0 *** exr) . dup) . dup \ No newline at end of file +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/complex-mul-syn.golden b/plugin/test/gold/902/complex-mul-syn.golden index b33ab087..77b77100 100644 --- a/plugin/test/gold/902/complex-mul-syn.golden +++ b/plugin/test/gold/902/complex-mul-syn.golden @@ -10,7 +10,8 @@ apply . mulC . (exr . exr . exl *** exl . exr) . dup) . dup) . dup) . - ((id *** repr . exr . exl) . dup) . (id *** repr . exl) . 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-syn.golden b/plugin/test/gold/902/cos-2x-adf-syn.golden index 2e7e4cc5..87e4f3b0 100644 --- a/plugin/test/gold/902/cos-2x-adf-syn.golden +++ b/plugin/test/gold/902/cos-2x-adf-syn.golden @@ -35,20 +35,21 @@ apply . dup) *** ((mulC *** apply . - (coerce . - curry - (curry (addC . apply) . - apply . - (curry + ((coerce . + curry + (curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -80,8 +81,8 @@ apply . exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2x-adr-syn.golden b/plugin/test/gold/902/cos-2x-adr-syn.golden index f6691e42..bbe23cf1 100644 --- a/plugin/test/gold/902/cos-2x-adr-syn.golden +++ b/plugin/test/gold/902/cos-2x-adr-syn.golden @@ -51,30 +51,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -118,8 +119,8 @@ apply . abst . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2x-gradr-syn.golden b/plugin/test/gold/902/cos-2x-gradr-syn.golden index b96057f3..0393e913 100644 --- a/plugin/test/gold/902/cos-2x-gradr-syn.golden +++ b/plugin/test/gold/902/cos-2x-gradr-syn.golden @@ -53,30 +53,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -120,8 +121,8 @@ apply . abst . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-adf-syn.golden b/plugin/test/gold/902/cos-2xx-adf-syn.golden index 1f4e907b..8929d844 100644 --- a/plugin/test/gold/902/cos-2xx-adf-syn.golden +++ b/plugin/test/gold/902/cos-2xx-adf-syn.golden @@ -35,20 +35,21 @@ apply . dup) *** ((mulC *** apply . - (coerce . - curry - (curry (addC . apply) . - apply . - (curry + ((coerce . + curry + (curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -95,20 +96,21 @@ apply . dup) *** ((mulC *** apply . - (coerce . - curry - (curry (addC . apply) . - apply . - (curry + ((coerce . + curry + (curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . @@ -141,12 +143,13 @@ apply . exr . exr . exl) . dup) . dup) *** - ((const 2.0 *** abst . curry exl . const 0.0) . dup) . exl . exl) . + ((const 2.0 *** abst . curry exl . const 0.0) . dup) . + exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . curry exr) . dup) . exr) . + ((id *** abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-adr-syn.golden b/plugin/test/gold/902/cos-2xx-adr-syn.golden index 9bfa5d2a..af35a5df 100644 --- a/plugin/test/gold/902/cos-2xx-adr-syn.golden +++ b/plugin/test/gold/902/cos-2xx-adr-syn.golden @@ -51,30 +51,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -135,30 +136,32 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -204,12 +207,12 @@ apply . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . dup \ No newline at end of file diff --git a/plugin/test/gold/902/cos-2xx-gradr-syn.golden b/plugin/test/gold/902/cos-2xx-gradr-syn.golden index 6f8fccac..01de18c1 100644 --- a/plugin/test/gold/902/cos-2xx-gradr-syn.golden +++ b/plugin/test/gold/902/cos-2xx-gradr-syn.golden @@ -53,30 +53,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -137,30 +138,32 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . @@ -206,12 +209,12 @@ apply . abst . curry (const 0.0) . repr . abst . curry (const ()) . const 0.0) . dup) . - exl . exl) . + exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . - dup . exl . exl) . + ((id *** dup) . dup) . exl . exr . exl) . dup) *** - ((id *** abst . abst . curry exr) . dup) . exr) . + ((id *** abst . abst . curry exr) . dup) . exr . exr) . dup) . -dup \ No newline at end of file +(id *** dup) . 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 index 7b42f75d..011b30ba 100644 --- a/plugin/test/gold/902/cos-xpy-adr-dot.golden +++ b/plugin/test/gold/902/cos-xpy-adr-dot.golden @@ -7,29 +7,29 @@ digraph cos_xpy_adr { 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 { + 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 - 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"] + 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 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"] + 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 index 14d7164a..d9a84bd7 100644 --- a/plugin/test/gold/902/cos-xpy-adr-syn.golden +++ b/plugin/test/gold/902/cos-xpy-adr-syn.golden @@ -30,4 +30,58 @@ apply . dup) . exl) . dup) . -(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file +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 index 0128caf2..fb111970 100644 --- a/plugin/test/gold/902/cos-xpy-gradr-dot.golden +++ b/plugin/test/gold/902/cos-xpy-gradr-dot.golden @@ -7,17 +7,17 @@ digraph cos_xpy_gradr { 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"] + 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 index 2d5985c7..9746ee65 100644 --- a/plugin/test/gold/902/cos-xpy-gradr-syn.golden +++ b/plugin/test/gold/902/cos-xpy-gradr-syn.golden @@ -32,4 +32,58 @@ apply . dup) . exl) . dup) . -(addC *** abst . abst . curry (dup . exr)) . dup \ No newline at end of file +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-syn.golden b/plugin/test/gold/902/cosSinProd-syn.golden index 7b951500..acaddb2c 100644 --- a/plugin/test/gold/902/cosSinProd-syn.golden +++ b/plugin/test/gold/902/cosSinProd-syn.golden @@ -1 +1 @@ -((cosC *** sinC) . dup) . mulC \ No newline at end of file +((cosC *** sinC) . dup) . mulC . exr . 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 index fd901411..f9b3fa46 100644 --- a/plugin/test/gold/902/magSqr-adf-dot.golden +++ b/plugin/test/gold/902/magSqr-adf-dot.golden @@ -7,40 +7,40 @@ digraph magSqr_adf { bgcolor=transparent nslimit=20 subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } - subgraph clusterc401 { label=""; color=white; margin=0; c401 [label="{{|}|\|{}}"] } - subgraph clusterc638 { label=""; color=white; margin=0; c638 [label="{{|}|\|{}}"] } - subgraph clusterc797 { label=""; color=white; margin=0; c797 [label="{{|}|+|{}}"] } - subgraph cluster_825 { + 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 - c819 [label="{{|}|\|{}}"] - c821 [label="{{|}|\|{}}"] - c820 [label="{{|}|+|{}}"] - c823 [label="{{|}|+|{}}"] - c822 [label="{{|}|+|{}}"] - c818 [label="{In|{|}}"] - c824 [label="{{}|Out}"] - c0:Out0 -> c819:In0 [label="Double"] - c818:Out0 -> c819:In1 [label="Double"] - c0:Out1 -> c821:In0 [label="Double"] - c818:Out1 -> c821:In1 [label="Double"] - c819:Out0 -> c820:In0 [label="Double"] - c819:Out0 -> c820:In1 [label="Double"] - c820:Out0 -> c823:In0 [label="Double"] - c822:Out0 -> c823:In1 [label="Double"] - c821:Out0 -> c822:In0 [label="Double"] - c821:Out0 -> c822:In1 [label="Double"] - c823:Out0 -> c824:In0 [label="Double"] + 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 clusterc826 { label=""; color=white; margin=0; c826 [label="{{|}|Out}"] } - c0:Out1 -> c401:In0 [label="Double"] - c0:Out1 -> c401:In1 [label="Double"] - c0:Out0 -> c638:In0 [label="Double"] - c0:Out0 -> c638:In1 [label="Double"] - c401:Out0 -> c797:In0 [label="Double"] - c638:Out0 -> c797:In1 [label="Double"] - c797:Out0 -> c826:In0 [label="Double"] - c824 -> c826:In1 [ltail=cluster_825,label="Double Double 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 index 942a0826..6c16a256 100644 --- a/plugin/test/gold/902/magSqr-adf-syn.golden +++ b/plugin/test/gold/902/magSqr-adf-syn.golden @@ -13,164 +13,211 @@ apply . dup) *** ((addC *** abst . curry (addC . exr)) . 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) *** + ((exl . exr *** apply . - ((curry - ((exl . exr *** + (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 *** apply . (exr . exl *** exr) . dup) . dup)) . + ((apply . (exl . exl *** exl . exr) . dup *** + apply . (exr . exl *** exr . exr) . dup) . + dup)) . repr . exr . exr *** - exr . exl) . + exr . exr . exl) . dup) . dup) *** - ((mulC *** - apply . - (coerce . - curry - (curry (addC . apply) . + apply . + ((curry + ((exl . exr *** apply . - (curry + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . exr . exr *** + exr . exl) . dup) . - abst . curry mulC . exr *** - abst . curry mulC . 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) . - 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 *** + ((curry + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . repr . exr . exr *** - exr . exr . exl) . + exr . exl) . dup) . dup) *** - ((exl *** abst . curry (exl . exr)) . dup) . exl . exl) . - dup) *** - ((exl *** abst . curry (exl . exr)) . dup) . exr) . - dup) . - dup . exl . 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) . + ((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) *** - ((mulC *** - apply . - (coerce . - curry - (curry (addC . apply) . + apply . + ((curry + ((exl . exr *** apply . - (curry + (coerce . + curry (apply . (exl *** repr . exr) . dup) . + curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . + (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) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . - dup) . + dup) . + exl) . 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 *** + ((curry + ((exl . exr *** apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . curry (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . repr . exr . exr *** - exr . exr . exl) . + exr . exl) . dup) . dup) *** - ((exr *** abst . curry (exr . exr)) . dup) . exl . exl) . - dup) *** - ((exr *** abst . curry (exr . exr)) . dup) . exr) . + ((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) . - dup . exr) . + ((id *** dup) . dup) . exl) . dup) . -dup \ No newline at end of file +(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 index 6d43a27d..235748b0 100644 --- a/plugin/test/gold/902/magSqr-adr-dot.golden +++ b/plugin/test/gold/902/magSqr-adr-dot.golden @@ -7,38 +7,38 @@ digraph magSqr_adr { bgcolor=transparent nslimit=20 subgraph clusterc0 { label=""; color=white; margin=0; c0 [label="{In|{|}}"] } - subgraph clusterc704 { label=""; color=white; margin=0; c704 [label="{{|}|\|{}}"] } - subgraph clusterc1130 { label=""; color=white; margin=0; c1130 [label="{{|}|\|{}}"] } - subgraph clusterc1440 { label=""; color=white; margin=0; c1440 [label="{{|}|+|{}}"] } - subgraph cluster_1498 { + 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 - c1492 [label="{{|}|\|{}}"] - c1495 [label="{{|}|\|{}}"] - c1494 [label="{{|}|+|{}}"] - c1496 [label="{{|}|+|{}}"] - c1491 [label="{In|{}}"] - c1497 [label="{{|}|Out}"] - c0:Out0 -> c1492:In0 [label="Double"] - c1491:Out0 -> c1492:In1 [label="Double"] - c0:Out1 -> c1495:In0 [label="Double"] - c1491:Out0 -> c1495:In1 [label="Double"] - c1492:Out0 -> c1494:In0 [label="Double"] - c1492:Out0 -> c1494:In1 [label="Double"] - c1495:Out0 -> c1496:In0 [label="Double"] - c1495:Out0 -> c1496:In1 [label="Double"] - c1494:Out0 -> c1497:In0 [label="Double"] - c1496:Out0 -> c1497:In1 [label="Double"] + 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 clusterc1499 { label=""; color=white; margin=0; c1499 [label="{{|}|Out}"] } - c0:Out1 -> c704:In0 [label="Double"] - c0:Out1 -> c704:In1 [label="Double"] - c0:Out0 -> c1130:In0 [label="Double"] - c0:Out0 -> c1130:In1 [label="Double"] - c704:Out0 -> c1440:In0 [label="Double"] - c1130:Out0 -> c1440:In1 [label="Double"] - c1440:Out0 -> c1499:In0 [label="Double"] - c1497 -> c1499:In1 [ltail=cluster_1498,label="Double Double 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 index dcd75cf3..ff7eee66 100644 --- a/plugin/test/gold/902/magSqr-adr-syn.golden +++ b/plugin/test/gold/902/magSqr-adr-syn.golden @@ -21,46 +21,203 @@ apply . dup) *** ((addC *** abst . abst . curry (dup . exr)) . 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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . - coerce . + 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 *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . repr . exr . exr *** - exr . exr . exl) . + (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 @@ -83,182 +240,121 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (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) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . dup) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . - dup) . - exl . exl) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . - exr) . - dup) . - dup . exl . 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) . + exr . exr *** + exr . exl) . dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((mulC *** - apply . - (curry - (abst . + dup) *** + ((exl *** 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)) . + (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) . - abst . abst . curry mulC . exr *** - abst . abst . curry mulC . exl) . - 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 . (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 + apply . + ((curry + (apply . (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 . exl) . - dup) *** - ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . - exr) . + (((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) . - dup . exr) . + ((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-gradr-dot.golden b/plugin/test/gold/902/magSqr-gradr-dot.golden index 024b9931..54141195 100644 --- a/plugin/test/gold/902/magSqr-gradr-dot.golden +++ b/plugin/test/gold/902/magSqr-gradr-dot.golden @@ -7,23 +7,23 @@ digraph magSqr_gradr { bgcolor=transparent nslimit=20 c0 [label="{In|{|}}"] - c704 [label="{{|}|\|{}}"] - c1130 [label="{{|}|\|{}}"] - c1440 [label="{{|}|+|{}}"] - c1501 [label="{{|}|+|{}}"] - c1502 [label="{{|}|+|{}}"] - c1503 [label="{{||}|Out}"] - c0:Out1 -> c704:In0 [label="Double"] - c0:Out1 -> c704:In1 [label="Double"] - c0:Out0 -> c1130:In0 [label="Double"] - c0:Out0 -> c1130:In1 [label="Double"] - c704:Out0 -> c1440:In0 [label="Double"] - c1130:Out0 -> c1440:In1 [label="Double"] - c0:Out0 -> c1501:In0 [label="Double"] - c0:Out0 -> c1501:In1 [label="Double"] - c0:Out1 -> c1502:In0 [label="Double"] - c0:Out1 -> c1502:In1 [label="Double"] - c1440:Out0 -> c1503:In0 [label="Double"] - c1501:Out0 -> c1503:In1 [label="Double"] - c1502:Out0 -> c1503:In2 [label="Double"] + 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 index 1568a72c..21f5ca1a 100644 --- a/plugin/test/gold/902/magSqr-gradr-syn.golden +++ b/plugin/test/gold/902/magSqr-gradr-syn.golden @@ -23,46 +23,203 @@ apply . dup) *** ((addC *** abst . abst . curry (dup . exr)) . 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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (apply . (coerce . curry (apply . (exl *** repr . exr) . dup) . - coerce . + 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 *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . repr . exr . exr *** - exr . exr . exl) . + (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 @@ -85,182 +242,121 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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 . (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 . + ((exl . exr *** + apply . + (coerce . + curry + (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) . + (apply . (exl . exl *** apply . (exr . exl *** exr) . dup) . dup)) . + repr . repr . exr *** + repr . exl) . dup) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . - dup) . - exl . exl) . - dup) *** - ((exl *** abst . abst . curry (((id *** const 0.0) . dup) . exr)) . dup) . - exr) . - dup) . - dup . exl . 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) . + exr . exr *** + exr . exl) . dup) . - exr . exr *** - exr . exl) . - dup) . - dup) *** - ((mulC *** - apply . - (curry - (abst . + dup) *** + ((exl *** 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)) . + (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) . - abst . abst . curry mulC . exr *** - abst . abst . curry mulC . exl) . - 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 . (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 + apply . + ((curry + (apply . (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 . exl) . - dup) *** - ((exr *** abst . abst . curry (((const 0.0 *** id) . dup) . exr)) . dup) . - exr) . + (((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) . - dup . exr) . + ((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 index 28f26c2b..3cbccedb 100644 --- a/plugin/test/gold/902/magSqr-syn.golden +++ b/plugin/test/gold/902/magSqr-syn.golden @@ -1 +1,4 @@ -addC . (mulC . (exl *** exl) . dup *** mulC . (exr *** exr) . dup) . dup \ No newline at end of file +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/sqr-adf-syn.golden b/plugin/test/gold/902/sqr-adf-syn.golden index 4e0c3229..7780b5cf 100644 --- a/plugin/test/gold/902/sqr-adf-syn.golden +++ b/plugin/test/gold/902/sqr-adf-syn.golden @@ -13,20 +13,21 @@ apply . dup) *** ((mulC *** apply . - (coerce . - curry - (curry (addC . apply) . - apply . - (curry + ((coerce . + curry + (curry (addC . apply) . + apply . (curry - ((apply . (exl . exl *** exl . exr) . dup *** - apply . (exr . exl *** exr . exr) . dup) . - dup)) . - repr . exl *** - repr . exr) . - dup) . - abst . curry mulC . exr *** - abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/902/sqr-adr-syn.golden b/plugin/test/gold/902/sqr-adr-syn.golden index f052bad5..0edde29a 100644 --- a/plugin/test/gold/902/sqr-adr-syn.golden +++ b/plugin/test/gold/902/sqr-adr-syn.golden @@ -21,30 +21,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/902/sqr-gradr-syn.golden b/plugin/test/gold/902/sqr-gradr-syn.golden index 6ada6a56..45ecdc00 100644 --- a/plugin/test/gold/902/sqr-gradr-syn.golden +++ b/plugin/test/gold/902/sqr-gradr-syn.golden @@ -23,30 +23,31 @@ apply . 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 . + ((curry + (abst . 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 *** - abst . abst . curry mulC . exl) . + (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) . diff --git a/plugin/test/gold/902/xp3y-syn.golden b/plugin/test/gold/902/xp3y-syn.golden index 0b0fd1bd..17158c9b 100644 --- a/plugin/test/gold/902/xp3y-syn.golden +++ b/plugin/test/gold/902/xp3y-syn.golden @@ -1 +1 @@ -addC . (exl *** mulC . (const 3.0 *** exr) . dup) . dup \ No newline at end of file +addC . ((exl . exr *** mulC . (const 3.0 *** exr . exr) . dup) . dup) . dup \ No newline at end of file From a0f2aff0a3a9f6cd84e45ae9faa9e5525e9ecb51 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Wed, 1 Mar 2023 08:51:16 +0100 Subject: [PATCH 24/28] Turn misc-examples and misc-trace into executables ... rather than test suites, as that's what they are. Also, no sensible way to run these in CI. --- plugin/concat-plugin.cabal | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin/concat-plugin.cabal b/plugin/concat-plugin.cabal index 3665a57a..ab254884 100644 --- a/plugin/concat-plugin.cabal +++ b/plugin/concat-plugin.cabal @@ -51,8 +51,7 @@ library -- whole library gets recompiled. For now, duplicate the test-suite. See -- -Test-Suite misc-examples - type: exitcode-stdio-1.0 +Executable misc-examples default-language: Haskell98 hs-Source-Dirs: test main-is: Examples.hs @@ -80,8 +79,7 @@ Test-Suite misc-examples cpp-options: -DCONCAT_SMT cpp-options: -DVectorSized -Test-Suite misc-trace - type: exitcode-stdio-1.0 +Executable misc-trace default-language: Haskell98 hs-Source-Dirs: test main-is: Examples.hs From c920a3e027647e3a86bdbdc09741b9242b963a0f Mon Sep 17 00:00:00 2001 From: Ian-Woo Kim Date: Thu, 5 May 2022 16:20:03 -0700 Subject: [PATCH 25/28] use nix flakes providing overlay --- flake.lock | 43 +++++++++++++++ flake.nix | 116 ++++++++++++++++++++++++++++++++++++++++ parse-cabal-project.nix | 19 +++++++ 3 files changed, 178 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 parse-cabal-project.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..c0d28580 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1652020977, + "narHash": "sha256-9hDlNbrxzD/pLlXmoQ6gzxbYiSAKrj7uHYUWNByLFlI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3c5ae9be1f18c790ea890ef8decbd0946c0b4c04", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..fdc20e55 --- /dev/null +++ b/flake.nix @@ -0,0 +1,116 @@ +{ + description = "concat"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: + let + haskellLib = (import nixpkgs { inherit system; }).haskell.lib; + + excludedPackages = [ "concat-hardware" ]; + noHaddockPackages = + [ "concat-examples" "concat-inline" "concat-plugin" ]; + # need display, graphviz for testing. disable test for now. + noCheckPackages = [ "concat-graphics" "concat-plugin" ]; + + parseCabalProject = import ./parse-cabal-project.nix; + concatPackages = let parsed = parseCabalProject ./cabal.project; + in builtins.filter + ({ name, ... }: !(builtins.elem name excludedPackages)) parsed; + concatPackageNames = builtins.map ({ name, ... }: name) concatPackages; + + haskellOverlay = self: super: + builtins.listToAttrs (builtins.map ({ name, path }: { + inherit name; + value = let + p = self.callCabal2nix name (./. + "/${path}") { }; + p1 = if builtins.elem name noHaddockPackages then + haskellLib.dontHaddock p + else + p; + p2 = if builtins.elem name noCheckPackages then + haskellLib.dontCheck p1 + else + p1; + in p2; + }) concatPackages); + + # see these issues and discussions: + # - https://github.com/NixOS/nixpkgs/issues/16394 + # - https://github.com/NixOS/nixpkgs/issues/25887 + # - https://github.com/NixOS/nixpkgs/issues/26561 + # - https://discourse.nixos.org/t/nix-haskell-development-2020/6170 + fullOverlay = final: prev: { + haskellPackages = prev.haskellPackages.override (old: { + overrides = + final.lib.composeExtensions (old.overrides or (_: _: { })) + haskellOverlay; + }); + }; + in { + # This package set is only useful for CI build test. + # In practice, users will create a development environment composed by overlays. + packages = let + packagesOnGHC = ghcVer: + let + overlayGHC = final: prev: { + haskellPackages = prev.haskell.packages.${ghcVer}; + }; + + newPkgs = import nixpkgs { + overlays = [ overlayGHC fullOverlay ]; + inherit system; + }; + + individualPackages = builtins.listToAttrs (builtins.map + ({ name, ... }: { + name = ghcVer + "_" + name; + value = builtins.getAttr name newPkgs.haskellPackages; + }) concatPackages); + + allEnv = let + hsenv = newPkgs.haskellPackages.ghcWithPackages (p: + let + deps = + builtins.map ({ name, ... }: p.${name}) concatPackages; + in deps); + in newPkgs.buildEnv { + name = "all-packages"; + paths = [ hsenv ]; + }; + in individualPackages // { "${ghcVer}_all" = allEnv; }; + + in packagesOnGHC "ghc8107" // packagesOnGHC "ghc884" + // packagesOnGHC "ghc901" // packagesOnGHC "ghc921" + // packagesOnGHC "ghcHEAD"; + + overlay = fullOverlay; + + devShells = let + mkDevShell = ghcVer: + let + overlayGHC = final: prev: { + haskellPackages = prev.haskell.packages.${ghcVer}; + }; + + newPkgs = import nixpkgs { + overlays = [ overlayGHC fullOverlay ]; + inherit system; + }; + + in newPkgs.haskellPackages.shellFor { + packages = ps: builtins.map (name: ps.${name}) concatPackageNames; + buildInputs = [ newPkgs.haskellPackages.cabal-install ] ++ + # haskell-language-server on GHC 9.2.1 is broken yet. + newPkgs.lib.optional (ghcVer != "ghc921") + [ newPkgs.haskell-language-server ]; + withHoogle = false; + }; + in { + "ghc8107" = mkDevShell "ghc8107"; + "ghc921" = mkDevShell "ghc921"; + }; + }); +} diff --git a/parse-cabal-project.nix b/parse-cabal-project.nix new file mode 100644 index 00000000..3d9e73ff --- /dev/null +++ b/parse-cabal-project.nix @@ -0,0 +1,19 @@ +# Ideally, parsing cabal.project should be done via official tools +# Related discussion here: +# https://github.com/NixOS/cabal2nix/issues/286 + +cabalProject: +let + content = builtins.readFile cabalProject; + lines = builtins.filter builtins.isString (builtins.split '' + [ + ]'' content); + matches = + builtins.map (builtins.match "[[:space:]]*[.]/(.*)/(.*)[.]cabal$") lines; + projects = builtins.concatMap (match: + if builtins.isList match && builtins.length match == 2 then [{ + name = builtins.elemAt match 1; + path = builtins.elemAt match 0; + }] else + [ ]) matches; +in projects From dfa8372def4f9445b040bbb29eceb00d0a0d2993 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 1 Mar 2023 09:22:05 -0700 Subject: [PATCH 26/28] Convert some `test-suite`s to `executable`s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They really are – they don’t run tests, and are hard to use without human interaction. --- graphics/concat-graphics.cabal | 6 ++---- hardware/concat-hardware.cabal | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/graphics/concat-graphics.cabal b/graphics/concat-graphics.cabal index 98f6e015..fb4cd42c 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/hardware/concat-hardware.cabal b/hardware/concat-hardware.cabal index a7181bc6..2b274306 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 - From 6bbea8feaf4e0f0b2fa7a3cb095b36691aac5253 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Thu, 2 Mar 2023 08:12:11 -0700 Subject: [PATCH 27/28] Fix Haddock Mostly because Haddock thinks commented-out guards are docs. --- examples/src/ConCat/Circuit.hs | 8 ++-- inline/src/ConCat/Inline/Plugin.hs | 2 +- plugin/src/ConCat/Plugin.hs | 74 +++++++++++++++--------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/examples/src/ConCat/Circuit.hs b/examples/src/ConCat/Circuit.hs index f7566536..813bc2d5 100644 --- a/examples/src/ConCat/Circuit.hs +++ b/examples/src/ConCat/Circuit.hs @@ -359,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 @@ -367,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 @@ -532,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/inline/src/ConCat/Inline/Plugin.hs b/inline/src/ConCat/Inline/Plugin.hs index 444b66ec..90e25c4c 100644 --- a/inline/src/ConCat/Inline/Plugin.hs +++ b/inline/src/ConCat/Inline/Plugin.hs @@ -78,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) $ diff --git a/plugin/src/ConCat/Plugin.hs b/plugin/src/ConCat/Plugin.hs index 005c78e4..cebbd7c1 100644 --- a/plugin/src/ConCat/Plugin.hs +++ b/plugin/src/ConCat/Plugin.hs @@ -128,7 +128,7 @@ mkFunTy' = FunTy VisArg #endif #if !MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) -pattern Alt :: AltCon -> [b] -> (Expr b) -> (AltCon, [b], Expr b) +pattern Alt :: AltCon -> [b] -> (Expr b) -> (AltCon, [b], Expr b) pattern Alt con bs rhs = (con, bs, rhs) #endif @@ -248,7 +248,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- , 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) @@ -265,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") @@ -306,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 @@ -335,8 +335,8 @@ ccc (CccEnv {..}) (Ops {..}) cat = -- Then we can see further into the error. 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' + -- \| 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 @@ -372,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 @@ -397,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 @@ -438,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? @@ -589,7 +589,7 @@ ccc (CccEnv {..}) (Ops {..}) cat = 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 @@ -614,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 $ @@ -656,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") @@ -675,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' @@ -699,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 @@ -881,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) $ @@ -1030,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 @@ -1062,7 +1062,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. 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 @@ -1080,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 @@ -1208,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 @@ -1326,7 +1326,7 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. | 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` @@ -1395,13 +1395,13 @@ mkOps (CccEnv {..}) guts annotations famEnvs dflags inScope evTy ev cat = Ops {. pseudoAnns = findAnns deserializeWithData annotations . NamedTarget . varName #if MIN_VERSION_GLASGOW_HASKELL(9,2,0,0) optimizeCoercion = optCoercion (initOptCoercionOpts dflags) emptyTCvSubst -#else +#else optimizeCoercion = optCoercion dflags emptyTCvSubst -#endif +#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 @@ -1487,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 @@ -1597,7 +1597,7 @@ install opts todos = 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,[]) @@ -1653,7 +1653,7 @@ install opts todos = , sm_cast_swizzle = True , sm_pre_inline = gopt Opt_SimplPreInlining dflags , sm_logger = hsc_logger hsc_env -#endif +#endif } mkCccEnv :: [CommandLineOption] -> CoreM CccEnv @@ -1781,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" "<=") @@ -2133,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) $ @@ -2240,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 @@ -2258,8 +2258,8 @@ isFunCat _ = False deadifyCaseWild :: ReExpr deadifyCaseWild e@(Case scrut wild _rhsTy [Alt (DataAlt dc) [a,b] rhs]) | not (isDeadBinder wild) = - Just (Let (NonRec wild scrut) + Just (Let (NonRec wild scrut) (Case (Var wild) wild' _rhsTy [Alt (DataAlt dc) [a,b] rhs])) - where + where wild' = freshDeadId (exprFreeVars e) "newWild" (varType wild) deadifyCaseWild _ = Nothing From a8f27cf0ea9b68bb64981ddeec30167c2d8d4b47 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 14 Dec 2022 21:44:48 -0700 Subject: [PATCH 28/28] Refactor Nix flake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add a Nix formatter; - add a default package & devShell; - restructure the overlays; - move the inputs to the end; - don’t repeat the GHC version list; - move lib into its own file (and add more functions); - add nixConfig; - provide a “Haskell overlay”; - disable GHC 9.4 and HEAD builds, as they fail; - enable all packages now that they work with newer GHC (except for concat-hardware); - enable `checkPhase` for all Cabal packages; - replace string passing with a package set; - extract "ghc902" to `defaultCompiler`; - add a Garnix config to enable darwin builds; and - expose executables from Cabal packages. --- flake.lock | 147 ++++++++++++++++++-- flake.nix | 291 ++++++++++++++++++++++++++-------------- garnix.yaml | 8 ++ nix/concat-overlay.nix | 72 ++++------ nix/lib.nix | 122 +++++++++++++++++ nix/netlist-overlay.nix | 16 +++ nix/pinned-nixpkgs.nix | 5 +- nix/pkgs.nix | 5 +- parse-cabal-project.nix | 19 --- shell.nix | 32 ++--- 10 files changed, 521 insertions(+), 196 deletions(-) create mode 100644 garnix.yaml create mode 100644 nix/lib.nix create mode 100644 nix/netlist-overlay.nix delete mode 100644 parse-cabal-project.nix diff --git a/flake.lock b/flake.lock index c0d28580..87844c48 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,35 @@ { "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": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -15,27 +38,135 @@ "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": 1652020977, - "narHash": "sha256-9hDlNbrxzD/pLlXmoQ6gzxbYiSAKrj7uHYUWNByLFlI=", + "lastModified": 1676817468, + "narHash": "sha256-ovuJ1jQOC2/EEibufBkXmSN/O9mLx80Wh7aDmHmHAhA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3c5ae9be1f18c790ea890ef8decbd0946c0b4c04", + "rev": "0cf4274b5d06325bd16dbf879a30981bc283e58a", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-21.11", + "ref": "release-22.11", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { - "flake-utils": "flake-utils", + "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", diff --git a/flake.nix b/flake.nix index fdc20e55..e52d4821 100644 --- a/flake.nix +++ b/flake.nix @@ -1,116 +1,203 @@ { - description = "concat"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; - flake-utils.url = "github:numtide/flake-utils"; + 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 = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: - let - haskellLib = (import nixpkgs { inherit system; }).haskell.lib; - - excludedPackages = [ "concat-hardware" ]; - noHaddockPackages = - [ "concat-examples" "concat-inline" "concat-plugin" ]; - # need display, graphviz for testing. disable test for now. - noCheckPackages = [ "concat-graphics" "concat-plugin" ]; - - parseCabalProject = import ./parse-cabal-project.nix; - concatPackages = let parsed = parseCabalProject ./cabal.project; - in builtins.filter - ({ name, ... }: !(builtins.elem name excludedPackages)) parsed; - concatPackageNames = builtins.map ({ name, ... }: name) concatPackages; - - haskellOverlay = self: super: - builtins.listToAttrs (builtins.map ({ name, path }: { - inherit name; - value = let - p = self.callCabal2nix name (./. + "/${path}") { }; - p1 = if builtins.elem name noHaddockPackages then - haskellLib.dontHaddock p - else - p; - p2 = if builtins.elem name noCheckPackages then - haskellLib.dontCheck p1 - else - p1; - in p2; - }) concatPackages); - - # see these issues and discussions: - # - https://github.com/NixOS/nixpkgs/issues/16394 - # - https://github.com/NixOS/nixpkgs/issues/25887 - # - https://github.com/NixOS/nixpkgs/issues/26561 - # - https://discourse.nixos.org/t/nix-haskell-development-2020/6170 - fullOverlay = final: prev: { - haskellPackages = prev.haskellPackages.override (old: { - overrides = - final.lib.composeExtensions (old.overrides or (_: _: { })) - haskellOverlay; - }); - }; - in { - # This package set is only useful for CI build test. - # In practice, users will create a development environment composed by overlays. - packages = let - packagesOnGHC = ghcVer: - let - overlayGHC = final: prev: { - haskellPackages = prev.haskell.packages.${ghcVer}; - }; - newPkgs = import nixpkgs { - overlays = [ overlayGHC fullOverlay ]; - inherit system; - }; + outputs = inputs: let + pname = "concat"; - individualPackages = builtins.listToAttrs (builtins.map - ({ name, ... }: { - name = ghcVer + "_" + name; - value = builtins.getAttr name newPkgs.haskellPackages; - }) concatPackages); - - allEnv = let - hsenv = newPkgs.haskellPackages.ghcWithPackages (p: - let - deps = - builtins.map ({ name, ... }: p.${name}) concatPackages; - in deps); - in newPkgs.buildEnv { - name = "all-packages"; - paths = [ hsenv ]; - }; - in individualPackages // { "${ghcVer}_all" = allEnv; }; + 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"]; - in packagesOnGHC "ghc8107" // packagesOnGHC "ghc884" - // packagesOnGHC "ghc901" // packagesOnGHC "ghc921" - // packagesOnGHC "ghcHEAD"; + 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; - overlay = fullOverlay; + haskell = inputs.self.lib.haskellOverlay cabalPackages; - devShells = let - mkDevShell = ghcVer: - let - overlayGHC = final: prev: { - haskellPackages = prev.haskell.packages.${ghcVer}; - }; + ## Only needed if you are using `concat-hardware`. + netlist-default = + inputs.self.lib.overlayHaskellPackages + supportedGhcVersions + inputs.self.overlays.netlist-haskell; - newPkgs = import nixpkgs { - overlays = [ overlayGHC fullOverlay ]; + 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]; }; - in newPkgs.haskellPackages.shellFor { - packages = ps: builtins.map (name: ps.${name}) concatPackageNames; - buildInputs = [ newPkgs.haskellPackages.cabal-install ] ++ - # haskell-language-server on GHC 9.2.1 is broken yet. - newPkgs.lib.optional (ghcVer != "ghc921") - [ newPkgs.haskell-language-server ]; - withHoogle = false; + 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"; + }; + }) + ]; }; - in { - "ghc8107" = mkDevShell "ghc8107"; - "ghc921" = mkDevShell "ghc921"; + }) + 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 00000000..90461e42 --- /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/nix/concat-overlay.nix b/nix/concat-overlay.nix index aa9b8862..cf75ae78 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 00000000..9c52427d --- /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 00000000..d7666739 --- /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/pinned-nixpkgs.nix b/nix/pinned-nixpkgs.nix index 3aeb9b38..bb85b68b 100644 --- a/nix/pinned-nixpkgs.nix +++ b/nix/pinned-nixpkgs.nix @@ -1,5 +1,5 @@ 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 > ./nixpkgs-pin.json # The command `nix-prefetch-git` itself can be installed via Nix as well. @@ -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 b7380b74..3faab6cd 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/parse-cabal-project.nix b/parse-cabal-project.nix deleted file mode 100644 index 3d9e73ff..00000000 --- a/parse-cabal-project.nix +++ /dev/null @@ -1,19 +0,0 @@ -# Ideally, parsing cabal.project should be done via official tools -# Related discussion here: -# https://github.com/NixOS/cabal2nix/issues/286 - -cabalProject: -let - content = builtins.readFile cabalProject; - lines = builtins.filter builtins.isString (builtins.split '' - [ - ]'' content); - matches = - builtins.map (builtins.match "[[:space:]]*[.]/(.*)/(.*)[.]cabal$") lines; - projects = builtins.concatMap (match: - if builtins.isList match && builtins.length match == 2 then [{ - name = builtins.elemAt match 1; - path = builtins.elemAt match 0; - }] else - [ ]) matches; -in projects diff --git a/shell.nix b/shell.nix index 4e63f896..72ff81e7 100644 --- a/shell.nix +++ b/shell.nix @@ -1,22 +1,22 @@ with import ./nix/pkgs.nix; -pkgs.haskellPackages.shellFor { - nativeBuildInputs = with pkgs; - [ cabal-install + pkgs.haskellPackages.shellFor { + nativeBuildInputs = with pkgs; [ + cabal-install ghc graphviz (pkgs.haskell-language-server.override { - supportedGhcVersions = [ "8107" "902" "924" ]; + 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 - ]; -} + packages = p: + with pkgs.haskellPackages; [ + concat-classes + concat-examples + concat-graphics + concat-hardware + concat-inline + concat-known + concat-plugin + concat-satisfy + ]; + }