package asli
Install
Dune Dependency
Authors
Maintainers
Sources
md5=f4581fd209256823fa4d569ac96c8cee
sha512=fd4a74294beb9eeeafa80c9224b5dc30f5e5ebde4d53fa601929d283b6ca72154de313874321774914f738ac6f0d640e59452f7d03cb1db7b3a019b48b82e0d4
doc/asli.libASL/LibASL/Asl_utils/index.html
Module LibASL.Asl_utils
Source
ASL utility functions
Bindings and IdentSet
add association list to bindings
create bindings from association list
print bindings
merge a list of sets
val addToBindingSet :
AST.ident ->
AST.ident ->
IdentSet.t Bindings.t ->
IdentSet.t Bindings.t
add v to set of identifiers mapped to k
convert identifier set to sorted list of identifiers
The implementation is trivial and exists mostly to emphasize that the resulting list is sorted
Equivalence classes
Equivalence classes are represented by trees.
The root of the tree is the canonical member of the class. Traversing the parent node takes you closer to the canonical member. The root is its own parent.
Equivalence class support (to support unification, and similar)
The implementation is based on Wikipedia: Union-Find. I have not implemented all the optimizations they suggest because I expect sets to be quite small in practice.
AST Transformation Utilities
Calculating free variables of expressions and types
Calculating assigned variables in statements
Collect local bindings (variables and constants)
Calculate types used in expressions and statements
Calculate functions and procedures called in statements
Substitutions
Performing variable substitutions in expressions and types
More flexible substitution class - takes a function instead of a binding set.
Expression transformation
Expression transformation class
Resugaring
Resugaring transform
Pretty printing wrappers
Misc
Length of bitstring or mask literal.
ASL bit and mask literals allow spaces to be included - these do not count towards the length of the literal.
- Bindings and IdentSet
- Equivalence classes
-
AST Transformation Utilities
- Calculating free variables of expressions and types
- Calculating assigned variables in statements
- Collect local bindings (variables and constants)
- Calculate types used in expressions and statements
- Calculate functions and procedures called in statements
- Substitutions
- Expression transformation
- Resugaring
- Pretty printing wrappers
- Misc