Ltac

1 program Added 2026-03-06T08:59:45Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Ltac2
Provenance: commit db4d92022f · authored 2026-03-06T10:01:00+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Ltac2 (0.67)Lisaac (0.13)Lola (0.12)Lola-2 (0.11)LBasic (0.11)

LLM-contributed programs

Recursive tactics and goal matching

Provenance: commit db4d92022f · authored 2026-03-06T10:01:00+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.v · added: 2026-03-06T08:59:45Z
(* Ltac: Coq's built-in tactic definition language *)
(* Demonstrates recursive tactics and goal matching *)

Require Import Arith.

(* A recursive tactic using pattern matching *)
Ltac nat_iter n tac :=
  match n with
  | O => idtac
  | S ?n' => tac; nat_iter n' tac
  end.

(* A tactic that matches the proof goal *)
Ltac solve_simple_eq :=
  match goal with
  | |- ?n = ?n           => reflexivity
  | |- 0 + ?n = ?n       => simpl; reflexivity
  | |- ?n + 0 = ?n       => rewrite Nat.add_0_r; reflexivity
  | |- S ?n = S ?m       => f_equal; solve_simple_eq
  end.

(* Tactic that searches hypotheses for False *)
Ltac elim_false :=
  match goal with
  | H : False |- _ => destruct H
  end.

Lemma add_n_0 : forall n, n + 0 = n.
Proof.
  intro n. solve_simple_eq.
Qed.

Lemma add_0_n : forall n, 0 + n = n.
Proof.
  intro n. solve_simple_eq.
Qed.

Lemma succ_inj_eq : forall n, S n = S n.
Proof.
  intro n. solve_simple_eq.
Qed.

Contribute — propose a file extension

Tell us where to find evidence about Ltac (mapped to pl/ltac). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Ltac/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← LstackG+ Ltac2 →