Solidity_asttype ident = Solidity_common.Ident.t Solidity_common.nodeGeneric identifiers
type longident =
  Solidity_common.relative Solidity_common.LongIdent.t Solidity_common.nodeContext relative identifiers
type program = {program_modules : module_ list;program_modules_by_id : module_ Solidity_common.IdentMap.t;program_modules_by_file : module_ Solidity_common.StringMap.t;}The program definition. Modules (files) are sorted in different ways, but they all are the same.
and module_ = {module_file : string;module_id : Solidity_common.Ident.t;module_units : module_units;}A file definition
and module_units = source_unit Solidity_common.node listand source_unit = | Pragma of Solidity_common.Ident.t * stringOptions for the official solidity compiler
*)| Import of import_directiveImport directive
*)| GlobalTypeDefinition of type_definitionDefinition of a type for the whole file
*)| GlobalFunctionDefinition of function_definitionDefinition of a function for the whole file
*)| GlobalVariableDefinition of state_variable_definitionDefinition of a variable for the whole file
*)| ContractDefinition of contract_definitionDefinition of a contract
*)The different kind of contents.
and import_directive = {import_pos : Solidity_common.pos;import_from : string;import_symbols : import_symbols;}and contract_definition = {contract_name : ident;contract_kind : contract_kind;contract_abstract : bool;contract_inheritance : inheritance_specifier list;contract_parts : contract_part Solidity_common.node list;}and inheritance_specifier = longident * expression listand contract_part = | TypeDefinition of type_definitionDefinition of a local type ; can be an enum or a struct
*)| StateVariableDeclaration of state_variable_definitionDeclaration/definition of a state variable
*)| FunctionDefinition of function_definitionDeclaration/definition of a state variable
*)| ModifierDefinition of modifier_definitionDefinition of a modifier
*)| EventDefinition of event_definitionDefinition of an event
*)| UsingForDeclaration of longident * type_ optionComponents of a contract
and struct_definition = ident * field_definition listand state_variable_definition = {var_name : ident;var_type : type_;var_visibility : visibility;var_mutability : var_mutability;var_override : longident list option;var_init : expression option;var_static : bool;}Definition of a state variable. Its initializer is optional, in which case it is only a declaration.
and function_definition = {fun_name : ident;fun_params : param list;fun_returns : return list;fun_modifiers : (longident * expression list option) list;fun_visibility : visibility;fun_mutability : fun_mutability;fun_override : longident list option;fun_virtual : bool;fun_inline : bool;fun_responsible : bool;fun_body : block option;}Definition of a contract function. Its body is optional, in which case it is only a declaration.
and modifier_definition = {mod_name : ident;mod_params : param list;mod_override : longident list option;mod_virtual : bool;mod_body : block option;}Definition of a modifier. Its body is optional, in which case it is only a declaration.
and param = type_ * storage_location option * ident optionand return = type_ * storage_location option * ident optionand type_ = | ElementaryType of elementary_typeA builtin elementary type
*)| Array of type_ * expression optionArray types
*)| Mapping of type_ * type_Type of mappings with types (key, element)
*)| FunctionType of function_typeType of functions
*)| UserDefinedType of longidentUser defined type (see type_definition)
*)| Optional of type_ listType identifiers
and function_type = {fun_type_params : param list;fun_type_returns : (type_ * storage_location option) list;fun_type_visibility : visibility;fun_type_mutability : fun_mutability;}and statement = raw_statement Solidity_common.nodeand raw_statement = | Block of blockAn ordered list of statements
*)| VariableDefinition of variable_definitionLocal variable definition
*)| ExpressionStatement of expressionSingle expression returning nothing
*)| IfStatement of expression * statement * statement optionIf-then-else statement; else is optional
*)| WhileStatement of expression * statementWhile loop; expression is the boolean condition, statement is its body
*)| DoWhileStatement of statement * expressionDo while loop; expression is the boolean condition, statement is its body
*)| ForStatement of statement option
  * expression option
  * expression option
  * statementFor loop ; the first statement is the initializer, the next expression is the condition, the third is the for action and the last statement the loop body.
