ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("antarex.memoi.MemoizationAutoFuncs");

(.lara)
import antarex.memoi.MemoizationAutoFuncs;

Global Functions

BodyReferencesLocalsOrConstants

BodyReferencesLocalsOrConstants($function, $body)

Parameters

$function: any
$body: any

Returns

any - "true" if $body of $function references only local variables or constant objects, "false" otherwise.

checkBodyMemoizable

checkBodyMemoizable($file, $function, $body)

Parameters

$file: any
$function: any
$body: any

Returns

any - STATE.YES if the method/function $function defined in the file $file is memoizable, STATE.NO or STATE.UNDEF otherwise. A function/method is memoizable: - if the referenced functions/methods are memoizable - and the $body of $function refers only local variables and constants (pure functions).

declaredAsPure

declaredAsPure($name)

Parameters

$name: any

Returns

any - true if $name is declared as a pure function, false otherwise. Currently, restricted to the pure functions of math.h and those declared in SomePredefinedPureFunctions.

findmemoizable

findmemoizable($file, $function, $body)

A function/method is memoizable iff
1) The header "vtype func(parameters)" satisfies :
- for all p of parameters type(p)=vtype and 1 <= |parameters| <=3
- returns a vtype value.
2) It refers only local variables and constants (pure functions), and no pointers.

Parameters

$file: any
$function: any
$body: any

getIdId

getIdId($id, $suff)

Parameters

$id: any
$suff: any

Returns

any - the string $id%$suff

getNbMemoizable

getNbMemoizable()

Returns

any - the current number of memoizable functions.

getidfunction

getidfunction($file, $function)

Parameters

$file: any
$function: any

printCallGraph

printCallGraph(callGraph)

Debug. Prints the gathered information of a graph ( callGraph) to the console.

Parameters

callGraph: any

successorsAreMemoizable

successorsAreMemoizable(id)

Parameters

id: any

Returns

any - STATE.YES if the successors of id are memoizable. - STATE.NO if one of the sucessors is not memoizable, or in case of circuit. - STATE.UNDEF if the status of one of the successors is undefined (ie not yet fixed).