// Scyla Language Converter — Mapping Tables
// Python/PyTorch/NumPy/SciPy → Scyla equivalents
//
// Each mapping: "python_pattern|scyla_replacement|category"
// Categories: "tensor", "math", "activation", "loss", "training", "nn", "syntax"
//
// Aislinn McCubbins, April 2026

fn get_tensor_mappings() -> Array {
    let m = array_new()

    // ── NumPy: creation ──
    m = array_push(m, "numpy.zeros|t_zeros|tensor")
    m = array_push(m, "np.zeros|t_zeros|tensor")
    m = array_push(m, "numpy.ones|t_ones|tensor")
    m = array_push(m, "np.ones|t_ones|tensor")
    m = array_push(m, "np.array|t_create|tensor")
    m = array_push(m, "numpy.array|t_create|tensor")
    m = array_push(m, "np.empty|t_zeros|tensor")
    m = array_push(m, "np.full|t_ones|tensor")
    m = array_push(m, "np.zeros_like|t_zeros|tensor")
    m = array_push(m, "np.ones_like|t_ones|tensor")
    m = array_push(m, "np.eye|t_zeros|tensor")
    m = array_push(m, "np.linspace|t_zeros|tensor")
    m = array_push(m, "np.arange|t_zeros|tensor")

    // ── NumPy: random ──
    m = array_push(m, "np.random.randn|t_rand|tensor")
    m = array_push(m, "np.random.rand|t_rand|tensor")
    m = array_push(m, "np.random.normal|t_rand|tensor")
    m = array_push(m, "np.random.uniform|t_rand|tensor")
    m = array_push(m, "np.random.randint|t_rand|tensor")
    m = array_push(m, "np.random.choice|t_multinomial|tensor")
    m = array_push(m, "np.random.seed|// rng seed (manual)|tensor")
    m = array_push(m, "numpy.random.randn|t_rand|tensor")
    m = array_push(m, "numpy.random.rand|t_rand|tensor")

    // ── NumPy: math ops ──
    m = array_push(m, "numpy.matmul|t_matmul|tensor")
    m = array_push(m, "np.matmul|t_matmul|tensor")
    m = array_push(m, "np.dot|t_matmul|tensor")
    m = array_push(m, "numpy.dot|t_matmul|tensor")
    m = array_push(m, "np.sum|tensor_sum|tensor")
    m = array_push(m, "numpy.sum|tensor_sum|tensor")
    m = array_push(m, "np.mean|t_mean|tensor")
    m = array_push(m, "numpy.mean|t_mean|tensor")
    m = array_push(m, "np.var|t_var|tensor")
    m = array_push(m, "numpy.var|t_var|tensor")
    m = array_push(m, "np.std|t_var|tensor")
    m = array_push(m, "np.cumsum|t_cumsum|tensor")
    m = array_push(m, "np.add|t_add|tensor")
    m = array_push(m, "np.subtract|t_sub|tensor")
    m = array_push(m, "np.multiply|t_mul|tensor")
    m = array_push(m, "np.negative|t_neg|tensor")
    m = array_push(m, "np.abs|t_abs|tensor")
    m = array_push(m, "numpy.abs|t_abs|tensor")
    m = array_push(m, "np.absolute|t_abs|tensor")
    m = array_push(m, "np.sqrt|t_sqrt|tensor")
    m = array_push(m, "numpy.sqrt|t_sqrt|tensor")
    m = array_push(m, "np.exp|t_exp|tensor")
    m = array_push(m, "numpy.exp|t_exp|tensor")
    m = array_push(m, "np.log|t_log|tensor")
    m = array_push(m, "numpy.log|t_log|tensor")
    m = array_push(m, "np.log2|t_log|tensor")
    m = array_push(m, "np.log10|t_log|tensor")

    // ── NumPy: shape ops ──
    m = array_push(m, "np.reshape|t_reshape|tensor")
    m = array_push(m, "numpy.reshape|t_reshape|tensor")
    m = array_push(m, ".reshape(|t_reshape(|tensor")
    m = array_push(m, "np.transpose|t_transpose|tensor")
    m = array_push(m, "numpy.transpose|t_transpose|tensor")
    m = array_push(m, ".T|t_transpose|tensor")
    m = array_push(m, "np.concatenate|t_cat|tensor")
    m = array_push(m, "numpy.concatenate|t_cat|tensor")
    m = array_push(m, "np.stack|t_cat|tensor")
    m = array_push(m, "np.vstack|t_cat|tensor")
    m = array_push(m, "np.hstack|t_cat|tensor")
    m = array_push(m, "np.expand_dims|t_unsqueeze|tensor")
    m = array_push(m, "numpy.expand_dims|t_unsqueeze|tensor")
    m = array_push(m, "np.squeeze|t_reshape|tensor")
    m = array_push(m, "np.argmax|t_argmax|tensor")
    m = array_push(m, "numpy.argmax|t_argmax|tensor")
    m = array_push(m, "np.clip|t_clamp|tensor")
    m = array_push(m, "numpy.clip|t_clamp|tensor")
    m = array_push(m, "np.where|t_where|tensor")
    m = array_push(m, "numpy.where|t_where|tensor")
    m = array_push(m, "np.linalg.norm|t_norm|tensor")
    m = array_push(m, "np.shape|tensor_shape|tensor")
    m = array_push(m, ".shape|tensor_shape|tensor")
    m = array_push(m, "np.size|tensor_len|tensor")
    m = array_push(m, "np.greater|t_gt|tensor")
    m = array_push(m, "np.less|t_lt|tensor")

    // ── NumPy: FFT ──
    m = array_push(m, "np.fft.rfft|rfft|tensor")
    m = array_push(m, "numpy.fft.rfft|rfft|tensor")
    m = array_push(m, "np.fft.fft|rfft|tensor")

    // ── PyTorch: creation ──
    m = array_push(m, "torch.zeros|t_zeros|tensor")
    m = array_push(m, "torch.ones|t_ones|tensor")
    m = array_push(m, "torch.tensor|t_create|tensor")
    m = array_push(m, "torch.as_tensor|t_create|tensor")
    m = array_push(m, "torch.from_numpy|t_create|tensor")
    m = array_push(m, "torch.randn|t_rand|tensor")
    m = array_push(m, "torch.rand|t_rand|tensor")
    m = array_push(m, "torch.randint|t_rand|tensor")
    m = array_push(m, "torch.randn_like|t_rand|tensor")
    m = array_push(m, "torch.rand_like|t_rand|tensor")
    m = array_push(m, "torch.zeros_like|t_zeros|tensor")
    m = array_push(m, "torch.ones_like|t_ones|tensor")
    m = array_push(m, "torch.empty|t_zeros|tensor")
    m = array_push(m, "torch.full|t_ones|tensor")
    m = array_push(m, "torch.arange|t_zeros|tensor")
    m = array_push(m, "torch.linspace|t_zeros|tensor")
    m = array_push(m, "torch.eye|t_zeros|tensor")

    // ── PyTorch: math ops ──
    m = array_push(m, "torch.matmul|t_matmul|tensor")
    m = array_push(m, "torch.mm|t_matmul|tensor")
    m = array_push(m, "torch.bmm|t_matmul|tensor")
    m = array_push(m, "torch.addmm|t_matmul|tensor")
    m = array_push(m, "torch.add|t_add|tensor")
    m = array_push(m, "torch.sub|t_sub|tensor")
    m = array_push(m, "torch.mul|t_mul|tensor")
    m = array_push(m, "torch.div|t_mul|tensor")
    m = array_push(m, "torch.neg|t_neg|tensor")
    m = array_push(m, "torch.abs|t_abs|tensor")
    m = array_push(m, "torch.sqrt|t_sqrt|tensor")
    m = array_push(m, "torch.rsqrt|t_sqrt|tensor")
    m = array_push(m, "torch.exp|t_exp|tensor")
    m = array_push(m, "torch.log|t_log|tensor")
    m = array_push(m, "torch.log2|t_log|tensor")
    m = array_push(m, "torch.pow|t_exp|tensor")
    m = array_push(m, "torch.sum|tensor_sum|tensor")
    m = array_push(m, "torch.mean|t_mean|tensor")
    m = array_push(m, "torch.var|t_var|tensor")
    m = array_push(m, "torch.std|t_var|tensor")
    m = array_push(m, "torch.cumsum|t_cumsum|tensor")
    m = array_push(m, "torch.norm|t_norm|tensor")
    m = array_push(m, "torch.linalg.norm|t_norm|tensor")
    m = array_push(m, ".sum(|tensor_sum(|tensor")
    m = array_push(m, ".mean(|t_mean(|tensor")
    m = array_push(m, ".var(|t_var(|tensor")
    m = array_push(m, ".norm(|t_norm(|tensor")

    // ── PyTorch: shape ops ──
    m = array_push(m, "torch.cat|t_cat|tensor")
    m = array_push(m, "torch.stack|t_cat|tensor")
    m = array_push(m, "torch.reshape|t_reshape|tensor")
    m = array_push(m, ".view(|t_reshape(|tensor")
    m = array_push(m, ".contiguous()||tensor")
    m = array_push(m, "torch.transpose|t_transpose|tensor")
    m = array_push(m, ".permute(|t_transpose(|tensor")
    m = array_push(m, "torch.unsqueeze|t_unsqueeze|tensor")
    m = array_push(m, ".unsqueeze(|t_unsqueeze(|tensor")
    m = array_push(m, "torch.squeeze|t_reshape|tensor")
    m = array_push(m, ".squeeze(|t_reshape(|tensor")
    m = array_push(m, "torch.flatten|t_reshape|tensor")
    m = array_push(m, ".flatten(|t_reshape(|tensor")
    m = array_push(m, "torch.expand|t_expand|tensor")
    m = array_push(m, ".expand(|t_expand(|tensor")
    m = array_push(m, ".repeat(|t_expand(|tensor")
    m = array_push(m, "torch.chunk|t_slice|tensor")
    m = array_push(m, "torch.split|t_slice|tensor")
    m = array_push(m, "torch.narrow|t_slice|tensor")
    m = array_push(m, "torch.index_select|index_select|tensor")

    // ── PyTorch: comparison / selection ──
    m = array_push(m, "torch.clamp|t_clamp|tensor")
    m = array_push(m, ".clamp(|t_clamp(|tensor")
    m = array_push(m, "torch.where|t_where|tensor")
    m = array_push(m, "torch.argmax|t_argmax|tensor")
    m = array_push(m, ".argmax(|t_argmax(|tensor")
    m = array_push(m, "torch.topk|topk_mask|tensor")
    m = array_push(m, ".topk(|topk_mask(|tensor")
    m = array_push(m, "torch.multinomial|t_multinomial|tensor")
    m = array_push(m, "torch.gather|t_gather|tensor")
    m = array_push(m, ".gather(|t_gather(|tensor")
    m = array_push(m, "torch.gt|t_gt|tensor")
    m = array_push(m, "torch.lt|t_lt|tensor")
    m = array_push(m, "torch.ge|t_gt|tensor")
    m = array_push(m, "torch.le|t_lt|tensor")
    m = array_push(m, "torch.eq|t_gt|tensor")
    m = array_push(m, ".masked_fill(|masked_fill(|tensor")
    m = array_push(m, ".masked_fill_(|masked_fill(|tensor")
    m = array_push(m, "torch.masked_fill|masked_fill|tensor")

    // ── PyTorch: tensor info ──
    m = array_push(m, ".size(|tensor_shape(|tensor")
    m = array_push(m, ".shape|tensor_shape|tensor")
    m = array_push(m, ".numel()|tensor_len|tensor")
    m = array_push(m, ".dim()|tensor_len|tensor")
    m = array_push(m, ".item()||tensor")

    // ── PyTorch: type / device ──
    m = array_push(m, ".to(device)|model_to_gpu|tensor")
    m = array_push(m, ".cuda()|model_to_gpu|tensor")
    m = array_push(m, ".cpu()||tensor")
    m = array_push(m, ".float()||tensor")
    m = array_push(m, ".half()||tensor")
    m = array_push(m, ".detach()||tensor")
    m = array_push(m, ".clone()||tensor")
    m = array_push(m, ".numpy()||tensor")

    // ── PyTorch: serialization (in training section) ──

    return m
}

