37# include <gtest/gtest.h>
Stable type graph for the compiler-support MVP.
Context owning all compiler type nodes.
void set_struct_fields(const Compiler_Type_Id id, const DynArray< std::string > &field_names, const DynArray< Compiler_Type_Id > &field_types) const
Assigns field metadata to a previously created struct type.
bool is_type_variable(const Compiler_Type_Id id) const
Returns whether id names a type variable.
Compiler_Type_Id string_type() const noexcept
Returns the preloaded String type id.
size_t builtin_count() const noexcept
Returns the number of eager built-in types.
size_t size() const noexcept
Returns the total number of stored types.
std::string to_string(const Compiler_Type_Id id) const
Renders one type to a deterministic human-readable string.
bool is_struct(const Compiler_Type_Id id) const
Returns whether id names a nominal struct type.
Compiler_Type_Id make_enum_type(std::string name)
Creates a nominal enum type placeholder.
const Compiler_Type & type(const Compiler_Type_Id id) const
Returns type id.
Compiler_Type_Id invalid_type() const noexcept
Returns the preloaded Invalid type id.
void set_enum_variants(const Compiler_Type_Id id, const DynArray< std::string > &variant_names) const
Assigns variant metadata to a previously created enum type.
Compiler_Type_Id make_type_variable(std::string label="", const bool rigid=false)
Creates a fresh type variable.
Compiler_Type_Id make_tuple_type(const DynArray< Compiler_Type_Id > &members)
Creates a tuple type.
Compiler_Type_Id make_function_type(const DynArray< Compiler_Type_Id > ¶meters, const Compiler_Type_Id result)
Creates a function type.
Compiler_Type_Id character_type() const noexcept
Returns the preloaded Char type id.
void clear() noexcept
Drops user-created types and keeps the built-ins.
Compiler_Type_Id unit_type() const noexcept
Returns the preloaded Unit type id.
bool is_enum(const Compiler_Type_Id id) const
Returns whether id names a nominal enum type.
Compiler_Type_Id bool_type() const noexcept
Returns the preloaded Bool type id.
Compiler_Type_Id integer_type() const noexcept
Returns the preloaded Int type id.
Compiler_Type_Id make_struct_type(std::string name)
Creates a nominal struct type placeholder.
size_t size() const noexcept
Return the current dimension of array.
T & access(const size_t i) const noexcept
Fast access without checking allocation and bound_min_clock checking.
T & append()
Allocate a new entry to the end of array.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
static long & color(typename GT::Node *p)
DynArray< Compiler_Type_Id > components
Tuple members, function parameters, or struct field types.
DynArray< std::string > member_names
Struct field names or enum variant names.