File: mk_binary.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 (34 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (7)
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
\DOC mk_binary

\TYPE {mk_binary : string -> term * term -> term}

\SYNOPSIS
Constructs an instance of a named monomorphic binary operator.

\DESCRIBE
The call {mk_binary s (l,r)} constructs a binary application {(op l) r} where
{op} is the monomorphic constant with name {s}. Note that it will in general
{{\em not}} work if the constant is polymorphic.

\FAILURE
If there is no constant at all with name {s}, or if the constant is polymorphic
and the terms do not match its most general type.

\EXAMPLE
This case works fine:
{
  # mk_binary "+" (`1`,`2`);;
  val it : term = `1 + 2`
}
\noindent but here we hit the monomorphism restriction:
{
  # mk_binary "=" (`a:A`,`b:A`);;
  val it : term = `a = b`
  # mk_binary "=" (`1`,`2`);;
  Exception: Failure "mk_binary".
}

\SEEALSO
dest_binary, is_binary, mk_binop.

\ENDDOC