deltaEnv :: SequFlowGraph -> Envs MixedRecord Sc
deltaEnv g = res1 `minusEnv` res0
  where
        envs0 = emptyEnv { recordNumber = SingleRecord rec0,
                           powerMap = power0num,
                           dtimeMap = dtimes0num,
                           xMap = x0num,
                           fetaMap = eta0num }

        envs1 = emptyEnv { recordNumber = SingleRecord rec1,
                           powerMap = power1num,
                           --dpowerMap = dpower1num,
                           --detaMap = deta1num,
                           dtimeMap = dtimes1num,
                           xMap = x1num,
                           fetaMap = eta1num }

        (envs0', ts0) = makeAllEquations g [envs0]
        (envs1', ts1) = makeAllEquations g [envs1]

        ts0' = toAbsEquations $ order ts0
        ts1' = toAbsEquations $ order ts1

        res0 = interpretFromScratch (recordNumber envs0') 1 (map (eqToInTerm envs0') ts0')
        res1 = interpretFromScratch (recordNumber envs1') 1 (map (eqToInTerm envs1') ts1')
deltaEnv :: SequFlowGraph -> Envs MixedRecord Sc
deltaEnv g = res1 `minusEnv` res0
  where
        envs0 = emptyEnv { recordNumber = SingleRecord rec0,
                           powerMap = power0num,
                           dtimeMap = dtimes0num,
                           xMap = x0num,
                           fetaMap = eta0num }

        envs1 = emptyEnv { recordNumber = SingleRecord rec1,
                           powerMap = power1num,
                           --dpowerMap = dpower1num,
                           --detaMap = deta1num,
                           dtimeMap = dtimes1num,
                           xMap = x1num,
                           fetaMap = eta1num }

        (envs0', ts0) = makeAllEquations g [envs0]
        (envs1', ts1) = makeAllEquations g [envs1]

        ts0' = toAbsEquations $ order ts0
        ts1' = toAbsEquations $ order ts1

        res0 = interpretFromScratch (recordNumber envs0') 1 (map (eqToInTerm envs0') ts0')
        res1 = interpretFromScratch (recordNumber envs1') 1 (map (eqToInTerm envs1') ts1')
deltaEnv g = res1 `minusEnv` res0
  where
        envs0 = emptyEnv { recordNumber = SingleRecord rec0,
                           powerMap = power0num,
                           dtimeMap = dtimes0num,
                           xMap = x0num,
                           fetaMap = eta0num }

        envs1 = emptyEnv { recordNumber = SingleRecord rec1,
                           powerMap = power1num,
                           --dpowerMap = dpower1num,
                           --detaMap = deta1num,
                           dtimeMap = dtimes1num,
                           xMap = x1num,
                           fetaMap = eta1num }

        (envs0', ts0) = makeAllEquations g [envs0]
        (envs1', ts1) = makeAllEquations g [envs1]

        ts0' = toAbsEquations $ order ts0
        ts1' = toAbsEquations $ order ts1

        res0 = interpretFromScratch (recordNumber envs0') 1 (map (eqToInTerm envs0') ts0')
        res1 = interpretFromScratch (recordNumber envs1') 1 (map (eqToInTerm envs1') ts1')