diff --git a/bu4/combinatory/lic.py b/bu4/combinatory/lic.py index f9a92ca..4f1114e 100644 --- a/bu4/combinatory/lic.py +++ b/bu4/combinatory/lic.py @@ -1,11 +1,11 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. from bu4.combinatory.lcombinatory import LCombinatory -from bu4.evaluation.av.envtype import envtype -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.constructs.evalue import EValue from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype +from bu4.linkable.evaluation.elvtype import elvtype from bu4.parsing.codes import CODE_CMBI from bu4.parsing.extensions.CodeExtension import CodeExtension from bu4.transform.states.transformfinished import TransformFinished @@ -23,7 +23,7 @@ class EIC(EValue): class IIC(Indexed): - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return EIC() def bytes(self) -> TransformState[bytes]: @@ -43,7 +43,7 @@ class LIC(LCombinatory): self.future = set() self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return EIC() def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/combinatory/lkc.py b/bu4/combinatory/lkc.py index 9b23102..5bd8508 100644 --- a/bu4/combinatory/lkc.py +++ b/bu4/combinatory/lkc.py @@ -1,12 +1,12 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. from bu4.combinatory.lcombinatory import LCombinatory -from bu4.evaluation.av.envtype import envtype -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.edelayed import EDelayed from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.constructs.evalue import EValue from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype +from bu4.linkable.evaluation.elvtype import elvtype from bu4.parsing.codes import CODE_CMBK from bu4.parsing.extensions.CodeExtension import CodeExtension from bu4.transform.states.transformfinished import TransformFinished @@ -24,7 +24,7 @@ class EKC(EValue): class IKC(Indexed): - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return EKC() def bytes(self) -> TransformState[bytes]: @@ -44,7 +44,7 @@ class LKC(LCombinatory): self.future = set() self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return EKC() def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/combinatory/lsc.py b/bu4/combinatory/lsc.py index 41db0bc..efc0998 100644 --- a/bu4/combinatory/lsc.py +++ b/bu4/combinatory/lsc.py @@ -2,13 +2,13 @@ from bu4.combinatory.lcombinatory import LCombinatory from bu4.evaluation.av.aftervalue import AfterValue -from bu4.evaluation.av.envtype import envtype -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.constructs.evalue import EValue from bu4.evaluation.targets.avanonymouscontainer import AVAnonymousContainer from bu4.evaluation.targets.avcall import AVCall from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype +from bu4.linkable.evaluation.elvtype import elvtype from bu4.parsing.codes import CODE_CMBS from bu4.parsing.extensions.CodeExtension import CodeExtension from bu4.transform.states.transformfinished import TransformFinished @@ -58,7 +58,7 @@ class ESC(EValue): class ISC(Indexed): - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return ESC() def bytes(self) -> TransformState[bytes]: @@ -78,7 +78,7 @@ class LSC(LCombinatory): self.future = set() self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return ESC() def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/indexing/constructs/icall.py b/bu4/indexing/constructs/icall.py index 56979f5..94399eb 100644 --- a/bu4/indexing/constructs/icall.py +++ b/bu4/indexing/constructs/icall.py @@ -1,11 +1,11 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. from bu4.evaluation.av.aftervalue import AfterValue -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.targets.avcall import AVCall from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_CALL from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -21,7 +21,7 @@ class ICall(Indexed): self.argument = argument self.lambda_ = lambda_ - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return AfterValue(EAttachable(ev, self.lambda_), AVCall(EAttachable(ev, self.argument))) def __str__(self): diff --git a/bu4/indexing/constructs/idelayed.py b/bu4/indexing/constructs/idelayed.py index 136667b..a407464 100644 --- a/bu4/indexing/constructs/idelayed.py +++ b/bu4/indexing/constructs/idelayed.py @@ -1,10 +1,10 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.edelayed import EDelayed from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_DLYD from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -19,7 +19,7 @@ class IDelayed(Indexed): def __init__(self, value: Indexed): self.value = value - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return EDelayed(EAttachable( ev, self.value diff --git a/bu4/indexing/constructs/iexception.py b/bu4/indexing/constructs/iexception.py index 7c0e265..ad6283e 100644 --- a/bu4/indexing/constructs/iexception.py +++ b/bu4/indexing/constructs/iexception.py @@ -1,9 +1,9 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.eexception import EException from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_XCPT from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -15,7 +15,7 @@ class IException(Indexed): def __init__(self, name: bytes): self.name = name - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return EException(self.name) def __str__(self): diff --git a/bu4/indexing/constructs/ilambda.py b/bu4/indexing/constructs/ilambda.py index 9ebcdbd..b0cf796 100644 --- a/bu4/indexing/constructs/ilambda.py +++ b/bu4/indexing/constructs/ilambda.py @@ -1,9 +1,9 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype -from bu4.evaluation.constructs.eilambda import EILambda from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eilambda import EILambda +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_MAKE from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -20,7 +20,7 @@ class ILambda(Indexed): self.table = table self.memoize = memoize - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return EILambda( [ev[i] for i in self.table], self.value, diff --git a/bu4/indexing/constructs/iname.py b/bu4/indexing/constructs/iname.py index abfb88b..f1b8672 100644 --- a/bu4/indexing/constructs/iname.py +++ b/bu4/indexing/constructs/iname.py @@ -1,8 +1,8 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_NAME from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -14,7 +14,7 @@ class IName(Indexed): def __init__(self, index: int): self.index = index - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return ev[self.index] def __str__(self): diff --git a/bu4/indexing/constructs/indexed.py b/bu4/indexing/constructs/indexed.py index 4b5e8da..2346d52 100644 --- a/bu4/indexing/constructs/indexed.py +++ b/bu4/indexing/constructs/indexed.py @@ -1,16 +1,16 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.attachable import Attachable from bu4.evaluation.constructs.evaluable import Evaluable +from bu4.indexing.evaluation.eivtype import eivtype from bu4.transform.states.transformstate import TransformState from bu4.transform.transform import transform __all__ = ('Indexed',) -class Indexed(Attachable[evtype]): - def attach(self, ev: evtype) -> Evaluable: +class Indexed(Attachable[eivtype]): + def attach(self, ev: eivtype) -> Evaluable: raise NotImplementedError def bytes(self) -> TransformState[bytes]: diff --git a/bu4/indexing/constructs/inull.py b/bu4/indexing/constructs/inull.py index 3d65284..c040ea3 100644 --- a/bu4/indexing/constructs/inull.py +++ b/bu4/indexing/constructs/inull.py @@ -1,9 +1,9 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.enull import ENull from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.indexing.evaluation.eivtype import eivtype from bu4.parsing.codes import CODE_NULL from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -12,7 +12,7 @@ __all__ = ('INull',) class INull(Indexed): - def attach(self, ev: evtype) -> Evaluable: + def attach(self, ev: eivtype) -> Evaluable: return ENull() def __str__(self): diff --git a/bu4/evaluation/constructs/eilambda.py b/bu4/indexing/evaluation/eilambda.py similarity index 69% rename from bu4/evaluation/constructs/eilambda.py rename to bu4/indexing/evaluation/eilambda.py index c204a48..4808b3f 100644 --- a/bu4/evaluation/constructs/eilambda.py +++ b/bu4/indexing/evaluation/eilambda.py @@ -1,23 +1,23 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.evtype import evtype -from bu4.evaluation.av.lambdaev import LambdaEv from bu4.evaluation.constructs.attachable import Attachable from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.constructs.evalue import EValue +from bu4.indexing.evaluation.eivtype import eivtype +from bu4.indexing.evaluation.lambdaeiv import LambdaEiv __all__ = ('EILambda',) class EILambda(EValue): - def __init__(self, ev: evtype, value: Attachable[evtype], *, memoize: bool): + def __init__(self, ev: eivtype, value: Attachable[eivtype], *, memoize: bool): self.ev = ev self.value = value self.memoize = memoize def call(self, argument: Evaluable) -> Evaluable: - ev: evtype = LambdaEv(self.ev, argument, memoize=self.memoize) + ev: eivtype = LambdaEiv(self.ev, argument, memoize=self.memoize) return EAttachable( ev, self.value diff --git a/bu4/evaluation/av/evtype.py b/bu4/indexing/evaluation/eivtype.py similarity index 78% rename from bu4/evaluation/av/evtype.py rename to bu4/indexing/evaluation/eivtype.py index e401bed..0b317a9 100644 --- a/bu4/evaluation/av/evtype.py +++ b/bu4/indexing/evaluation/eivtype.py @@ -2,7 +2,7 @@ from typing import Sequence -__all__ = ('evtype',) +__all__ = ('eivtype',) from bu4.evaluation.constructs.evaluable import Evaluable @@ -11,4 +11,4 @@ try: except ImportError: TypeAlias = type -evtype: TypeAlias = Sequence[Evaluable] +eivtype: TypeAlias = Sequence[Evaluable] diff --git a/bu4/evaluation/av/lambdaev.py b/bu4/indexing/evaluation/lambdaeiv.py similarity index 74% rename from bu4/evaluation/av/lambdaev.py rename to bu4/indexing/evaluation/lambdaeiv.py index ff4c450..fc34db4 100644 --- a/bu4/evaluation/av/lambdaev.py +++ b/bu4/indexing/evaluation/lambdaeiv.py @@ -2,14 +2,14 @@ from typing import Sequence -from bu4.evaluation.av.evtype import evtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.targets.avanonymouscontainer import AVAnonymousContainer +from bu4.indexing.evaluation.eivtype import eivtype -__all__ = ('LambdaEv',) +__all__ = ('LambdaEiv',) -class LambdaEv(Sequence[Evaluable]): +class LambdaEiv(Sequence[Evaluable]): def __getitem__(self, i: int) -> Evaluable: if i == 0: return self.container @@ -19,6 +19,6 @@ class LambdaEv(Sequence[Evaluable]): def __len__(self) -> int: return len(self.ev) + 1 - def __init__(self, ev: evtype, evaluable: Evaluable, *, memoize): + def __init__(self, ev: eivtype, evaluable: Evaluable, *, memoize): self.ev = ev self.container = AVAnonymousContainer(evaluable).after_value if memoize else evaluable diff --git a/bu4/evaluation/constructs/elambda.py b/bu4/linkable/evaluation/ellambda.py similarity index 70% rename from bu4/evaluation/constructs/elambda.py rename to bu4/linkable/evaluation/ellambda.py index 122bf16..e8b2ab8 100644 --- a/bu4/evaluation/constructs/elambda.py +++ b/bu4/linkable/evaluation/ellambda.py @@ -1,17 +1,17 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype -from bu4.evaluation.av.lambdaenv import LambdaEnv from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.constructs.evalue import EValue +from bu4.linkable.evaluation.elvtype import elvtype +from bu4.linkable.evaluation.lambdaelv import LambdaElv from bu4.linking.constructs.linked import Linked -__all__ = ('ELambda',) +__all__ = ('ELLambda',) -class ELambda(EValue): - def __init__(self, env: envtype, name: bytes, value: Linked): +class ELLambda(EValue): + def __init__(self, env: elvtype, name: bytes, value: Linked): self.env = env self.name = name self.value = value @@ -20,7 +20,7 @@ class ELambda(EValue): def call(self, argument: Evaluable) -> Evaluable: return EAttachable( - LambdaEnv(self.env, self.name, argument, memoize=self.memoize) if self.used else self.env, + LambdaElv(self.env, self.name, argument, memoize=self.memoize) if self.used else self.env, self.value ) diff --git a/bu4/evaluation/av/envtype.py b/bu4/linkable/evaluation/elvtype.py similarity index 76% rename from bu4/evaluation/av/envtype.py rename to bu4/linkable/evaluation/elvtype.py index 24e8aaa..2cf16db 100644 --- a/bu4/evaluation/av/envtype.py +++ b/bu4/linkable/evaluation/elvtype.py @@ -2,7 +2,7 @@ from typing import Mapping -__all__ = ('envtype',) +__all__ = ('elvtype',) from bu4.evaluation.constructs.evaluable import Evaluable @@ -11,4 +11,4 @@ try: except ImportError: TypeAlias = type -envtype: TypeAlias = Mapping[bytes, Evaluable] +elvtype: TypeAlias = Mapping[bytes, Evaluable] diff --git a/bu4/evaluation/av/lambdaenv.py b/bu4/linkable/evaluation/lambdaelv.py similarity index 83% rename from bu4/evaluation/av/lambdaenv.py rename to bu4/linkable/evaluation/lambdaelv.py index 3a3e09c..ba19ce6 100644 --- a/bu4/evaluation/av/lambdaenv.py +++ b/bu4/linkable/evaluation/lambdaelv.py @@ -2,14 +2,14 @@ from typing import Mapping, Iterator -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.targets.avnamedcontainer import AVNamedContainer +from bu4.linkable.evaluation.elvtype import elvtype -__all__ = ('LambdaEnv',) +__all__ = ('LambdaElv',) -class LambdaEnv(Mapping[bytes, Evaluable]): +class LambdaElv(Mapping[bytes, Evaluable]): def __getitem__(self, k: bytes) -> Evaluable: if k == self.name: return self.container @@ -23,7 +23,7 @@ class LambdaEnv(Mapping[bytes, Evaluable]): yield self.name yield from self.env - def __init__(self, env: envtype, name: bytes, evaluable: Evaluable, *, memoize): + def __init__(self, env: elvtype, name: bytes, evaluable: Evaluable, *, memoize): self.env = env self.name = name self.container = AVNamedContainer(evaluable, name).after_value if memoize else evaluable diff --git a/bu4/linking/constructs/lcall.py b/bu4/linking/constructs/lcall.py index d3a2260..7b18a37 100644 --- a/bu4/linking/constructs/lcall.py +++ b/bu4/linking/constructs/lcall.py @@ -1,12 +1,12 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. from bu4.evaluation.av.aftervalue import AfterValue -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.evaluable import Evaluable from bu4.evaluation.targets.avcall import AVCall from bu4.indexing.constructs.icall import ICall from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -31,7 +31,7 @@ class LCall(Linked): (self.argument.future & self.lambda_.future) ) - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return AfterValue(EAttachable(env, self.lambda_), AVCall(EAttachable(env, self.argument))) def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/linking/constructs/ldelayed.py b/bu4/linking/constructs/ldelayed.py index 457f502..7d777e7 100644 --- a/bu4/linking/constructs/ldelayed.py +++ b/bu4/linking/constructs/ldelayed.py @@ -1,11 +1,11 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.edelayed import EDelayed from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.idelayed import IDelayed from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -24,7 +24,7 @@ class LDelayed(Linked): self.future = self.value.future self.multifuture = self.future - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return EDelayed(EAttachable( env, self.value diff --git a/bu4/linking/constructs/lexception.py b/bu4/linking/constructs/lexception.py index 8dc4c54..27e7c8f 100644 --- a/bu4/linking/constructs/lexception.py +++ b/bu4/linking/constructs/lexception.py @@ -1,10 +1,10 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.eexception import EException from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.iexception import IException from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -18,7 +18,7 @@ class LException(Linked): self.future = set() self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return EException(self.name) def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/linking/constructs/linked.py b/bu4/linking/constructs/linked.py index bd7fd38..00cbc34 100644 --- a/bu4/linking/constructs/linked.py +++ b/bu4/linking/constructs/linked.py @@ -1,19 +1,19 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.attachable import Attachable from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.transform.states.transformstate import TransformState __all__ = ('Linked',) -class Linked(Attachable[envtype]): +class Linked(Attachable[elvtype]): future: set[bytes] multifuture: set[bytes] - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: raise NotImplementedError def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/linking/constructs/llambda.py b/bu4/linking/constructs/llambda.py index f6eee57..48b2509 100644 --- a/bu4/linking/constructs/llambda.py +++ b/bu4/linking/constructs/llambda.py @@ -1,13 +1,13 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.evaluation.constructs.edelayed import EDelayed -from bu4.evaluation.constructs.elambda import ELambda from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.idelayed import IDelayed from bu4.indexing.constructs.ilambda import ILambda from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.ellambda import ELLambda +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.aftertransform import AfterTransform from bu4.transform.states.transformfinished import TransformFinished @@ -29,9 +29,9 @@ class LLambda(Linked): self.used = name in value.future self.memoize = name in value.multifuture - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return ( - ELambda( + ELLambda( {name: env[name] for name in self.future} if self.used else env, self.name, self.value diff --git a/bu4/linking/constructs/lname.py b/bu4/linking/constructs/lname.py index 292891e..8c29ef7 100644 --- a/bu4/linking/constructs/lname.py +++ b/bu4/linking/constructs/lname.py @@ -1,9 +1,9 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.iname import IName from bu4.indexing.constructs.indexed import Indexed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -17,7 +17,7 @@ class LName(Linked): self.future = {name} self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return env[self.name] def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/linking/constructs/lnull.py b/bu4/linking/constructs/lnull.py index ce17f45..98e934d 100644 --- a/bu4/linking/constructs/lnull.py +++ b/bu4/linking/constructs/lnull.py @@ -1,10 +1,10 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.enull import ENull from bu4.evaluation.constructs.evaluable import Evaluable from bu4.indexing.constructs.indexed import Indexed from bu4.indexing.constructs.inull import INull +from bu4.linkable.evaluation.elvtype import elvtype from bu4.linking.constructs.linked import Linked from bu4.transform.states.transformfinished import TransformFinished from bu4.transform.states.transformstate import TransformState @@ -17,7 +17,7 @@ class LNull(Linked): self.future = set() self.multifuture = set() - def attach(self, env: envtype) -> Evaluable: + def attach(self, env: elvtype) -> Evaluable: return ENull() def index(self, promise: list[bytes]) -> TransformState[Indexed]: diff --git a/bu4/linking/evaluable_from_parsed.py b/bu4/linking/evaluable_from_parsed.py index 49b7421..2689454 100644 --- a/bu4/linking/evaluable_from_parsed.py +++ b/bu4/linking/evaluable_from_parsed.py @@ -1,13 +1,13 @@ # Copyright (c) PARRRATE T&V 2021. All rights reserved. -from bu4.evaluation.av.envtype import envtype from bu4.evaluation.constructs.eattachable import EAttachable from bu4.linkable.constructs.parsed import Parsed +from bu4.linkable.evaluation.elvtype import elvtype from bu4.transform.transform import transform __all__ = ('evaluable_from_parsed',) -def evaluable_from_parsed(env: envtype, parsed: Parsed): +def evaluable_from_parsed(env: elvtype, parsed: Parsed): linked = transform(parsed.link(set(env))) return EAttachable(env, linked) diff --git a/bu4/tracing/trace.py b/bu4/tracing/trace.py index 7da6fbb..cd48eeb 100644 --- a/bu4/tracing/trace.py +++ b/bu4/tracing/trace.py @@ -4,10 +4,10 @@ from bu4.combinatory.lic import EIC from bu4.combinatory.lkc import EKC from bu4.combinatory.lsc import ESC, ESC1, ESC2 from bu4.evaluation.constructs.edelayed import EDelayed -from bu4.evaluation.constructs.eilambda import EILambda -from bu4.evaluation.constructs.elambda import ELambda from bu4.evaluation.constructs.evalue import EValue from bu4.evaluation.sync import sync +from bu4.indexing.evaluation.eilambda import EILambda +from bu4.linkable.evaluation.ellambda import ELLambda from bu4.tracing.probe import ProbeA __all__ = ('trace', 'probe_index_reset',) @@ -19,7 +19,7 @@ def trace(lambda_: EValue): global _probe_index size = 0 while True: - if not isinstance(lambda_, (ELambda, EILambda, EIC, EKC, ESC, ESC1, ESC2, EDelayed)): + if not isinstance(lambda_, (ELLambda, EILambda, EIC, EKC, ESC, ESC1, ESC2, EDelayed)): return size, lambda_ lambda_ = sync(lambda_.call(ProbeA(_probe_index))) _probe_index += 1