fn get_activation_mappings() -> Array {
    let m = array_new()

    // ── torch.nn.functional (F.) ──
    m = array_push(m, "torch.nn.functional.relu|relu|activation")
    m = array_push(m, "F.relu|relu|activation")
    m = array_push(m, "torch.relu|relu|activation")
    m = array_push(m, "torch.nn.functional.gelu|gelu|activation")
    m = array_push(m, "F.gelu|gelu|activation")
    m = array_push(m, "torch.nn.functional.sigmoid|boltzmann|activation")
    m = array_push(m, "F.sigmoid|boltzmann|activation")
    m = array_push(m, "torch.sigmoid|boltzmann|activation")
    m = array_push(m, "torch.nn.functional.tanh|t_tanh|activation")
    m = array_push(m, "F.tanh|t_tanh|activation")
    m = array_push(m, "torch.tanh|t_tanh|activation")
    m = array_push(m, "torch.nn.functional.softmax|softmax|activation")
    m = array_push(m, "F.softmax|softmax|activation")
    m = array_push(m, "torch.softmax|softmax|activation")
    m = array_push(m, "torch.nn.functional.log_softmax|log_softmax|activation")
    m = array_push(m, "F.log_softmax|log_softmax|activation")
    m = array_push(m, "torch.nn.functional.softplus|t_softplus|activation")
    m = array_push(m, "F.softplus|t_softplus|activation")
    m = array_push(m, "torch.nn.functional.silu|gelu|activation")
    m = array_push(m, "F.silu|gelu|activation")
    m = array_push(m, "torch.nn.functional.leaky_relu|relu|activation")
    m = array_push(m, "F.leaky_relu|relu|activation")
    m = array_push(m, "torch.nn.functional.elu|relu|activation")
    m = array_push(m, "F.elu|relu|activation")

    // ── torch.nn activation modules ──
    m = array_push(m, "nn.ReLU|relu|activation")
    m = array_push(m, "nn.GELU|gelu|activation")
    m = array_push(m, "nn.Sigmoid|boltzmann|activation")
    m = array_push(m, "nn.Tanh|t_tanh|activation")
    m = array_push(m, "nn.Softmax|softmax|activation")
    m = array_push(m, "nn.LogSoftmax|log_softmax|activation")
    m = array_push(m, "nn.Softplus|t_softplus|activation")
    m = array_push(m, "nn.SiLU|gelu|activation")
    m = array_push(m, "nn.LeakyReLU|relu|activation")
    m = array_push(m, "nn.ELU|relu|activation")

    // ── F. applied to tensors (method-style) ──
    m = array_push(m, ".relu()|relu|activation")
    m = array_push(m, ".sigmoid()|boltzmann|activation")
    m = array_push(m, ".tanh()|t_tanh|activation")
    m = array_push(m, ".softmax(|softmax(|activation")

    // ── layer_norm as activation-adjacent ──
    m = array_push(m, "torch.nn.functional.layer_norm|layer_norm|activation")
    m = array_push(m, "F.layer_norm|layer_norm|activation")

    // ── scipy.special ──
    m = array_push(m, "scipy.special.softmax|softmax|activation")
    m = array_push(m, "scipy.special.expit|boltzmann|activation")
    m = array_push(m, "scipy.special.log_softmax|log_softmax|activation")

    return m
}

