File: nsplit.doc

package info (click to toggle)
hol-light 20170109-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,568 kB
  • ctags: 8,549
  • sloc: ml: 540,018; cpp: 439; lisp: 286; java: 279; makefile: 262; sh: 229; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (30 lines) | stat: -rw-r--r-- 584 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\DOC nsplit

\TYPE {nsplit : ('a -> 'b * 'a) -> 'c list -> 'a -> 'b list * 'a}

\SYNOPSIS
Applies a destructor in right-associative mode a specified number of times.

\DESCRIBE
If {d} is an inverse to a binary constructor {f}, then 
{
  nsplit d l (f(x1,f(x2,...f(xn,y))))
}
\noindent where the list {l} has length {k}, returns
{
  ([x1;...;xk],f(x(k+1),...f(xn,y))
}

\FAILURE
Never fails.

\EXAMPLE
{
  # nsplit dest_conj [1;2;3] `a /\ b /\ c /\ d /\ e /\ f`;;
  val it : term list * term = ([`a`; `b`; `c`], `d /\ e /\ f`)
}

\SEEALSO
splitlist, rev_splitlist, striplist.

\ENDDOC