17std::optional<Ref> internal_function_of_axiom(
const Axiom* axiom, Ref meta_args, Ref args) {
44 auto [
mem,
M, N] = mat_ax->args<3>();
45 auto [m, k, l, w] = mat_ax->decurry()->args<4>();
49 if (ext_fun && (w_lit && *w_lit == 64)) {
51 auto fun_app =
world().
app(ds_fun, {
mem, m, k, l,
M, N});
56 if (
auto outer_app = def->isa<
App>()) {
57 if (
auto inner_app = outer_app->callee()->isa<
App>()) {
58 if (
auto axiom = inner_app->callee()->isa<
Axiom>()) {
59 if (
auto internal_function = internal_function_of_axiom(axiom, inner_app->arg(), outer_app->arg())) {
60 world().DLOG(
"lower matrix axiom {} in {} : {}", *axiom->sym(), def, def->
type());
61 world().DLOG(
"lower matrix axiom using: {} : {}", *internal_function, (*internal_function)->type());
62 return *internal_function;
void find_and_replace(std::string &str, std::string_view what, std::string_view repl)
Replaces all occurrences of what with repl.