41#include <unordered_map>
42#include <unordered_set>
45#include "isl_config.h"
75 if (subs.count(
name) != 0)
151 virtual std::vector<std::string>
params()
const override;
180 virtual std::string
to_string()
const override;
181 virtual std::vector<std::string>
params()
const override;
197 return std::string(
"pair<") +
tuple1->to_string() +
", " +
198 tuple2->to_string() +
">";
207static void combine(std::vector<std::string> &vec1,
208 const std::vector<std::string> &vec2)
210 for (
const auto &s : vec2)
211 if (std::find(vec1.begin(), vec1.end(), s) == vec1.end())
212 vec1.emplace_back(s);
221 auto names1 =
tuple1->params();
222 auto names2 =
tuple2->params();
259 :
Base(std::make_shared<
Pair>(left, right))
290 std::vector<std::string>
params;
292 for (
const auto &
tuple : *
this)
306 for (
const auto &
tuple : *
this)
319 std::vector<std::string>
params()
const;
329 std::vector<std::string>
params;
344 std::vector<Kind> applied_args;
347 applied_args.emplace_back(
arg.apply(subs));
349 return {
ret.
apply(subs), applied_args };
356 const std::string &prefix)
362 auto suffix = std::to_string(++
n);
363 auto arg_name = prefix + suffix;
377static bool contains(
const std::vector<std::string> &v,
const std::string &el)
379 return find(v.begin(), v.end(), el) != v.end();
386static std::vector<std::string>
intersect(
const std::vector<std::string> &v1,
387 const std::vector<std::string> &v2)
389 std::vector<std::string> intersection;
391 for (
const auto &el : v1)
393 intersection.push_back(el);
544 { {
Res }, { { }, {
Res }, { }, { }, {
Res }, { } } };
726 bool operator()(
const std::string &x,
const std::string &y)
const {
727 if (x.length() > y. length())
784static const std::unordered_map<std::string, std::vector<Signature>>
796 {
"as_union_map", {
un_map } },
801 {
"bind_domain_wrapped_domain",
804 {
"coalesce",
un_op },
807 {
"curry", {
curry } },
809 {
"detect_equalities",
un_op },
811 {
"domain_factor_domain",
813 {
"domain_factor_range",
838 {
"intersect_domain_wrapped_domain",
841 {
"intersect_range_wrapped_domain",
843 {
"lattice_tile", {
un_set } },
867 {
"plain_multi_val_if_fixed",
871 {
"preimage_domain_wrapped_domain",
876 {
"project_out_all_params",
879 {
"range", {
range } },
880 {
"range_factor_domain",
883 {
"range_lattice_tile", {
un_map } },
887 {
"range_simple_fixed_box_hull",
895 {
"simple_fixed_box_hull",
904 {
"unbind_params_insert_domain",
909 {
"universe",
un_op },
912 {
"wrap", {
wrap } },
979static const std::unordered_map<std::string, std::vector<Kind>>
base_kinds {
1006 if (
pos == std::string::npos)
1008 if (
type.substr(
pos + 1) ==
"list")
1028 (
pos = base.find(
'_')) != std::string::npos &&
1030 base = base.substr(
pos + 1);
1046static std::vector<Kind>
add_name(
const std::vector<Kind> &tuples)
1048 std::vector<Kind> named;
1050 for (
const auto &
tuple : tuples)
1070 if (
name.find(
"multi_") != std::string::npos)
1079 const std::string &
name,
const std::vector<Kind> &class_tuples)
1082 auto super = isl_namespace +
name;
1100 std::set<clang::RecordDecl *> &exported_types,
1101 std::set<clang::FunctionDecl *> exported_functions,
1102 std::set<clang::FunctionDecl *> functions) :
1106 for (
const auto &kvp :
classes) {
1107 const auto &clazz = kvp.second;
1111 if (class_tuples.empty())
1138 os <<
"template <typename...>\n";
1139 os <<
"struct " <<
name <<
";\n";
1147 os <<
"template <typename...Ts>\n";
1148 os <<
"using " <<
name <<
"_on = "
1149 <<
name <<
"<Ts..., Anonymous>;\n";
1158 os <<
" template <typename...>\n";
1169 os <<
"typename " <<
arg;
1177 os << kind->to_string();
1183template <
typename List>
1186 for (
size_t i = 0; i < args.size(); ++i) {
1196template <
typename List>
1207 const std::vector<std::string> &
params)
1218 const std::vector<std::string> &
params)
1294 for (
auto &kvp :
generator.template_classes) {
1298 for (
size_t i = 0; i < class_tuples.size(); ++i)
1314 bool is_declaration);
1327 const Kind &match_arg);
1330 const std::vector<Signature> &signatures);
1335 const std::string &
name);
1341 const Signature &sig,
bool deleted) = 0;
1360 bool is_declaration) :
1374 std::string base(
const std::string &
type,
const Kind &kind)
const;
1376 virtual std::string qualified(
int arg,
const std::string &cpp_type)
1384 const Kind &kind)
const
1386 std::ostringstream ss;
1402 const std::string &cpp_type)
const
1404 if (cpp_type ==
"ctx")
1407 return base(cpp_type, kind(
arg));
1418 virtual Kind kind(
int arg)
const override;
1441 virtual Kind kind(
int arg)
const override;
1453 int n_args = sig.args.size();
1459 return sig.args[
arg];
1469 const Kind &class_kind) :
1471 class_kind(class_kind) {}
1473 virtual std::string class_type(
const std::string &cpp_name)
1484 const std::string &cpp_name)
const
1486 return base(cpp_name, class_kind);
1495 const Method &method,
const Kind &return_kind)
const
1504template <
typename T>
1507 v.erase(v.begin(), v.begin() +
n);
1523 std::vector<std::string> class_params, method_params;
1525 class_params = instance.kind.params();
1526 method_params = class_params;
1529 if (class_params.size() == method_params.size())
1549 print_method_template_arguments(sig);
1573 print_constructors();
1587 const Signature &sig,
bool deleted)
override;
1597 print_method_header(method, sig);
1617 for (
const auto &callback : method.
callbacks) {
1618 auto callback_type = callback->getType();
1621 n += proto->getNumArgs() - 1;
1635 args[0] = instance.
kind;
1636 return { instance.
kind, args };
1648 Method method(clazz, fd, clazz.base_method_name(fd));
1650 print_method_sig(method,
instance_sig(method, instance),
true);
1667 const Signature &sig,
bool deleted)
override;
1679 const auto &base_name = instance.base_name();
1681 os <<
" : " << base_name;
1683 os << method.
fd->getParamDecl(i)->getName().
str();
1700 const std::function<
void(
const std::string &
type,
1701 const std::string &
name)> &print_arg)
1703 auto n_arg = callback->getNumArgs() - 1;
1706 auto type = callback->getArgType(i);
1707 auto name =
"arg" + std::to_string(i);
1708 auto cpptype = type_printer.
param(shift + i,
type);
1710 print_arg(cpptype,
name);
1725 auto callback_type = callback->getType();
1731 [&] (
const std::string &
type,
const std::string &
name) {
1739 [&] (
const std::string &
type,
const std::string &
name) {
1768 for (
const auto &callback : method.
callbacks) {
1788 const auto &base_name = instance.base_name();
1789 auto return_type = method.
fd->getReturnType();
1792 die(
"only isl_bool and isl_stat return types are supported");
1799 os << base_name <<
"::" << method.
name;
1801 auto param = method.
fd->getParamDecl(i);
1805 os << param->getName().str();
1822 const auto &base_name = instance.base_name();
1825 os <<
" auto res = ";
1826 os << base_name <<
"::" << method.
name;
1828 os << method.
fd->getParamDecl(i)->getName().
str();
1833 print_return_type(method, sig.
ret);
1857 print_method_header(method, sig);
1860 print_constructor_body(method, sig);
1862 print_callback_method_body(method, sig);
1864 print_method_body(method, sig);
1938static const std::unordered_map<std::string, std::vector<Signature>>
1952 return print_matching_method(method, sigs);
1965 return class_tuples[0].is_anon();
1975 return class_tuples.size() == 1 && class_tuples[0].is_anon_set();
1991 auto name = general->name;
2016 if (general->left() && !specific->left())
2018 if (general->left())
2019 return update_sub(
sub, general->left(), specific->left()) &&
2023 if (general ==
Leaf && specific->left())
2039 const Kind &specific)
2043 if (general.size() != specific.size())
2046 for (
size_t i = 0; i < general.size(); ++i) {
2047 auto general_tuple = general[i];
2070 for (
const auto &special : class_tuples)
2073 class_tuples.emplace_back(kind);
2082 virtual std::string qualified(
int arg,
const std::string &cpp_type)
2093 const std::string &cpp_type)
const
2141 if (class_tuple.size() == kind.size())
2153 const Method &method,
const Kind &return_kind)
2159 return return_kind.
params().size() == 0;
2189 res.emplace(kind1->name, kind2);
2202 for (
const auto &kvp : first)
2203 res.emplace(kvp.first,
apply(kvp.second, second));
2222 auto k1 =
apply(kind1, unifier);
2223 auto k2 =
apply(kind2, unifier);
2244 if (unifier_left.size() == 0)
2267 if (kind1->left() && !kind2->left())
2268 return assign(kind2, kind1);
2269 if (!kind1->left() && kind2->left())
2270 return assign(kind1, kind2);
2271 if (!kind1->left() && !kind2->left()) {
2273 return assign(kind1, kind2);
2275 return assign(kind2, kind1);
2299 if (kind1.size() != kind2.size())
2302 for (
size_t i = 0; i < kind1.size(); ++i)
2321 return {
true, general };
2324 auto renamed = specific.
apply(rename);
2327 if (unifier.size() == 0)
2328 return {
false, { } };
2330 return {
true, general.
apply(unifier) };
2347 auto maybe_unified =
unify(kind, instance.kind);
2349 if (!maybe_unified.first)
2351 instance.template_class.add_specialization(maybe_unified.second);
2365 ParmVarDecl *param = method.
get_param(i);
2366 QualType
type = param->getOriginalType();
2369 const auto &
name =
type->getPointeeType().getAsString();
2375 return tuples[0].is_anon();
2391 const Kind &arg_kind,
const Kind &instance_kind)
2394 const auto &specialized_instance = instance_kind.
apply(subs);
2396 if (!
specializer(specialized_instance, instance_kind).first)
2399 return sig.
apply(subs);
2409 const Method &method,
const Kind &instance_kind)
2411 auto specialized_sig = sig;
2414 const auto &arg_kind = sig.
args[
arg];
2416 if (arg_kind.is_anon())
2421 arg_kind, instance_kind);
2424 return specialized_sig;
2451 auto renamed_arg = match_arg.
apply(rename);
2452 auto maybe_specializer =
specializer(renamed_arg, instance.kind);
2453 if (maybe_specializer.first) {
2454 const auto &
specializer = maybe_specializer.second;
2457 method, instance.
kind);
2458 if (!is_return_kind(method, specialized_sig.ret))
2461 print_method_sig(method, specialized_sig,
false);
2463 add_specialization(match_arg);
2465 return maybe_specializer.first;
2479 return sig.
args[0].size() > 0 && sig.
args[0][0] ==
Ctx;
2500 int n_args = sig.
args.size();
2502 if (match_arg.size() != instance.kind.size())
2509 return print_matching_method(method, sig, match_arg);
2520 const Method &method,
const std::vector<Signature> &signatures)
2524 for (
const auto &sig : signatures)
2525 if (print_matching_method(method, sig))
2529 print_method_sig(method,
instance_sig(method, instance),
true);
2562 auto anon = instance.template_class.is_anon();
2564 auto return_class =
generator.template_classes.at(return_type);
2566 if (!anon && return_class.is_anon())
2567 return print_matching_method(method,
at_select);
2569 return print_matching_method(method,
at_keep);
2576 return s.find(
sub) != std::string::npos;
2591 if (special_methods.count(method.
name) == 0)
2594 for (
const auto &kvp : special_methods.at(method.
name)) {
2595 if (!
contains(instance.template_class.class_name, kvp.first))
2597 print_matching_method(method, kvp.second);
2633 const Method &method,
const std::string &
name)
2646 const std::string &
sub)
2651 if (
pos != std::string::npos)
2661 const std::string &
sub)
2690 auto arg_type =
plain_type(callback->getArgType(0));
2707 if (method.
name ==
"at")
2708 return print_at_method(method);
2709 if (print_special_member_method(method))
2711 if (print_type_named_member_method(method))
2713 if (print_member_method_with_name(method, method.
name))
2717 if (print_member_method_with_name(method,
callback_name(method)))
2726 switch (method.
kind) {
2728 print_static_method(method);
2731 print_constructor(method);
2734 print_member_method(method);
2756 print_any_method(method);
2770 const std::vector<std::string> &
params)
const;
2797 const std::vector<std::string> &
params)
const
2799 const auto &class_name = instance.
class_name();
2801 auto derived = instance.
kind.
apply(rename);
2807 os <<
" typename std::enable_if<\n";
2808 for (
size_t i = 0; i <
params.size(); ++i) {
2811 os <<
" std::is_base_of<"
2816 os <<
" bool>::type = true>";
2818 os <<
" " << class_name <<
"(const ";
2820 os <<
" &obj) : " << instance.
base_name() <<
"(obj) {}\n";
2848 const auto &base_name = instance.
base_name();
2849 const auto &arg_name = hide ?
"base" : base_name;
2852 os <<
" private:\n";
2853 os <<
" template <typename base,\n";
2854 os <<
" typename std::enable_if<\n";
2855 os <<
" std::is_same<base, " << base_name
2856 <<
">{}, bool>::type = true>\n";
2859 <<
"(const " << arg_name <<
" &obj) : "
2860 << base_name <<
"(obj) {}\n";
2863 os <<
" static " << instance.
class_name() <<
" from"
2864 <<
"(const " << base_name <<
" &obj) {\n";
2865 os <<
" return " << instance.
class_name() <<
"(obj);\n";
2897 const auto &class_name = instance.
class_name();
2906 os <<
" : public " << instance.
base_name() <<
" {\n";
2911 os <<
" " << class_name <<
"() = default;\n";
2913 print_arg_subclass_constructor(instance,
params);
2914 print_super_constructor(instance);
2955 ostream &os = std::cout;
static string type2cpp(const isl_class &clazz)
static void die(const char *msg) __attribute__((noreturn))
static bool is_callback(QualType type)
static bool is_isl_type(QualType type)
static int prototype_n_args(QualType type)
static std::string drop_suffix(const std::string &s, const std::string &suffix)
static bool is_isl_bool(QualType type)
static bool is_isl_stat(QualType type)
static bool first_arg_is_isl_ctx(FunctionDecl *fd)
map< string, isl_class > classes
static const FunctionProtoType * extract_prototype(QualType type)
std::map< std::string, template_class > template_classes
virtual void generate() override
void foreach_template_class(const std::function< void(const template_class &)> &fn) const
void add_template_class(const isl_class &clazz, const std::string &name, const std::vector< Kind > &class_tuples)
void print_friends(std::ostream &os)
template_cpp_generator(clang::SourceManager &SM, std::set< clang::RecordDecl * > &exported_types, std::set< clang::FunctionDecl * > exported_functions, std::set< clang::FunctionDecl * > functions)
void print_forward_declarations(std::ostream &os)
std::set< FunctionDecl *, function_name_less > function_set
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
void GMPZAPI() sub(mp_int rop, mp_int op1, mp_int op2)
static int n_arg(struct isl_arg *arg)
static int find(int *con, unsigned len, int status)
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
static isl_bool match(__isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, enum isl_dim_type type2)
static bool any(const std::vector< bool > &vector)
std::vector< std::string > params() const
Kind apply(const Substitution &subs) const
virtual int num_params() const
static void print_arg_list(std::ostream &os, int start, int end, const std::function< bool(int i)> &print_arg_skip_next)
const std::vector< ParmVarDecl * > callbacks
virtual clang::ParmVarDecl * get_param(int pos) const
void print_cpp_arg_list(std::ostream &os, const std::function< void(int i, int arg)> &print_arg) const
void on_cpp_arg_list(const list_combiner &combiner, const std::function< void(int i, int arg)> &on_arg) const
virtual std::vector< std::string > params() const override
virtual TupleKindPtr apply(const Substitution &match, const TupleKindPtr &self) const override
virtual std::string to_string() const override
const TupleKindPtr tuple1
Pair(const TupleKindPtr &tuple1, const TupleKindPtr &tuple2)
virtual TupleKindPtr right() const override
virtual TupleKindPtr left() const override
const TupleKindPtr tuple2
ProperTupleKind(const std::string &name)
virtual std::vector< std::string > params() const override
std::vector< std::string > params() const
Signature apply(const Substitution &match) const
std::shared_ptr< const TupleKind > Base
virtual std::vector< std::string > params() const
virtual std::string to_string() const
virtual TupleKindPtr right() const
virtual TupleKindPtr apply(const Substitution &subs, const TupleKindPtr &self) const
virtual TupleKindPtr left() const
void print_method_header(const Method &method, const cpp_type_printer &type_printer)
std::string param(int arg, QualType type) const
std::string return_type(const Method &method) const
virtual std::string qualified(int arg, const std::string &cpp_type) const
virtual std::string isl_namespace() const
bool operator()(const std::string &x, const std::string &y) const
virtual std::string qualified(int arg, const std::string &cpp_type) const override
template_cpp_generator & generator
void print_classes() const
virtual void print_class(const specialization &instance) const =0
specialization_printer(std::ostream &os, template_cpp_generator &generator)
const std::string & class_name() const
const std::string & base_name() const
struct template_class & template_class
void add_specialization(const Kind &kind)
std::vector< Kind > class_tuples
const std::string class_name
const std::string super_name
template_cpp_arg_type_printer(const Signature &sig)
virtual Kind kind(int arg) const override
void print_super_constructor(const specialization &instance) const
class_decl_printer(std::ostream &os, template_cpp_generator &generator)
void print_arg_subclass_constructor(const specialization &instance, const std::vector< std::string > ¶ms) const
virtual void print_class(const specialization &instance) const override
class_impl_printer(std::ostream &os, template_cpp_generator &generator)
virtual void print_class(const specialization &instance) const override
class_printer(const specialization &instance, const specialization_printer &instance_printer, bool is_declaration)
void print_method_header(const Method &method, const Signature &sig)
void print_at_method(const Method &method)
virtual void print_method(const Method &method) override
void print_any_method(const Method &method)
bool print_special_member_method(const Method &method)
void print_static_method(const Method &method)
template_cpp_generator & generator
bool print_type_named_member_method(const Method &method)
void add_specialization(const Kind &kind)
virtual bool want_descendent_overloads(const function_set &methods) override
const specialization & instance
bool is_return_kind(const Method &method, const Kind &return_kind)
virtual void print_method_sig(const Method &method, const Signature &sig, bool deleted)=0
void print_member_method(const Method &method)
bool print_matching_method(const Method &method, const Signature &sig, const Kind &match_arg)
bool print_special_method(const Method &method, const infix_map_map &special_methods)
void print_return_type(const Method &method, const Kind &kind) const
void print_constructor(const Method &method)
void print_method_template_arguments(const Signature &sig)
bool print_member_method_with_name(const Method &method, const std::string &name)
virtual void print_method_sig(const Method &method, const Signature &sig, bool deleted) override
virtual void print_get_method(FunctionDecl *fd) override
method_decl_printer(const specialization &instance, const struct specialization_printer &instance_printer)
virtual void print_get_method(FunctionDecl *fd) override
void print_method_body(const Method &method, const Signature &sig)
virtual void print_method_sig(const Method &method, const Signature &sig, bool deleted) override
method_impl_printer(const specialization &instance, const struct specialization_printer &instance_printer)
void print_callback_method_body(const Method &method, const Signature &sig)
void print_constructor_body(const Method &method, const Signature &sig)
virtual Kind kind(int arg) const override
template_cpp_kind_type_printer(const Kind &kind)
virtual Kind kind(int arg) const =0
std::string base(const std::string &type, const Kind &kind) const
virtual std::string qualified(int arg, const std::string &cpp_type) const override
template_cpp_type_printer()
template_method_type_printer(const Signature &sig, const Kind &class_kind)
virtual std::string class_type(const std::string &cpp_name) const override
static Signature anonymous_set_from_params_bin_anon
static Signature domain_map
static Signature range_factor_domain
static Signature set_from_params
static Substitution compose(const Substitution &first, const Substitution &second)
static std::vector< Signature > min_max
static Signature ter_set_int_int
static Signature to_list_map
static std::vector< Signature > at_select
static Signature anonymize_nested_range
static void print_bare_template_type(std::ostream &os, const std::string &type, const Kind &kind)
static std::vector< Signature > range_op
static Signature anonymous_map_from_domain
static Signature update_domain
static std::vector< Signature > set_at
static Signature each_scc_params
static Signature set_at_set
static void print_callback_lambdas(std::ostream &os, const Method &method, const Signature &sig)
static std::vector< Signature > bin_op
static void print_callback_args(std::ostream &os, const FunctionProtoType *callback, const cpp_type_printer &type_printer, int shift, const std::function< void(const std::string &type, const std::string &name)> &print_arg)
static Signature domain_factor_domain
static Signature map_product
static void print_template(std::ostream &os, const std::vector< std::string > ¶ms)
static Signature specialize_anonymous_arg(const Signature &sig, const Kind &arg_kind, const Kind &instance_kind)
static Substitution shared_param_renamer(const Signature &sig, const Kind &kind)
static Signature bin_params_anon
static Signature instance_sig(const Method &method, const specialization &instance)
static Signature add_range_named
static TupleKindPtr Range2("Range2")
static Signature bin_map_params
static Signature replace_nested_domain
static const std::unordered_map< std::string, std::vector< Signature > > member_methods
static Signature bin_set_params
static Signature bin_map_range_wrapped_domain
static Signature set_params
static Signature ter_params_int_int
static Signature replace_nested_range
static std::map< Kind, Kind > anon_to_named
static std::vector< Signature > fn_ter_op
static Signature update_range
static std::string drop_occurrence(const std::string &str, const std::string &sub)
static Signature to_set_named
static Signature domain_forward
static bool update_sub(Substitution &sub, const TupleKindPtr &general, const TupleKindPtr &specific)
static TupleKindPtr Integer
static Signature each_scc_set
static std::vector< Signature > flatten_domain
static Signature anonymize_nested_domain
static std::vector< Signature > at_keep
static std::string plain_return_type(const Method &method)
static std::string plain_type(QualType type)
static TupleKindPtr Domain2("Domain2")
static void print_template_arg(std::ostream &os, const std::string &arg)
static bool equivalent(const Kind &kind1, const Kind &kind2)
static Signature bin_map_domain
static Signature bind_set
static Signature set_forward
static Signature bin_set_anon
static Signature range_product
static Signature each_map
static TupleKindPtr Domain("Domain")
static std::vector< Signature > fn_un_op
static std::vector< Signature > anonymous_from_domain_bin_anon
static Signature transformation_domain
static Signature alloc_set
static Signature range_forward
static Signature from_list_map
static Signature map_reverse
static const std::unordered_set< std::string > type_prefixes
static void print_non_empty_template(std::ostream &os, const std::vector< std::string > ¶ms)
static TupleKindPtr apply(const TupleKindPtr tuple, const Substitution &subs)
static Signature each_set
static std::vector< Signature > each
static Signature set_product
static void drop_initial(std::vector< T > &v, size_t n)
static std::vector< Signature > flatten_range
static std::vector< Signature > bin_op_anon
static std::vector< Signature > ter_int_int
static Signature bin_map_domain_wrapped_domain
static TupleKindPtr Range("Range")
static Signature alloc_params
static Signature select_map
static Signature map_from_str
static Signature domain_product
static Signature domain_wrapped_domain_backward
static Signature map_from_domain_and_range
static TupleKindPtr Anonymous("Anonymous")
static std::vector< Kind > add_name(const std::vector< Kind > &tuples)
static bool has_kind(const template_class &template_class, const Kind &kind)
static bool first_arg_is_ctx(const Method &method)
static Signature add_range
static Signature bin_map_range
static void print_callback_lambda(std::ostream &os, ParmVarDecl *callback, const Signature &sig, int shift)
static Signature bin_set_int
static Signature from_list_set
static std::vector< Signature > from_str
static Substitution combine_unifiers(const TupleKindPtr &kind1, const TupleKindPtr &kind2, const Substitution &unifier)
static std::string base_type(const std::string &type)
static Signature ter_map_int_int
static Signature bin_map_anon
static Signature range_backward
static Signature set_join
static std::vector< Signature > anonymous_from_domain
static Substitution compute_pair_unifier(const TupleKindPtr &kind1, const TupleKindPtr &kind2)
static Signature anonymous_set_from_params
static Signature map_params
static Signature select_set
static TupleKindPtr Range3("Range3")
static void print_pure_template_args(std::ostream &os, const List &args)
static Signature bin_map_int
std::map< std::string, std::vector< Signature >, larger_infix > infix_map
static Signature update_set
static TupleKindPtr Leaf("Leaf")
std::map< std::string, infix_map > infix_map_map
static void combine(std::vector< std::string > &vec1, const std::vector< std::string > &vec2)
const std::string name_without_return(const Method &method)
static std::vector< Signature > un_op
static Substitution compute_unifier(const TupleKindPtr &kind1, const TupleKindPtr &kind2)
static const Kind & matching_kind(const Method &method, const Signature &sig)
static std::string drop_list(const std::string &type)
static Signature set_from_str
static Signature alloc_map
static Signature map_from_range_and_domain
static std::string drop_underscore_occurrence(const std::string &str, const std::string &sub)
static bool param_is_anon(const Method &method, int i)
static Signature range_factor_range
const std::string callback_name(const Method &method)
static Substitution param_renamer(const std::vector< std::string > ¶ms, const std::string &prefix)
static Signature int_from_si
static std::vector< Signature > each_scc
static bool assignable(const TupleKindPtr &kind)
static const std::unordered_map< std::string, std::vector< Kind > > base_kinds
static Signature set_to_map
static std::vector< Signature > bin_val
static Signature anonymous_map_from_domain_bin_anon
static Signature bind_range
static Substitution assign(const TupleKindPtr &kind1, const TupleKindPtr &kind2)
static bool contains(const std::vector< std::string > &v, const std::string &el)
static Signature params_from_str
static std::vector< Signature > fn_bin_op
static Signature bin_params
static Signature to_list_set
static const infix_map_map special_member_methods
static Signature map_range_reverse
static int total_params(const Method &method)
static Signature specialize_anonymous_args(const Signature &sig, const Method &method, const Kind &instance_kind)
static const std::unordered_map< std::string, std::vector< Signature > > special_constructors
static bool update_sub_base(Substitution &sub, const TupleKindPtr &general, const TupleKindPtr &specific)
static Signature each_scc_map
static const infix_map_map static_methods
static Signature each_params
static Signature set_at_map
static std::vector< Signature > fn_domain
static std::pair< bool, Kind > unify(const Kind &general, const Kind &specific)
static bool first_kind_is_ctx(const Signature &sig)
static Signature bind_domain
static Signature bind_domain_wrapped_domain
static Signature domain_backward
static Signature set_backward
static std::vector< Kind > lookup_class_tuples(const std::string &name)
static Signature ctx_params
static TupleKindPtr Domain3("Domain3")
static Signature un_params
static std::vector< std::string > intersect(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
static Signature domain_factor_range
static void print_template_args(std::ostream &os, const List &args)
static std::vector< Signature > constructor_sig
static Signature range_map
static std::pair< bool, Substitution > specializer(const Kind &general, const Kind &specific)
std::unordered_map< std::string, TupleKindPtr > Substitution