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 |
|---|---|---|---|---|---|---|
Type'a t. | Ltac2 | Ltac2 | [
"From Ltac2 Require Import Init"
] | Ltac2/FSet.v | Type | |
Typet := ident. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Ident.v | Type | |
Typet := inductive. | Ltac2 | Ltac2 | [
"From Ltac2 Require Import Init"
] | Ltac2/Ind.v | Type | |
Typedata. | Ltac2 | Ltac2 | [
"From Ltac2 Require Import Init"
] | Ltac2/Ind.v | Type | |
Typeint. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typestring. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typechar. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeident. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeuint63. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typefloat. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typepstring. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typemeta. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeevar. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typesort. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typecast. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeinstance. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeconstant. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeinductive. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeconstructor. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeprojection. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typepattern. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeconstr. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typepreterm. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typebinder. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typemessage. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Type('a, 'b, 'c, 'd) format. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn := [ .. ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Type'a array. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
fst(p:'a * 'b) : 'a := let (x,_) := p in x. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | fst | |
snd(p:'a * 'b) : 'b := let (_,y) := p in y. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | snd | |
Type'a option := [ None | Some ('a) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Type'a ref := { mutable contents : 'a }. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typebool := [ true | false ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Type'a result := [ Val ('a) | Err (exn) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeerr. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Internal (err) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Out_of_bounds (message option) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Not_focussed ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Not_found ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ No_value ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Match_failure ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Invalid_argument (message option) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Tactic_failure (message option) ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Assertion_failure ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexn ::= [ Division_by_zero ]. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typeexninfo. | Ltac2 | Ltac2 | [
"Require Corelib.Init.Ltac"
] | Ltac2/Init.v | Type | |
Typet := int. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Int.v | Type | |
lt(x : int) (y : int) := equal (compare x y) -1. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Int.v | lt | |
gt(x : int) (y : int) := equal (compare x y) 1. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Int.v | gt | |
le(x : int) (y : int) := | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Int.v | le | |
ge(x : int) (y : int) := | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init"
] | Ltac2/Int.v | ge | |
Type'a lazy_data := [ Value ('a) | Thunk (unit -> 'a) ]. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | Type | |
Type'a t := 'a lazy_data Ref.ref. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | Type | |
from_val(v : 'a) : 'a t :=
Ref.ref (Value v). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | from_val | |
from_fun(f : unit -> 'a) : 'a t :=
Ref.ref (Thunk f). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | from_fun | |
is_val(r : 'a t) : bool :=
match Ref.get r with
| Value _ => true
| Thunk _ => false
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | is_val | |
Typeexn ::= [ Undefined ]. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | Type | |
force(r : 'a t) : 'a :=
match Ref.get r with
| Value v => v
| Thunk f =>
Ref.set r (Thunk (fun () => Control.throw Undefined));
match Control.case f with
| Val (v, _) =>
Ref.set r (Value v);
v
| Err e =>
Ref.set r (Thunk (fun () => Control.zero e));
... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | force | |
map(f : 'a -> 'b) (r : 'a t) : 'b t :=
from_fun (fun () => f (force r)). | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | map | |
map_val(f : 'a -> 'b) (r : 'a t) : 'b t :=
match Ref.get r with
| Value v =>
match Control.case (fun () => f v) with
| Val (v, _) => from_val v
| Err e => from_fun (fun () => Control.zero e)
end
| Thunk t => from_fun (fun () => f (t ()))
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | map_val | |
Notation"lazy!" f(thunk(self)) := from_fun f. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Ref",
"Require Ltac2.Control"
] | Ltac2/Lazy.v | Notation | |
reclength (ls : 'a list) : int :=
match ls with
| [] => 0
| _ :: xs => Int.add 1 (length xs)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reccompare_lengths (ls1 : 'a list) (ls2 : 'b list) : int :=
match ls1 with
| []
=> match ls2 with
| [] => 0
| _ :: _ => -1
end
| _ :: ls1
=> match ls2 with
| [] => 1
| _ :: ls2 => compare_lengths ls1 ls2
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reccompare_length_with (ls : 'a list) (n : int) : int :=
match Int.lt n 0 with
| true => 1
| false
=> match ls with
| [] => Int.compare 0 n
| _ :: ls => compare_length_with ls (Int.sub n 1)
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
cons(x : 'a) (xs : 'a list) : 'a list :=
x :: xs. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | cons | |
hd_opt(ls : 'a list) : 'a option :=
match ls with
| [] => None
| x :: _ => Some x
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | hd_opt | |
hd(ls : 'a list) : 'a :=
match ls with
| [] => Control.throw_invalid_argument "List.hd"
| x :: _ => x
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | hd | |
tl(ls : 'a list) : 'a list :=
match ls with
| [] => []
| _ :: xs => xs
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | tl | |
dest(xs : 'a list) : 'a * 'a list :=
match xs with
| x :: xs => (x, xs)
| [] => Control.throw_invalid_argument "List.dest: list empty"
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | dest | |
is_empty(xs : 'a list) : bool :=
match xs with
| _ :: _ => false
| _ => true
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | is_empty | |
reclast_opt (ls : 'a list) : 'a option :=
match ls with
| [] => None
| x :: xs
=> match xs with
| [] => Some x
| _ :: _ => last_opt 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 | |
last(ls : 'a list) : 'a :=
match last_opt ls with
| None => Control.throw_invalid_argument "List.last"
| Some v => v
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | last | |
recremovelast (ls : 'a list) : 'a list :=
match ls with
| [] => []
| x :: xs
=> match xs with
| [] => []
| _ :: _ => x :: removelast 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 | |
recnth_opt_aux (ls : 'a list) (n : int) :=
match ls with
| [] => None
| x :: xs
=> match Int.equal n 0 with
| true => Some x
| false => nth_opt_aux xs (Int.sub n 1)
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
nth_opt(ls : 'a list) (n : int) : 'a option :=
Control.assert_valid_argument "List.nth" (Int.ge n 0);
nth_opt_aux ls n. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | nth_opt | |
nth(ls : 'a list) (n : int) : 'a :=
match nth_opt ls n with
| Some v => v
| None => Control.throw_out_of_bounds "List.nth"
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | nth | |
recrev_append (l1 : 'a list) (l2 : 'a list) : 'a list :=
match l1 with
| [] => l2
| a :: l => rev_append l (a :: l2)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
rev(l : 'a list) : 'a list :=
rev_append l []. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rev | |
recappend (ls1 : 'a list) (ls2 : 'a list) : 'a list :=
match ls1 with
| [] => ls2
| x :: xs => x :: append xs ls2
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recconcat (ls : 'a list list) : 'a list :=
match ls with
| [] => []
| x :: xs => append x (concat xs)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
flatten(ls : 'a list list) : 'a list :=
concat ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | flatten | |
reciter (f : 'a -> unit) (ls : 'a list) : unit :=
match ls with
| [] => ()
| l :: ls => f l; iter f ls
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
reciteri_aux (i : int) (f : int -> 'a -> unit) (ls : 'a list) : unit :=
match ls with
| [] => ()
| l :: ls => f i l; iteri_aux (Int.add i 1) f ls
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
iteri(f : int -> 'a -> unit) (ls : 'a list) : unit :=
iteri_aux 0 f ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | iteri | |
recmap (f : 'a -> 'b) (ls : 'a list) : 'b list :=
match ls with
| [] => []
| l :: ls => f l :: map f ls
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recmapi_aux (i : int) (f : int -> 'a -> 'b) (ls : 'a list) : 'b list :=
match ls with
| [] => []
| l :: ls => f i l :: mapi_aux (Int.add i 1) f ls
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
mapi(f : int -> 'a -> 'b) (ls : 'a list) : 'b list :=
mapi_aux 0 f ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | mapi | |
recflat_map (f : 'a -> 'b list) (xs : 'a list) : 'b list :=
match xs with
| [] => []
| x :: xs => append (f x) (flat_map f xs)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
rev_map(f : 'a -> 'b) (ls : 'a list) : 'b list :=
let rec rmap_f accu ls :=
match ls with
| [] => accu
| a::l => rmap_f (f a :: accu) l
end in
rmap_f [] ls. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rev_map | |
recfold_right (f : 'a -> 'b -> 'b) (ls : 'a list) (a : 'b) : 'b :=
match ls with
| [] => a
| l :: ls => f l (fold_right f ls a)
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfold_left (f : 'a -> 'b -> 'a) (a : 'a) (xs : 'b list) : 'a :=
match xs with
| [] => a
| x :: xs => fold_left f (f a x) xs
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
fold_lefti(f : int -> 'a -> 'b -> 'a) (a : 'a) (xs : 'b list) : 'a :=
let rec go i a xs :=
match xs with
| [] => a
| x :: xs => go (Int.add i 1) (f i a x) xs
end
in go 0 a xs. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | fold_lefti | |
reciter2 (f : 'a -> 'b -> unit) (ls1 : 'a list) (ls2 : 'b list) : unit :=
match ls1 with
| []
=> match ls2 with
| [] => ()
| _ :: _ => Control.throw_invalid_argument "List.iter2"
end
| l1 :: ls1
=> match ls2 with
| [] => Control.throw_invalid_argument "List.iter2"
| l2 :... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recmap2 (f : 'a -> 'b -> 'c) (ls1 : 'a list) (ls2 : 'b list) : 'c list :=
match ls1 with
| []
=> match ls2 with
| [] => []
| _ :: _ => Control.throw_invalid_argument "List.map2"
end
| l1 :: ls1
=> match ls2 with
| [] => Control.throw_invalid_argument "List.map2"
| l2 :: ... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
rev_map2(f : 'a -> 'b -> 'c) (ls1 : 'a list) (ls2 : 'b list) : 'c list :=
let rec rmap2_f accu ls1 ls2 :=
match ls1 with
| []
=> match ls2 with
| [] => accu
| _ :: _ => Control.throw_invalid_argument "List.rev_map2"
end
| l1 :: ls1
=> match ls2 with
... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rev_map2 | |
recfold_right2 (f : 'a -> 'b -> 'c -> 'c) (ls1 : 'a list) (ls2 : 'b list) (a : 'c) : 'c :=
match ls1 with
| []
=> match ls2 with
| [] => a
| _ :: _ => Control.throw_invalid_argument "List.fold_right2"
end
| l1 :: ls1
=> match ls2 with
| [] => Control.throw_invalid_argument "Lis... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfold_left2 (f : 'a -> 'b -> 'c -> 'a) (a : 'a) (ls1 : 'b list) (ls2 : 'c list) : 'a :=
match ls1 with
| []
=> match ls2 with
| [] => a
| _ :: _ => Control.throw_invalid_argument "List.fold_left2"
end
| l1 :: ls1
=> match ls2 with
| [] => Control.throw_invalid_argument "List... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recfor_all (f : 'a -> bool) (ls : 'a list) : bool :=
match ls with
| [] => true
| x :: xs => match f x with
| true => for_all f xs
| false => false
end
end. | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec | |
recexist (f : 'a -> bool) (ls : 'a list) : bool :=
match ls with
| [] => false
| x :: xs => match f x with
| true => true
| false => exist 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 | |
recfor_all2_aux (on_length_mismatch : 'a list -> 'b list -> bool) f xs ys : bool :=
match xs with
| [] => match ys with
| [] => true
| _ :: _ => on_length_mismatch xs ys
end
| x :: xs'
=> match ys with
| [] => on_length_mismatch xs ys
| y :: ys'
=> match f ... | Ltac2 | Ltac2 | [
"Require Import Ltac2.Init",
"Require Ltac2.Int",
"Require Ltac2.Control",
"Require Ltac2.Bool",
"Require Ltac2.Message"
] | Ltac2/List.v | rec |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.