-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
logicWork on logic of expressions manipulationWork on logic of expressions manipulation
Description
So far, the visitor works with AbstractTrees containing 3 types of nodes: Lam, App & Var.
Work needs to be done to expand this logic so it works with all new expression types contained in lamedh/expr/applicative.py
class Error(Expr):
class TypeError(Expr):
class BooleanConstant(Expr):
class NaturalConstant(BooleanConstant):
class UnaryOp(Expr):
class BinaryOp(Expr):
class IfThenElse(Expr):
class Tuple(Expr):
class Indexing(Expr):
class Rec(Expr):
class Pattern:
class LetIn(Expr):
class LetRec(LetIn):
Tasks:
-
Make sure that free variables of any kind of simple or complex expression creating using this expanded language can be found by the free-var-visitor. All new nodes above except the last 2 (LetIn & LetRec) do not bind variables.
-
Create new tests-cases contemplating these changes
-
Simplify what you just did in step (1)
- Bear in mind that a naive implementation of step (1) you may introduce a zillion new methods "visit_<new_type>" methods.
- In NodeVisiting Pattern, there's a default method named "generic_visit" that's used every time that a node of class "XYZ" needs to be visited and there's no "visit_xyz" method.
- Let's try to use that concept to many nodes-type may not need to have special visit-method.
Metadata
Metadata
Assignees
Labels
logicWork on logic of expressions manipulationWork on logic of expressions manipulation