fact stringlengths 6 2.88k | type stringclasses 17
values | library stringclasses 2
values | imports listlengths 0 16 | filename stringclasses 89
values | symbolic_name stringlengths 1 36 | docstring stringclasses 1
value |
|---|---|---|---|---|---|---|
for_all2(f : 'a -> 'b -> bool) (xs : 'a list) (ys : 'b list) : bool :=
for_all2_aux (fun _ _ => Control.throw_invalid_argument "List.for_all2") f xs ys. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | for_all2 | |
equal(f : 'a -> 'b -> bool) (xs : 'a list) (ys : 'b list) : bool :=
for_all2_aux (fun _ _ => false) f xs ys. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | equal | |
recexist2 (f : 'a -> 'b -> bool) (xs : 'a list) (ys : 'b list) : bool :=
match xs with
| [] => match ys with
| [] => false
| _ :: _ => Control.throw_invalid_argument "List.exist2"
end
| x :: xs'
=> match ys with
| [] => Control.throw_invalid_argument "List.exist2"
|... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfind_opt (f : 'a -> bool) (xs : 'a list) : 'a option :=
match xs with
| [] => None
| x :: xs => match f x with
| true => Some x
| false => find_opt f xs
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
find(f : 'a -> bool) (xs : 'a list) : 'a :=
match find_opt f xs with
| Some v => v
| None => Control.throw Not_found
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | find | |
recfind_rev_opt (f : 'a -> bool) (xs : 'a list) : 'a option :=
match xs with
| [] => None
| x :: xs => match find_rev_opt f xs with
| Some v => Some v
| None => match f x with
| true => Some x
| false => None
... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
find_rev(f : 'a -> bool) (xs : 'a list) : 'a :=
match find_rev_opt f xs with
| Some v => v
| None => Control.throw Not_found
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | find_rev | |
mem(eq : 'a -> 'a -> bool) (a : 'a) (ls : 'a list) : bool :=
exist (eq a) ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | mem | |
recfilter (f : 'a -> bool) (xs : 'a list) : 'a list :=
match xs with
| [] => []
| x :: xs
=> match f x with
| true => x :: filter f xs
| false => filter f xs
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfilter_out (f : 'a -> bool) (xs : 'a list) : 'a list :=
filter (fun x => Bool.neg (f x)) xs. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
find_all(f : 'a -> bool) (ls : 'a list) : 'a list := filter f ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | find_all | |
remove(eqb : 'a -> 'a -> bool) (x : 'a) (ls : 'a list) : 'a list :=
filter_out (eqb x) ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | remove | |
count_occ(eqb : 'a -> 'a -> bool) (x : 'a) (ls : 'a list) : int :=
length (filter (eqb x) ls). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | count_occ | |
reclist_power (ls1 : 'a list) (ls2 : 'b list) : ('a * 'b) list list :=
match ls1 with
| [] => [] :: []
| x :: t
=> flat_map (fun f => map (fun y => (x, y) :: f) ls2)
(list_power t ls2)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recpartition (f : 'a -> bool) (l : 'a list) : 'a list * 'a list :=
match l with
| [] => ([], [])
| x :: tl
=> let (g, d) := partition f tl in
match f x with
| true => ((x::g), d)
| false => (g, (x::d))
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reclist_prod (ls1 : 'a list) (ls2 : 'b list) : ('a * 'b) list :=
match ls1 with
| [] => []
| x :: t
=> append (map (fun y => (x, y)) ls2) (list_prod t ls2)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfirstn (n : int) (ls : 'a list) : 'a list :=
Control.assert_valid_argument "List.firstn" (Int.ge n 0);
match Int.equal n 0 with
| true => []
| false
=> match ls with
| [] => Control.throw_out_of_bounds "List.firstn"
| x :: xs
=> x :: firstn (Int.sub n 1) xs
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recskipn (n : int) (ls : 'a list) : 'a list :=
Control.assert_valid_argument "List.skipn" (Int.ge n 0);
match Int.equal n 0 with
| true => ls
| false
=> match ls with
| [] => Control.throw_out_of_bounds "List.skipn"
| _ :: xs
=> skipn (Int.sub n 1) xs
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
lastn(n : int) (ls : 'a list) : 'a list :=
let l := length ls in
Control.assert_valid_argument "List.lastn" (Int.ge n 0);
Control.assert_bounds "List.lastn" (Int.le n l);
skipn (Int.sub l n) ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | lastn | |
recnodup (eqb : 'a -> 'a -> bool) (ls : 'a list) : 'a list :=
match ls with
| [] => []
| x :: xs
=> match mem eqb x xs with
| true => nodup eqb xs
| false => x :: nodup eqb xs
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recseq (start : int) (step : int) (last : int) : int list :=
match Int.lt (Int.sub last start) step with
| true
=> []
| false
=> start :: seq (Int.add start step) step last
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
init(n : int) (f : int -> 'a) : 'a list :=
Control.assert_valid_argument "List.init" (Int.ge n 0);
map f (seq 0 1 n). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | init | |
repeat(x : 'a) (n : int) : 'a list :=
init n (fun _ => x). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | repeat | |
assoc(eqk : 'k -> 'k -> bool) (k : 'k) (l : ('k * 'v) list) : 'v :=
let eq_key kv := let (k', _) := kv in eqk k k' in
let (_, v) := find eq_key l in
v. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | assoc | |
assoc_opt(eqk : 'k -> 'k -> bool) (k : 'k) (l : ('k * 'v) list) : 'v option :=
let eq_key kv := let (k', _) := kv in eqk k k' in
match find_opt eq_key l with
| Some kv => let (_, v) := kv in Some v
| None => None
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | assoc_opt | |
mem_assoc(eqk : 'k -> 'k -> bool) (k : 'k) (l : ('k * 'v) list) : bool :=
let eq_key kv := let (k', _) := kv in eqk k k' in
exist eq_key l. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | mem_assoc | |
remove_assoc(eqk : 'k -> 'k -> bool) (k : 'k) (l : ('k * 'v) list) : ('k * 'v) list :=
let eq_key kv := let (k', _) := kv in eqk k k' in
filter_out eq_key l. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | remove_assoc | |
recsplit (ls : ('a * 'b) list) : 'a list * 'b list :=
match ls with
| [] => ([], [])
| xy :: tl
=> let (x, y) := xy in
let (left, right) := split tl in
((x::left), (y::right))
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reccombine (ls1 : 'a list) (ls2 : 'b list) : ('a * 'b) list :=
match ls1 with
| []
=> match ls2 with
| [] => []
| _ :: _ => Control.throw_invalid_argument "List.combine"
end
| x :: xs
=> match ls2 with
| y :: ys
=> (x, y) :: combine xs ys
| [] => Control.throw_i... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
enumerate(ls : 'a list) :=
mapi (fun i v => (i,v)) ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | enumerate | |
recmerge (cmp : 'a -> 'a -> int) (l1 : 'a list) (l2 : 'a list) : 'a list :=
let rec merge_aux l2 :=
match l1 with
| [] => l2
| a1 :: l1'
=> match l2 with
| [] => l1
| a2 :: l2'
=> match Int.le (cmp a1 a2) 0 with
| true => a1 :: merge cmp l1'... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recmerge_list_to_stack cmp stack l :=
match stack with
| [] => [Some l]
| l' :: stack'
=> match l' with
| None => Some l :: stack'
| Some l'
=> None :: merge_list_to_stack cmp stack' (merge cmp l' l)
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recmerge_stack cmp stack :=
match stack with
| [] => []
| l :: stack'
=> match l with
| None => merge_stack cmp stack'
| Some l => merge cmp l (merge_stack cmp stack')
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reciter_merge cmp stack l :=
match l with
| [] => merge_stack cmp stack
| a::l' => iter_merge cmp (merge_list_to_stack cmp stack [a]) l'
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
sort(cmp : 'a -> 'a -> int) (l : 'a list) : 'a list :=
iter_merge cmp [] l. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | sort | |
sort_uniq(cmp : 'a -> 'a -> int) (l : 'a list) : 'a list :=
let rec uniq l :=
match l with
| [] => []
| x1 :: xs
=> match xs with
| [] => x1 :: xs
| x2 :: _
=> match Int.equal (cmp x1 x2) 0 with
| true => uniq xs
| false => x... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | sort_uniq | |
inclusive_range(lb : int) (ub : int) : int list :=
seq lb 1 (Int.add ub 1). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | inclusive_range | |
range(lb : int) (ub : int) : int list :=
seq lb 1 ub. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | range | |
concat_rev(ls : 'a list list) : 'a list :=
let rec go ls acc :=
match ls with
| [] => acc
| l :: ls => go ls (rev_append l acc)
end
in
match ls with
| [] => []
| l :: ls => go ls l
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | concat_rev | |
recmap_filter (f : 'a -> 'b option) (l : 'a list) : 'b list :=
match l with
| [] => []
| x :: l =>
match f x with
| Some y => y :: map_filter f l
| None => map_filter f l
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
Typet. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init Ltac2.Std Ltac2.Control"
] | Ltac2/Ltac1.v | Type | |
Notation"transitivity" c(constr) : 1 := Std.transitivity c. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init Ltac2.Std"
] | Ltac2/Ltac1CompatNotations.v | Notation | |
Notation"rename" renames(list1(seq(ident, "into", ident), ",")) :=
Std.rename renames. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init Ltac2.Std"
] | Ltac2/Ltac1CompatNotations.v | Notation | |
Typet := meta. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Meta.v | Type | |
Notation"lazy_match!" t(tactic(6)) "with" m(constr_matching) "end" : 0 :=
Pattern.lazy_match0 t m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"multi_match!" t(tactic(6)) "with" m(constr_matching) "end" : 0 :=
Pattern.multi_match0 t m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"match!" t(tactic(6)) "with" m(constr_matching) "end" : 0 :=
Pattern.one_match0 t m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"lazy_match!" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.lazy_goal_match0 false m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"multi_match!" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.multi_goal_match0 false m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"match!" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.one_goal_match0 false m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"lazy_match!" "reverse" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.lazy_goal_match0 true m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"multi_match!" "reverse" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.multi_goal_match0 true m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"match!" "reverse" "goal" "with" m(goal_matching) "end" : 0 :=
Pattern.one_goal_match0 true m. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
orelset f :=
match Control.case t with
| Err e => f e
| Val ans =>
let (x, k) := ans in
Control.plus (fun _ => x) k
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | orelse | |
ifcatcht s f :=
match Control.case t with
| Err e => f e
| Val ans =>
let (x, k) := ans in
Control.plus (fun _ => s x) (fun e => s (k e))
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | ifcatch | |
fail0(_ : unit) := Control.enter (fun _ => Control.zero (Tactic_failure None)). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | fail0 | |
Abbreviationfail := fail0 (). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
try0t := Control.enter (fun _ => orelse t (fun _ => ())). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | try0 | |
Abbreviationtry := try0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
recrepeat0 (t : unit -> unit) :=
Control.enter (fun () =>
ifcatch (fun _ => Control.progress t)
(fun _ => Control.check_interrupt (); repeat0 t) (fun _ => ())). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | rec | |
Abbreviationrepeat := repeat0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
dispatch0t (head, tail) :=
match tail with
| None => Control.enter (fun _ => t (); Control.dispatch head)
| Some tacs =>
let (def, rem) := tacs in
Control.enter (fun _ => t (); Control.extend head def rem)
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | dispatch0 | |
Notationt(thunk(self)) ">" "[" l(dispatch) "]" : 4 := dispatch0 t l. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
do0n t :=
let rec aux n t := match Int.equal n 0 with
| true => ()
| false => t (); aux (Int.sub n 1) t
end in
aux (n ()) t. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | do0 | |
Abbreviationdo := do0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
Abbreviationonce := Control.once. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
Abbreviationunshelve := Control.unshelve. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
cycle:= Control.cycle. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | cycle | |
progress0tac := Control.enter (fun _ => Control.progress tac). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | progress0 | |
Abbreviationprogress := progress0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
recfirst0 tacs :=
match tacs with
| [] => Control.zero (Tactic_failure None)
| tac :: tacs => Control.enter (fun _ => orelse tac (fun _ => first0 tacs))
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | rec | |
Notation"first" "[" tacs(list0(thunk(tactic(6)), "|")) "]" := first0 tacs. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
completetac :=
let ans := tac () in
Control.enter (fun () => Control.zero (Tactic_failure None));
ans. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | complete | |
recsolve0 tacs :=
match tacs with
| [] => Control.zero (Tactic_failure None)
| tac :: tacs =>
Control.enter (fun _ => orelse (fun _ => complete tac) (fun _ => solve0 tacs))
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | rec | |
Notation"solve" "[" tacs(list0(thunk(tactic(6)), "|")) "]" := solve0 tacs. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
time0tac := Control.time None tac. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | time0 | |
Abbreviationtime := time0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
abstract0tac := Control.abstract None tac. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | abstract0 | |
Abbreviationabstract := abstract0. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
enter_hev f arg :=
match ev with
| true => Control.enter (fun () => f ev (arg ()))
| false =>
Control.enter (fun () =>
Control.with_holes arg (fun x => f ev x))
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | enter_h | |
intros0ev p :=
Control.enter (fun () => Std.intros ev p). | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | intros0 | |
Notation"intros" p(intropatterns) := intros0 false p. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationintros := intros. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
Notation"eintros" p(intropatterns) := intros0 true p. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationeintros := eintros. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
split0ev bnd :=
enter_h ev Std.split bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | split0 | |
Notation"split" bnd(thunk(with_bindings)) := split0 false bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationsplit := split. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
Notation"esplit" bnd(thunk(with_bindings)) := split0 true bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationesplit := esplit. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
exists0ev bnds := match bnds with
| [] => split0 ev (fun () => Std.NoBindings)
| _ =>
let rec aux bnds := match bnds with
| [] => ()
| bnd :: bnds => split0 ev bnd; aux bnds
end in
aux bnds
end. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | exists0 | |
Notation"exists" bnd(list0(thunk(bindings), ",")) := exists0 false bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Notation"eexists" bnd(list0(thunk(bindings), ",")) := exists0 true bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationeexists := eexists. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
left0ev bnd := enter_h ev Std.left bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | left0 | |
Notation"left" bnd(thunk(with_bindings)) := left0 false bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationleft := left. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
Notation"eleft" bnd(thunk(with_bindings)) := left0 true bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Notation | |
Abbreviationeleft := eleft. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | Abbreviation | |
right0ev bnd := enter_h ev Std.right bnd. | Ltac2 | Ltac2 | [
"Require Import Corelib.Init.Ltac",
"Require Import Ltac2.Init",
"Require Ltac2.Control Ltac2.Fresh Ltac2.Option Ltac2.Pattern Ltac2.Array Ltac2.Int Ltac2.Std Ltac2.Constr"
] | Ltac2/Notations.v | right0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.