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

    The abstract semantics of an abstract domain, defining the abstract effect of the different R constructs on the abstract state.

    All handlers are optional, so only the semantics of the constructs relevant for the respective abstract domain have to be defined. The handlers are called by the abstract interpretation visitor whenever the respective construct is visited, and are expected to apply their effect by updating the passed abstract state in place.

    interface AbstractSemantics<Domain extends StateDomain> {
        handleAccessCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            target: NodeId,
        ): void;
        handleAssignmentCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            target: NodeId,
            source: NodeId,
        ): void;
        handleBreakCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
        ): void;
        handleConditionBranch?(
            state: Domain,
            vertex: DataflowGraphVertexArgument,
            ctx: AbsintContext<Domain>,
            branch: "TRUE" | "FALSE",
            target?: NodeId,
        ): void;
        handleExpressionList?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            expressions: readonly NodeId[],
        ): void;
        handleForLoop?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            variable: NodeId,
            vector: NodeId,
            body: NodeId,
        ): void;
        handleFunctionCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
        ): void;
        handleFunctionDefinition?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionDefinition,
            ctx: AbsintContext<Domain>,
            parameters: readonly NodeId[],
        ): void;
        handleIfThenElse?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            condition: NodeId,
            then: NodeId,
            otherwise?: NodeId,
        ): void;
        handleLogicalConstant?(
            state: Domain,
            vertex: DataflowGraphVertexValue,
            ctx: AbsintContext<Domain>,
            value: boolean,
        ): void;
        handleNullConstant?(
            state: Domain,
            vertex: DataflowGraphVertexValue,
            ctx: AbsintContext<Domain>,
            value: "NULL",
        ): void;
        handleNumberConstant?(
            state: Domain,
            vertex: DataflowGraphVertexValue,
            ctx: AbsintContext<Domain>,
            value: RNumberValue,
        ): void;
        handlePipeCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
        ): void;
        handleRepeatLoop?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            body: NodeId,
        ): void;
        handleReplacementCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            target: NodeId,
            source: NodeId,
        ): void;
        handleReturnCall?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
        ): void;
        handleStringConstant?(
            state: Domain,
            vertex: DataflowGraphVertexValue,
            ctx: AbsintContext<Domain>,
            value: RStringValue,
        ): void;
        handleSymbolConstant?(
            state: Domain,
            vertex: DataflowGraphVertexValue,
            ctx: AbsintContext<Domain>,
            value: Identifier,
        ): void;
        handleVariableDefinition?(
            state: Domain,
            vertex: DataflowGraphVertexVariableDefinition,
            ctx: AbsintContext<Domain>,
        ): void;
        handleVariableUse?(
            state: Domain,
            vertex: DataflowGraphVertexUse,
            ctx: AbsintContext<Domain>,
        ): void;
        handleWhileLoop?(
            state: Domain,
            vertex: DataflowGraphVertexFunctionCall,
            ctx: AbsintContext<Domain>,
            condition: NodeId,
            body: NodeId,
        ): void;
    }

    Type Parameters

    • Domain extends StateDomain

      Type of the state abstract domain the semantics are defined for

    Implemented by

    Index
    • Handles a control flow edge that is only taken if a condition evaluates to a specific value, allowing to refine the abstract state with the information gained from the taken branch.

      Parameters

      • state: Domain

        The abstract state to apply the semantics to

      • vertex: DataflowGraphVertexArgument

        The dataflow graph vertex of the condition of the branch

      • ctx: AbsintContext<Domain>

        The context of the abstract interpretation analysis

      • branch: "TRUE" | "FALSE"

        Whether the branch is taken if the condition evaluates to TRUE or to FALSE

      • Optionaltarget: NodeId

        The vertex the branch enters, which tells the arms of a switch apart (each is entered on TRUE)

      Returns void