fn get_math_mappings() -> Array {
    let m = array_new()

    // ── math module ──
    m = array_push(m, "math.sqrt|sqrt|math")
    m = array_push(m, "math.exp|exp|math")
    m = array_push(m, "math.log|ln|math")
    m = array_push(m, "math.log2|log|math")
    m = array_push(m, "math.log10|log|math")
    m = array_push(m, "math.sin|sin|math")
    m = array_push(m, "math.cos|cos|math")
    m = array_push(m, "math.tan|sin|math")
    m = array_push(m, "math.floor|floor|math")
    m = array_push(m, "math.ceil|ceil|math")
    m = array_push(m, "math.fabs|abs|math")
    m = array_push(m, "math.pow|exp|math")

    // ── math constants ──
    m = array_push(m, "math.pi|3.14159265358979|math")
    m = array_push(m, "math.e|2.71828182845905|math")
    m = array_push(m, "math.inf|1e308|math")
    m = array_push(m, "float('inf')|1e308|math")
    m = array_push(m, "float('-inf')|-1e308|math")
    m = array_push(m, "math.nan|0.0|math")
    m = array_push(m, "math.tau|6.28318530717959|math")

    // ── builtins that map to Scyla math ──
    m = array_push(m, "abs(|abs(|math")
    // min/max too generic to map — left as-is

    // ── entropy / info theory ──
    m = array_push(m, "scipy.stats.entropy|entropy|math")

    return m
}

