@eagleoutice/flowr - v2.15.8
    Preparing search index...

    Class AbstractInterpreter<Domains, Config>

    An abstract interpreter that visits the control flow graph to perform abstract interpretation using fixpoint iteration.

    The visitor infers the abstract values of multiple abstract domains in a single traversal. The abstract state maps each AST node to the abstract values of all domains of the AbsintAnalysis, and whenever a node is visited, the AbstractSemantics of every domain of the analysis are applied to that state.

    Type Parameters

    Hierarchy (View Summary)

    Index
    analysis: Readonly<AbsintAnalysis<Domains>>

    The abstract interpretation analysis performed by the visitor, defining the abstract domains, their abstract semantics, and the reductions between them.

    config: Config & { defaultVisitingOrder: "forward" }
    currentState: MultiValueStateDomain<Partial<Domains>>

    The current abstract state domain at the currently processed AST node.

    stateDomain: MultiValueStateDomain<Partial<Domains>>

    The state abstract domain used by the abstract interpretation visitor.

    trace: Map<
        NodeId,
        MultiValueStateDomain<
            Partial<Domains>,
            StateDomainLift<MultiValueDomain<Partial<(...)>>>,
        >,
    > = ...

    The abstract trace of the abstract interpretation visitor mapping node IDs to the abstract state at the respective node.

    visited: Map<NodeId, number>
    • Hand the arguments of the call to the parameters of the function it enters, so the body can read them. Only the arguments of this very call are used, whichever other calls the function has.

      Parameters

      Returns void

    • Creates the abstract interpretation context that is passed to the abstract semantics of one of the abstract domains of the analysis. The context provides access to the analyzed program and to the abstract states and values inferred for the requested abstract domain so far.

      Type Parameters

      • Key extends string | number | symbol

      Parameters

      • type: Key

        The name of the abstract domain to create the context for

      Returns AbsintContext<StateDomain<Domains[Key]>>

      The abstract interpretation context for the requested abstract domain

    • We widen wherever the control flow comes back around, i.e. at the node a back edge leads to. That is what makes the iteration terminate, and it is the loop head whichever loop the code used: the condition of a while, the binding of a for, or the first statement of a repeat.

      Parameters

      Returns boolean

    • Fires for every named call not handled by a specific overload, e.g. foo(x) for a user-defined foo. flowR does not care about the dataflow impact of these (currently); use SemanticCfgGuidedVisitor#getOrigins|getOrigins to get the call's origins. Anonymous calls, which cannot be resolved via the active environment, go through SemanticCfgGuidedVisitor#onUnnamedCall|onUnnamedCall instead.

      Parameters

      Returns void

    • Protected

      This event triggers for every function call that is not a condition, loop, assignment, replacement call, or access operation.

      This bundles all function calls that are no conditions, loops, assignments, replacement calls, and access operations.

      Parameters

      Returns void

    • Checks whether a control flow graph vertex should be skipped during visitation. Every node has exactly one vertex, reached once its operands are evaluated, so nothing is skipped by default; overriding this lets an analysis ignore parts of the program.

      Parameters

      Returns boolean