File: mk_const.doc

package info (click to toggle)
hol-light 20120602-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,452 kB
  • sloc: ml: 348,797; cpp: 438; java: 279; makefile: 252; sh: 183; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (35 lines) | stat: -rw-r--r-- 979 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
34
35
\DOC mk_const

\TYPE {mk_const : string * (hol_type * hol_type) list -> term}

\SYNOPSIS
Produce constant term by applying an instantiation to its generic type.

\DESCRIBE
This is the basic way of constructing a constant term in HOL Light, applying a 
specific instantiation (by {type_subst}) to its generic type. It may sometimes 
be more convenient to use {mk_mconst}, which just takes the desired type for 
the constant and finds the instantiation itself; that is also a natural inverse 
for {dest_const}. However, {mk_const} is likely to be significantly faster.

\FAILURE
Fails if there is no constant of the given type.

\EXAMPLE
{
  # get_const_type "=";;
  val it : hol_type = `:A->A->bool`
  
  # mk_const("=",[`:num`,`:A`]);;
  val it : term = `(=)`
  # type_of it;;
  val it : hol_type = `:num->num->bool`
  
  # mk_const("=",[`:num`,`:A`]) = mk_mconst("=",`:num->num->bool`);;
  val it : bool = true
}

\SEEALSO
dest_const, is_const, mk_mconst, type_subst.
 
\ENDDOC