File: lhand.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 (42 lines) | stat: -rw-r--r-- 962 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
36
37
38
39
40
41
42
\DOC lhand

\TYPE {lhand : term -> term}

\SYNOPSIS
Take left-hand argument of a binary operator.

\DESCRIBE
When applied to a term {t} that is an application of a binary operator to two 
arguments, i.e. is of the form {(op l) r}, the call {lhand t} will return the 
left-hand argument {l}. The terms {op} and {r} are arbitrary, though in many 
applications {op} is a constant such as addition or equality.

\FAILURE
Fails if the term is not of the indicated form.

\EXAMPLE
{
  # lhand `1 + 2`;;
  val it : term = `1`
  
  # lhand `2 + 2 = 4`;;
  val it : term = `2 + 2`
  
  # lhand `f x y z`;;
  Warning: inventing type variables
  val it : term = `y`
  
  # lhand `if p then q else r`;;
  Warning: inventing type variables
  val it : term = `q`
}

\COMMENTS
On equations, {lhand} has the same effect as {lhs}, but may be slightly quicker
because it does not check whether the operator {op} is indeed the equality
constant.

\SEEALSO
lhs, rand, rhs.

\ENDDOC