fn get_loss_mappings() -> Array {
    let m = array_new()

    // ── F. loss functions ──
    m = array_push(m, "torch.nn.functional.cross_entropy|cross_entropy|loss")
    m = array_push(m, "F.cross_entropy|cross_entropy|loss")
    m = array_push(m, "torch.nn.functional.nll_loss|cross_entropy|loss")
    m = array_push(m, "F.nll_loss|cross_entropy|loss")
    m = array_push(m, "torch.nn.functional.mse_loss|mse_loss|loss")
    m = array_push(m, "F.mse_loss|mse_loss|loss")
    m = array_push(m, "torch.nn.functional.l1_loss|mse_loss|loss")
    m = array_push(m, "F.l1_loss|mse_loss|loss")
    m = array_push(m, "torch.nn.functional.smooth_l1_loss|mse_loss|loss")
    m = array_push(m, "F.smooth_l1_loss|mse_loss|loss")
    m = array_push(m, "torch.nn.functional.binary_cross_entropy|cross_entropy|loss")
    m = array_push(m, "F.binary_cross_entropy|cross_entropy|loss")
    m = array_push(m, "torch.nn.functional.binary_cross_entropy_with_logits|softmax_cross_entropy|loss")
    m = array_push(m, "F.binary_cross_entropy_with_logits|softmax_cross_entropy|loss")
    m = array_push(m, "torch.nn.functional.kl_div|entropy|loss")
    m = array_push(m, "F.kl_div|entropy|loss")

    // ── nn. loss modules ──
    m = array_push(m, "nn.CrossEntropyLoss|cross_entropy|loss")
    m = array_push(m, "nn.NLLLoss|cross_entropy|loss")
    m = array_push(m, "nn.MSELoss|mse_loss|loss")
    m = array_push(m, "nn.L1Loss|mse_loss|loss")
    m = array_push(m, "nn.SmoothL1Loss|mse_loss|loss")
    m = array_push(m, "nn.BCELoss|cross_entropy|loss")
    m = array_push(m, "nn.BCEWithLogitsLoss|softmax_cross_entropy|loss")
    m = array_push(m, "nn.KLDivLoss|entropy|loss")
    m = array_push(m, "nn.HuberLoss|mse_loss|loss")
    m = array_push(m, "nn.CosineEmbeddingLoss|mse_loss|loss")
    m = array_push(m, "nn.TripletMarginLoss|mse_loss|loss")

    // ── REINFORCE / RL losses ──
    m = array_push(m, "# REINFORCE loss|reinforce_loss|loss")
    m = array_push(m, "# policy gradient|reinforce_loss|loss")

    return m
}

