package catala

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Desugared.DependencySource

Scope dependencies computations using OCamlgraph

Scope variables dependency graph

Graph declaration

Vertices: scope variables or subscopes.

The vertices of the scope dependency graph are either :

  • the variables of the scope ;
  • the subscopes of the scope.

Indeed, during interpretation, subscopes are executed atomically.

Sourcemodule Vertex : sig ... end

On the edges, the label is the position of the expression responsible for the use of the variable. In the graph, x -> y if x is used in the definition of y.

Module of the graph, provided by OCamlGraph

Graph computations

Returns an ordering of the scope variables and subscope compatible with the dependencies of the computation

Sourceval correct_computation_ordering : ScopeDependencies.t -> Vertex.t list

Returns an ordering of the scope variables and subscope compatible with the dependencies of the computation

Sourceval check_for_cycle : Ast.scope -> ScopeDependencies.t -> unit

Outputs an error in case of cycles.

Sourceval build_scope_dependencies : Ast.scope -> ScopeDependencies.t

Builds the dependency graph of a particular scope

Exceptions dependency graph

Sourceval check_for_exception_cycle : ExceptionsDependencies.t -> unit
OCaml

Innovation. Community. Security.