*)| TryStatement of expression * return list * block * catch_clause listTry-catch statement
*)| Emit of expression * function_call_argumentsEvent emission
*)| Return of expression option * (ident * expression) listReturn statement (second part only on FreeToN)
*)| ContinueContinue (loop statement)
*)| BreakBreak (loop statement)
*)| PlaceholderStatementPlaceholder for modifiers
*)| RepeatStatement of expression * statement| ForRangeStatement of (type_ * storage_location option * ident) option list
  * expression
  * statementand expression = raw_expression Solidity_common.nodeand raw_expression = | BooleanLiteral of bool| NumberLiteral of Q.t * number_unit * int option| StringLiteral of string| AddressLiteral of string| IdentifierExpression of ident| ImmediateArray of expression list| ArrayAccess of expression * expression option| ArraySlice of expression * expression option * expression option| TupleExpression of expression option list| PrefixExpression of unary_operator * expression| SuffixExpression of expression * unary_operator| CompareExpression of expression * compare_operator * expression| BinaryExpression of expression * binary_operator * expression| AssignExpression of expression * expression| AssignBinaryExpression of expression * binary_operator * expression| IfExpression of expression * expression * expression| FieldExpression of expression * ident| FunctionCallExpression of expression * function_call_arguments| CallOptions of expression * (ident * expression) list| NewExpression of type_| TypeExpression of type_| SetOfArgs of expression listand block = statement listand variable_definition = | VarInfer of ident option list * expressionVariable without type
*)| VarType of (type_ * storage_location option * ident) option list
  * expression optionTyped variable
*)and function_call_arguments = | ExpressionList of expression listAnonymous arguments
*)| NameValueList of (ident * expression) listNamed arguments
*)val is_contract : contract_kind -> boolval is_library : contract_kind -> boolval is_interface : contract_kind -> boolval is_mutable : var_mutability -> boolval is_constant : var_mutability -> boolval is_immutable : var_mutability -> boolval is_payable : fun_mutability -> boolval is_nonpayable : fun_mutability -> boolval is_external : visibility -> boolval is_internal : visibility -> boolval is_private : visibility -> boolval is_public : visibility -> boolval is_inheritable : visibility -> boolTrue iff not private
val same_mutability : fun_mutability -> fun_mutability -> boolChecks the equality of mutabilities
val mutability_is_more_restrictive : fun_mutability -> fun_mutability -> boolChecks if the first mutability is more restrictive than the second mutability according to https://docs.soliditylang.org/en/v0.6.0/types.html#function-types
val convertible_mutability : from:fun_mutability -> to_:fun_mutability -> boolTests if a function with `from` mutability can be overridden by a function with `to` mutability.
val same_visibility : visibility -> visibility -> boolChecks the equality of visibilities
val convertible_visibility_hof : visibility -> visibility -> boolChecks if a function expecting the second visibility can accept function arguments (of function type) of the first visibility
val convertible_visibility : from:visibility -> to_:visibility -> boolTests if a function with `from` visibility can be overridden by a function with `to` visibility.
val apply_unit : Q.t -> number_unit -> Q.tReturns the quantity in argument with the unit in argument in the smallest quantity of the language of the similar unit. Examples: * `apply_unit 1 Minutes = 60 (Seconds)` * `apply_unit 1 Ether = 1e15 (Wei)` * `apply_unit 1 Unit = 1 (Unit)`
val apply_unop : unary_operator -> Q.t -> Q.t optionApply the unary operator in argument to a zarith rational. Returns `None` when applying UNot on non-integers If the operator is not an arithmetical operator, also returns `None`.
val apply_binop : Q.t -> binary_operator -> Q.t -> Q.t optionApply the binary operator in argument to a zarith rational. If the operator is not an arithmetical operator, returns `None`.