File: term_match.doc

package info (click to toggle)
hol-light 20131026-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,264 kB
  • ctags: 4,620
  • sloc: ml: 400,325; cpp: 438; java: 279; lisp: 261; makefile: 256; sh: 190; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (38 lines) | stat: -rw-r--r-- 1,241 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
\DOC term_match

\TYPE {term_match : term list -> term -> term -> instantiation}

\SYNOPSIS
Match one term against another.

\DESCRIBE
The call {term_match lcs t t'} attempts to find an instantiation for free
variables in {t}, not permitting assignment of `local constant' variables in
the list {lcs}, so that it is alpha-equivalent to {t'}. If it succeeds, the
appropriate instantiation is returned. Otherwise it fails. The matching is
higher-order in a limited sense; see {PART_MATCH} for more illustrations.

\FAILURE
Fails if terms cannot be matched.

\EXAMPLE
{
  # term_match [] `x + y + 1` `(y + 1) + z + 1`;;
  val it : instantiation = ([], [(`z`, `y`); (`y + 1`, `x`)], [])

  # term_match [] `~(?x:A. P x)` `~(?n. 5 < n /\ n < 6)`;;
  val it : instantiation =
    ([(1, `P`)], [(`\n. 5 < n /\ n < 6`, `P`)], [(`:num`, `:A`)])
}

\COMMENTS
This function can occasionally `succeed' yet produce a match that does not in 
fact work. In typical uses, this will be implicitly checked by a subsequent 
inference process. However, to get a self-contained matching effect, the user 
should check that the instantiation returned does achieve a match, e.g. by 
applying {instantiate}.

\SEEALSO
instantiate, INSTANTIATE, PART_MATCH.

\ENDDOC