File: mk_list.doc

package info (click to toggle)
hol-light 20131026-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,264 kB
  • ctags: 4,620
  • sloc: ml: 400,325; cpp: 438; java: 279; lisp: 261; makefile: 256; sh: 190; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (33 lines) | stat: -rw-r--r-- 727 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
31
32
33
\DOC mk_list

\TYPE {mk_list : term list * hol_type -> term}

\SYNOPSIS
Constructs object-level list from list of terms.

\DESCRIBE
{mk_list([`t1`;...;`tn`],`:ty`)} returns {`[t1;...;tn]:(ty)list`}.
The type argument is required so that empty lists can be constructed. If you
know the list is nonempty, you can just use {mk_flist} where this is not
required.

\FAILURE
Fails with if any term in the list is not of the type specified as the second
argument.

\EXAMPLE
{
  # mk_list([`1`; `2`],`:num`);;                
  val it : term = `[1; 2]`

  # mk_list([],`:num`);;
  val it : term = `[]`

  # type_of it;;
  val it : hol_type = `:(num)list`
}

\SEEALSO
dest_cons, dest_list, is_cons, is_list, mk_cons, mk_flist.

\ENDDOC