fn get_training_mappings() -> Array {
    let m = array_new()

    // ── backward / autograd ──
    m = array_push(m, "loss.backward()|backward(loss)|training")
    m = array_push(m, ".backward()|backward|training")
    m = array_push(m, "torch.autograd.grad|get_grad|training")
    m = array_push(m, ".grad|get_grad|training")
    m = array_push(m, "torch.no_grad()|// inference mode — use end_tape|training")
    m = array_push(m, "@torch.no_grad()|// inference mode — use end_tape|training")
    m = array_push(m, "torch.enable_grad()|begin_tape|training")
    m = array_push(m, "torch.set_grad_enabled|// grad toggle — use begin_tape/end_tape|training")
    m = array_push(m, "torch.is_grad_enabled|// check tape state|training")
    m = array_push(m, ".requires_grad_()|register_param|training")
    m = array_push(m, ".requires_grad|// param registered|training")
    m = array_push(m, "torch.nn.Parameter|register_param|training")
    m = array_push(m, "nn.Parameter|register_param|training")

    // ── tape control ──
    m = array_push(m, "# begin recording|begin_tape|training")
    m = array_push(m, "# end recording|end_tape|training")

    // ── optimizer zero / step ──
    m = array_push(m, "optimizer.zero_grad()|// grad reset (automatic in Scyla)|training")
    m = array_push(m, "optimizer.step()|sgd_step|training")
    m = array_push(m, ".zero_grad()|// grad reset (automatic in Scyla)|training")

    // ── optimizers ──
    m = array_push(m, "torch.optim.Adam|// optimizer: use sgd_step with lr|training")
    m = array_push(m, "torch.optim.AdamW|// optimizer: use sgd_step with lr|training")
    m = array_push(m, "torch.optim.SGD|// optimizer: use sgd_step|training")
    m = array_push(m, "torch.optim.RMSprop|// optimizer: use sgd_step|training")
    m = array_push(m, "torch.optim.Adagrad|// optimizer: use sgd_step|training")
    m = array_push(m, "torch.optim.LBFGS|// optimizer: use sgd_step|training")

    // ── lr schedulers ──
    m = array_push(m, "torch.optim.lr_scheduler.StepLR|// lr schedule: manual decay|training")
    m = array_push(m, "torch.optim.lr_scheduler.CosineAnnealingLR|// lr schedule: cosine decay|training")
    m = array_push(m, "torch.optim.lr_scheduler.ReduceLROnPlateau|// lr schedule: reduce on plateau|training")
    m = array_push(m, "torch.optim.lr_scheduler.OneCycleLR|// lr schedule: one-cycle|training")
    m = array_push(m, "torch.optim.lr_scheduler.LinearLR|// lr schedule: linear warmup|training")
    m = array_push(m, "torch.optim.lr_scheduler.ExponentialLR|// lr schedule: exponential decay|training")
    m = array_push(m, "scheduler.step()|// lr schedule step (manual)|training")

    // ── gradient clipping ──
    m = array_push(m, "torch.nn.utils.clip_grad_norm_|t_clamp|training")
    m = array_push(m, "torch.nn.utils.clip_grad_value_|t_clamp|training")

    // ── model parameters ──
    m = array_push(m, "model.parameters()|get_params()|training")
    m = array_push(m, ".parameters()|get_params()|training")
    m = array_push(m, ".named_parameters()|get_params()|training")
    m = array_push(m, "model.train()|// train mode|training")
    m = array_push(m, "model.eval()|// eval mode|training")
    m = array_push(m, ".train()|// train mode|training")
    m = array_push(m, ".eval()|// eval mode|training")

    // ── model save / load ──
    m = array_push(m, "model.state_dict()|save_safetensors|training")
    m = array_push(m, "model.load_state_dict|load_model|training")
    m = array_push(m, "torch.save|save_safetensors|training")
    m = array_push(m, "torch.load|load_model|training")

    // ── device management ──
    m = array_push(m, "model.to(device)|model_to_gpu|training")
    m = array_push(m, "model.cuda()|model_to_gpu|training")
    m = array_push(m, "torch.device|// device selection|training")
    m = array_push(m, "torch.cuda.is_available()|// gpu check|training")

    // ── reward / REINFORCE ──
    m = array_push(m, "compute_reward|compute_reward|training")
    m = array_push(m, "reinforce_loss|reinforce_loss|training")

    return m
}

