Copyright © (C) 2015, Pablo Lamela, Simon Thompson
Authors: Pablo Lamela Seijas (P.Lamela-Seijas@kent.ac.uk), Simon Thompson (S.J.Thompson@kent.ac.uk).
acc() = #acc{cluster_labels = da_map:da_map({comm | {ex, 1 | 2}, string()}, cluster:cluster(tree:tree_node())), exp_funs = sets:set({atom(), integer()})}
Record for use as accumulator when folding through cluster borders. Contains the following fields:
ph_map - maps PH (tree place holders) to pairs
{symmetric_type, cluster_name}
(for creating function calls) cluster_order - maps pairs {order_type, position} to
clusters (function) names cluster_labels - da_maps (function) names to clusters cluster_info - maps (function) names to records
with information about the cluster
(cluster_info records) cluster_funname - maps generated (function) names to the actual
name that should be displayed in the file cluster_orifunname - maps generated (function) names to the original
name that it was suppoused to have cluster_dicts - contains the cluster dictionaries
(cluster_dict record) allocated_parents - saves a set with the parents of clusters
whose name will be assigned by a common
cluster. This is checked in a first pass
so that we minimise the numbre of dummy
functions needed to balance exclusive
clusters tree_info - contains the trees and the mapping
(tree_info record) exp_funs - set with the local functions to export counters - contains counters for function_name generation
(counters record) out_module - contains the output module name
as an atom var_for_module - name for the var that contains the
module instance name, (guaranteed to
be unique for both modules) root_for_new_exclusive_funnames - prefix for the name of the generated
functions in exclusive modules, (all
existing functions are guaranteed to
not start by this prefix) root_for_new_common_funnames - prefix for the name of the generated
functions in common module, (all existing
functions are guaranteed to not start by
this prefix) cluster_counters() = #cluster_counters{}
Record that keeps counters used for naming functions and ordering them in the files. Contains the following fields:
invisible_counter - Contains the counter for the
label identifiers used when the
used label is already provided
by the user common_counter - Contains the counter for the
labels of the common cluster common_pos_counter - Contains the counter for the
order of the common cluster exclusive_counter - Contains the counter for the
labels of the exclusive
cluster exclusive_pos_counter_1 - Contains the counter for the
order of the left exclusive
clusters exclusive_pos_counter_2 - Contains the counter for the
order of the right exclusive
clusters cluster_dicts() = #cluster_dicts{comm_clus = cluster_dict:cluster_dict(tree:tree_node()), ex_clus1 = cluster_dict:cluster_dict(tree:tree_node()), ex_clus2 = cluster_dict:cluster_dict(tree:tree_node())}
Record for keeping the updated cluster dictionaries. Contains the following fields:
comm_clus - Contains the cluster dictionary
with the common clusters ex_clus1 - Contains the cluster dictionary with
the exclusive clusters of side one ex_clus2 - Contains the cluster dictionary with
the exclusive clusters of side twocluster_info() = #cluster_info{}
Record for keeping information about a particular cluster. Contains the following fields:
cluster_type - Whether the cluster is common,
exclusive1, or exclusive2 environment_info - Contains information like the free
and bounded variables at the root
of the cluster, (environment_info
record) environment_info() = #environment_info{}
Record that contains environment information like the free and bound variables at the root of a cluster. Contains the following fields:
free_variables - Contains a list with
variables that are freefree_left - Contains a list with variables
that were free in the left treefree_right - Contains a list with variables
that were free in the left treeexport_variables - Contains a list with
variables that are exportedexport_left - Contains a list with variables
that are exported by the left treeexport_right - Contains a list with variables
that are exported by the left treeis_left_leaf - Weather the cluster has children
from left side (in another cluster)is_right_leaf - Weather the cluster has children
from right side (in another cluster)tree_info() = #tree_info{tree1 = tree:tree(), tree2 = tree:tree(), tree1_args = dict:dict({FunName::string(), Arity::non_neg_integer()}, [ArgName::string()]), tree2_args = dict:dict({FunName::string(), Arity::non_neg_integer()}, [ArgName::string()]), mapping = da_map:da_map(tree:tree_node(), tree:tree_node())}
Record for keeping the tree and mapping information. Contains the following fields:
tree1 - Contains the cluster dictionary
with the common clusters tree2 - Contains the cluster dictionary with
the exclusive clusters of side one tree1_args - Contains a dictionary with good names
for function arguments of tree1 tree2_args - Contains a dictionary with good names
for funciton arguments of tree2 mapping - Contains the cluster dictionary with
the exclusive clusters of side two| find_actual_exported_vars_for_asym_label/3 | Gets the exported variables for the top node of the cluster linked to AsymLabel, considering only the tree specified by Pos. |
| find_actual_free_vars_for_asym_label/3 | Gets the free variables for the top node of the cluster linked to AsymLabel, considering only the tree specified by Pos. |
| find_exported_vars_for_sym_label/3 | Gets the exported variables for the top nodes of the clusters linked to the Name, with type SymType. |
| find_free_vars_for_sym_label/3 | Gets the free variables for the top nodes of the clusters linked to the Name, with type SymType. |
| fold_clusters/4 | Folds a function through the frontiers of the clusters in roughly breadth first order. |
| get_children_from_node_list/5 | Gets all the children for a list of nodes and maps them to the placeholders on the nodes, (their left alternative if common). |
| get_frontier_children_from_node_list/5 | Gets all the children for a list of nodes and maps them to the placeholders on the nodes, (their left alternative if common). |
| get_leaf_as_is_or_default/3 | Obtains information about whether the cluster is a leaf or not. |
| get_type_list/2 | Returns a list with the correspondence of types, clusters, and trees. |
| is_in_scope/4 | Returns true if the function specified (Name and Arity) is in both of sets of inscope functions (Inscope1 and Inscope2), or false if it is in none. |
| isolate_type_class/1 | Returns the symmetric cluster type. |
| merge_environments/2 | Merges the list of free vars of two nodes. |
find_actual_exported_vars_for_asym_label(AsymLabel::{ClustType, string()}, Pos::1 | 2, Acc::cluster_folding:acc()) -> [string()]
Gets the exported variables for the top node of the cluster linked to AsymLabel, considering only the tree specified by Pos. It first tries to get them from Acc, otherwise it infers it from the node itself.
find_actual_free_vars_for_asym_label(AsymLabel::{ClustType, string()}, Pos::1 | 2, Acc::cluster_folding:acc()) -> [string()]
Gets the free variables for the top node of the cluster linked to AsymLabel, considering only the tree specified by Pos. It first tries to get them from Acc, otherwise it infers it from the node itself.
find_exported_vars_for_sym_label(SymType::comm | ex, Name::string(), Name::cluster_folding:acc()) -> [string()]
Gets the exported variables for the top nodes of the clusters linked to the Name, with type SymType. It first tires to get them from Acc, otherwise it infers it from the nodes themselves.
find_free_vars_for_sym_label(SymType::comm | ex, Name::string(), Name::cluster_folding:acc()) -> [string()]
Gets the free variables for the top nodes of the clusters linked to the Name, with type SymType. It first tires to get them from Acc, otherwise it infers it from the nodes themselves.
fold_clusters(Fun, AccIn::Acc, ClustInfo, TreeInfo) -> AccOut::Acc
Folds a function through the frontiers of the clusters in roughly breadth first order. The arguments of the function are:
ClusType - A symbol that represents the type the of
upper cluster of the frontier PH - The place holder of the frontier Children - A list of alternative nodes corresponding
to the place holder of the frontier Acc0 - The accumulator of the folding get_children_from_node_list(ClustType, Cluster, Tree, TreeInfo, Nodes::[Node]) -> [{PH, Children}]
Gets all the children for a list of nodes and maps them to the placeholders on the nodes, (their left alternative if common).
get_frontier_children_from_node_list(ClustType, Cluster, Tree, TreeInfo, Nodes::[Node]) -> [{PH, Children}]
Gets all the children for a list of nodes and maps them to the placeholders on the nodes, (their left alternative if common). It only gets the children that are in a different cluster, not the ones that are in the same.
get_leaf_as_is_or_default(AsymLabel::{ClustType, string()}, Pos::1 | 2, Acc::cluster_folding:acc()) -> boolean()
Obtains information about whether the cluster is a leaf or not. If the information is no there it defaults to false.
get_type_list(ClustInfo::cluster_dicts(), TreeInfo::tree_info()) -> [{ClustType, ClusterDict, Tree | na}]
Returns a list with the correspondence of types, clusters, and trees. This can be used to find in which cluster and in which tree a node is.
is_in_scope(Name, Arity, Inscope1::sets:set({Name, Arity}), Inscope2::sets:set({Name, Arity})) -> boolean()
Returns true if the function specified (Name and Arity) is in both of sets of inscope functions (Inscope1 and Inscope2), or false if it is in none. This implementation does not contemplate that it may be in scope for one and not inscope for another, since that would cause wrong behaviour in the common module.
isolate_type_class(ClustType) -> SymmetricType
Returns the symmetric cluster type. That is, removes the information about which exclusive cluster it is.
merge_environments(Env1::[string()], Env2::[string()]) -> [string()]
Merges the list of free vars of two nodes. It removes the repeated ones.
Generated by EDoc, Nov 5 2015, 16:30:19.