File: TOP_SWEEP_CONV.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 (39 lines) | stat: -rw-r--r-- 1,063 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
\DOC TOP_SWEEP_CONV

\TYPE {TOP_SWEEP_CONV : conv -> conv}

\SYNOPSIS
Repeatedly applies a conversion top-down at all levels, but after descending to
subterms, does not return to higher ones.

\DESCRIBE
The call {TOP_SWEEP_CONV conv} applies {conv} repeatedly at the top level of a 
term, and then descends into subterms of the result, recursively doing the same 
thing. However, once the subterms are dealt with, it does not, unlike 
{TOP_DEPTH_CONV conv}, return to re-examine them.

\FAILURE
Never fails.

\EXAMPLE
If we create an equation between large tuples:
{
  # let tm =
      let pairup x i t = mk_pair(mk_var(x^string_of_int i,aty),t) in
      let mkpairs x = itlist (pairup x) (1--200) (mk_var(x,aty)) in
    mk_eq(mkpairs "x",mkpairs "y");;
  ...
}
\noindent we can observe that 
{ 
  # time (TOP_DEPTH_CONV(REWR_CONV PAIR_EQ)); ();;
}
\noindent is a little bit slower than
{                                           
  # time (TOP_SWEEP_CONV(REWR_CONV PAIR_EQ)); ();;
}

\SEEALSO
DEPTH_CONV, ONCE_DEPTH_CONV, REDEPTH_CONV, TOP_DEPTH_CONV.

\ENDDOC