File: binops.doc

package info (click to toggle)
hol-light 20230128-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,636 kB
  • sloc: ml: 688,681; cpp: 439; makefile: 302; lisp: 286; java: 279; sh: 251; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (30 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (3)
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 binops

\TYPE {binops : term -> term -> term list}

\SYNOPSIS
Repeatedly breaks apart an iterated binary operator into components.

\DESCRIBE
The call {binops op t} repeatedly breaks down applications of the binary
operator {op} within {t}. If {t} is of the form {(op l) r} (thinking of {op} as
infix, {l op r}), then it recursively breaks down {l} and {r} in the same way
and appends the results. Otherwise, a singleton list of the original term is
returned.

\FAILURE
Never fails.

\EXAMPLE
{
  # binops `(+):num->num->num` `((1 + 2) + 3) + 4 + 5 + 6`;;
  val it : term list = [`1`; `2`; `3`; `4`; `5`; `6`]

  # binops `(+):num->num->num` `F`;;
  val it : term list = [`F`]
}

\SEEALSO
dest_binop, mk_binop, striplist.

\ENDDOC