fn get_nn_mappings() -> Array {
    let m = array_new()

    // ── nn.Module base ──
    m = array_push(m, "nn.Module|// Scyla struct + impl|nn")
    m = array_push(m, "class.*nn.Module|// use struct + impl|nn")
    m = array_push(m, "super().__init__()|// no super needed in Scyla|nn")
    m = array_push(m, "self.forward|// fn forward in impl block|nn")
    m = array_push(m, "def forward|fn forward|nn")
    m = array_push(m, "def __init__|fn new|nn")

    // ── nn.Linear ──
    m = array_push(m, "nn.Linear|t_linear_relu|nn")
    m = array_push(m, "torch.nn.Linear|t_linear_relu|nn")
    m = array_push(m, "F.linear|t_linear_relu|nn")
    m = array_push(m, "torch.nn.functional.linear|t_linear_relu|nn")

    // ── nn.LayerNorm ──
    m = array_push(m, "nn.LayerNorm|layer_norm|nn")
    m = array_push(m, "torch.nn.LayerNorm|layer_norm|nn")

    // ── nn.Embedding ──
    m = array_push(m, "nn.Embedding|embedding_lookup|nn")
    m = array_push(m, "torch.nn.Embedding|embedding_lookup|nn")
    m = array_push(m, "F.embedding|embedding_lookup|nn")
    m = array_push(m, "torch.nn.functional.embedding|embedding_lookup|nn")

    // ── nn.Dropout ──
    m = array_push(m, "nn.Dropout|// dropout: use t_mul with mask|nn")
    m = array_push(m, "torch.nn.Dropout|// dropout: use t_mul with mask|nn")
    m = array_push(m, "F.dropout|// dropout: use t_mul with mask|nn")
    m = array_push(m, "torch.nn.functional.dropout|// dropout: use t_mul with mask|nn")

    // ── nn.BatchNorm / GroupNorm ──
    m = array_push(m, "nn.BatchNorm1d|layer_norm|nn")
    m = array_push(m, "nn.BatchNorm2d|layer_norm|nn")
    m = array_push(m, "nn.GroupNorm|layer_norm|nn")
    m = array_push(m, "nn.InstanceNorm1d|layer_norm|nn")
    m = array_push(m, "nn.InstanceNorm2d|layer_norm|nn")
    m = array_push(m, "nn.RMSNorm|layer_norm|nn")

    // ── nn containers ──
    m = array_push(m, "nn.Sequential|// Scyla: chain fn calls|nn")
    m = array_push(m, "nn.ModuleList|// Scyla: use Array of structs|nn")
    m = array_push(m, "nn.ModuleDict|// Scyla: use Map of structs|nn")

    // ── attention / transformer ──
    m = array_push(m, "nn.MultiheadAttention|multi_head_attention|nn")
    m = array_push(m, "nn.TransformerEncoderLayer|transformer_block|nn")
    m = array_push(m, "nn.TransformerDecoderLayer|transformer_block|nn")
    m = array_push(m, "nn.TransformerEncoder|transformer_block|nn")
    m = array_push(m, "nn.TransformerDecoder|transformer_block|nn")
    m = array_push(m, "nn.Transformer|transformer_block|nn")
    m = array_push(m, "F.scaled_dot_product_attention|multi_head_attention|nn")

    // ── tokenizer patterns ──
    m = array_push(m, "AutoTokenizer.from_pretrained|load_tokenizer|nn")
    m = array_push(m, "tokenizer.encode|tokenize|nn")
    m = array_push(m, "tokenizer.decode|detokenize|nn")
    m = array_push(m, "tokenizer(|tokenize(|nn")
    m = array_push(m, "tokenizer.batch_encode_plus|tokenize|nn")
    m = array_push(m, "tokenizer.batch_decode|detokenize|nn")

    // ── model loading (HuggingFace style) ──
    m = array_push(m, "AutoModel.from_pretrained|load_model|nn")
    m = array_push(m, "AutoModelForCausalLM.from_pretrained|load_model|nn")
    m = array_push(m, "AutoModelForSequenceClassification.from_pretrained|load_model|nn")
    m = array_push(m, "model.get|model_get|nn")
    m = array_push(m, "model.set|model_set|nn")

    // ── cascade (Scyla-native) ──
    m = array_push(m, "create_cascade|create_cascade|nn")
    m = array_push(m, "cascade_forward|cascade_forward|nn")
    m = array_push(m, "cascade_reset|cascade_reset|nn")

    // ── Hodgkin-Huxley (Scyla-native) ──
    m = array_push(m, "hh_gate|hh_gate|nn")
    m = array_push(m, "hh_gate_full|hh_gate_full|nn")
    m = array_push(m, "hh_resting|hh_resting|nn")
    m = array_push(m, "hodgkin_huxley_step|hodgkin_huxley_step|nn")

    // ── Python syntax → Scyla ──
    m = array_push(m, "import torch|// use Scyla builtins|nn")
    m = array_push(m, "import torch.nn as nn|// use Scyla builtins|nn")
    m = array_push(m, "import torch.nn.functional as F|// use Scyla builtins|nn")
    m = array_push(m, "import numpy as np|// use Scyla builtins|nn")
    m = array_push(m, "import math|// use Scyla builtins|nn")
    m = array_push(m, "from torch import|// use Scyla builtins|nn")
    m = array_push(m, "from transformers import|// use load_model / load_tokenizer|nn")
    m = array_push(m, "import scipy|// use Scyla builtins|nn")

    return m
}

fn get_all_mappings() -> Array {
    let all = array_new()
    let sources = array_new()
    sources = array_push(sources, get_tensor_mappings())
    sources = array_push(sources, get_activation_mappings())
    sources = array_push(sources, get_math_mappings())
    sources = array_push(sources, get_loss_mappings())
    sources = array_push(sources, get_training_mappings())
    sources = array_push(sources, get_nn_mappings())

    let s = 0
    while s < array_len(sources) {
        let src = array_get(sources, s)
        let i = 0
        while i < array_len(src) {
            all = array_push(all, array_get(src, i))
            i = i + 1
        }
        s = s + 1
    }
    return all
}
