concepts.dm.crow.parsers.cdl_symbolic_execution.FunctionCallSymbolicExecutor2#

class FunctionCallSymbolicExecutor2[source]#

Bases: object

This class is used to track the function calls and other statements in a suite. It supports simulating the execution of the program and generating the post-condition of the program.

Methods

fork(suite[, init_local_variables])

Make a "fork" of the current tracker.

run()

Simulate the execution of the program and generates an equivalent return statement.

set_unique_return(return_expression)

Set the return expression.

Attributes

suite

The suite to be tracked.

local_variables_stack

The assignments of local variables.

mode

statements

return_expression

The return expression.

__init__(suite, init_local_variables=None, mode=SymbolicExecutionMode.FUNCTIONAL)[source]#

Initialize the function call tracker.

Parameters:
  • suite (Suite) – the suite to be tracked.

  • init_local_variables (Dict[str, Any] | None) – the initial local variables. If None, an empty dictionary will be used.

  • mode (SymbolicExecutionMode)

__new__(**kwargs)#
fork(suite, init_local_variables=None)[source]#

Make a “fork” of the current tracker.

Parameters:
  • suite (Suite) – the new suite to be tracked.

  • init_local_variables (Dict[str, Any] | None) – the new initial local variables. If None, the current local variables will be used.

Returns:

A new instance of the tracker.

Return type:

FunctionCallSymbolicExecutor2

run()[source]#

Simulate the execution of the program and generates an equivalent return statement. This function handles if-else conditions. However, loops are not allowed.

set_unique_return(return_expression)[source]#

Set the return expression. This function is used to set the return expression when it is unique.

Parameters:

return_expression (ValueOutputExpression)

local_variables_stack: List[Dict[str, Any]]#

The assignments of local variables.

mode: SymbolicExecutionMode#
return_expression: ValueOutputExpression | None#

The return expression. This is either None or a single expression.

statements: List[CrowFeatureAssignmentExpression | CrowRuntimeAssignmentExpression | CrowControllerApplicationExpression | CrowBehaviorOrderingSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorConditionSuite]#
suite: Suite#

The suite to be tracked.