diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-10-27 22:02:18 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-10-27 22:02:18 +0100 |
commit | 4acecc1099caefc2bd2fbe252d30d52ead2c74be (patch) | |
tree | c32d4ae3fd7269df5543c0b8fe3cbbce87b1ce28 /src/AST.hs | |
parent | 8d15d92bb9a0472e096ff714e45b10cf16134a30 (diff) |
WIP preserve only subset of D0 bindings in dual (...)
The point of this is to ensure that when an expression occurs in a
Build, then the parts of D0 that are only there to make sharing work out
for D1 are not laboriously taped in an array and preserved for D2, only
for D2 to ignore them.
However, while the subtape machinery is a good first step, this is not
everything: the current Build translation makes a Build for the
(elementwise) tape and separately a build for the primal. Because the
primal _does_ generally need the subtaped-away stuff, we can't just not
tape those.
TODO: figure out how to resolve this / what the next step is.
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -20,7 +20,6 @@ import Data.Functor.Const import Data.Kind (Type) import Array -import AST.Env import AST.Types import AST.Weaken import CHAD.Types @@ -289,11 +288,6 @@ subst' f w = \case weakenExpr :: env :> env' -> Expr x env t -> Expr x env' t weakenExpr = subst' (\x t w' i -> EVar x t (w' @> i)) -wUndoSubenv :: Subenv env env' -> env' :> env -wUndoSubenv SETop = WId -wUndoSubenv (SEYes sub) = WCopy (wUndoSubenv sub) -wUndoSubenv (SENo sub) = WSink .> wUndoSubenv sub - slistIdx :: SList f list -> Idx list t -> f t slistIdx (SCons x _) IZ = x slistIdx (SCons _ list) (IS i) = slistIdx list i |