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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953
|
\chapter{ML Functions in the trs Library}\input{entries-intro}\DOC{Ancestors}
\TYPE {\small\verb%Ancestors : ((string list # string list) -> searchpath)%}\egroup
\SYNOPSIS
Generates a {\small\verb%searchpath%} that consists of hierarchies of theory segments.
\DESCRIBE
A {\small\verb%searchpath%} is either a single theory segment, or it is a hierarchy of
theory segments. The latter is specified by a pair of lists. The theory
segments in the first list and all of their ancestors will be searched in a
breadth-first manner. No theory segment will be searched more than once. The
second list can be used to specify exclusions. Any theory segment in the
exclusion list or any ancestors of those theory segments will not be searched
unless they can be reached by a route which does not go through a theory
segment in the exclusion list. A {\small\verb%searchpath%} is generated from the pair of
lists by applying the function {\small\verb%Ancestors%}.
\FAILURE
Never fails.
\SEEALSO
ancestors_excluding, Ancestry, Theory.
\ENDDOC
\DOC{ancestors\_excluding}
\TYPE {\small\verb%ancestors_excluding : (string list -> string list -> searchpath)%}\egroup
\SYNOPSIS
Generates a {\small\verb%searchpath%} that consists of hierarchies of theory segments.
\DESCRIBE
A {\small\verb%searchpath%} is either a single theory segment, or it is a hierarchy of
theory segments. The latter is specified by two lists. The theory segments in
the second list and all of their ancestors will be searched in a breadth-first
manner. No theory segment will be searched more than once. The first list can
be used to specify exclusions. Any theory segment in the exclusion list or any
ancestors of those theory segments will not be searched unless they can be
reached by a route which does not go through a theory segment in the exclusion
list. A {\small\verb%searchpath%} is generated by applying {\small\verb%ancestors_excluding%} to the
two lists. The exclusion list is given first so that by making a partial
application a default exclusion list can be set up.
\FAILURE
Never fails.
\SEEALSO
Ancestors, Ancestry, Theory.
\ENDDOC
\DOC{Ancestry}
\TYPE {\small\verb%Ancestry : (string list -> searchpath)%}\egroup
\SYNOPSIS
Generates a {\small\verb%searchpath%} that consists of hierarchies of theory segments.
\DESCRIBE
A {\small\verb%searchpath%} is either a single theory segment, or it is a hierarchy of
theory segments. The latter is specified by a pair of lists. The theory
segments in the first list and all of their ancestors will be searched in a
breadth-first manner. No theory segment will be searched more than once. The
second list can be used to specify exclusions. Any theory segment in the
exclusion list or any ancestors of those theory segments will not be searched
unless they can be reached by a route which does not go through a theory
segment in the exclusion list. A {\small\verb%searchpath%} that does not include the main
theory hierarchy of the HOL system can be generated by applying the function
{\small\verb%Ancestry%} to a list of theory segments. {\small\verb%Ancestry%} uses {\small\verb%[`HOL`]%} as its
exclusion list.
\FAILURE
Never fails.
\SEEALSO
Ancestors, ancestors_excluding, Theory.
\ENDDOC
\DOC{Andalso}
\TYPE {\small\verb%$Andalso : ((thmpattern # thmpattern) -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that matches if and only if both the argument patterns
match.
\FAILURE
Never fails.
\SEEALSO
Orelse, Not, Where, BigAnd, BigOr, kind, thryname, thmname, conc, hypP, hypF.
\ENDDOC
\DOC{Axiom}
\TYPE {\small\verb%Axiom : thmkind%}\egroup
\SYNOPSIS
Identifier denoting a `kind of theorem', specifically an axiom.
\USES
Used to generate patterns that test the `kind' of a theorem.
\SEEALSO
Definition, Theorem, kind.
\ENDDOC
\DOC{BigAnd}
\TYPE {\small\verb%BigAnd : (thmpattern list -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that matches if and only if all of the argument patterns
match.
\FAILURE
Never fails.
\SEEALSO
BigOr, Andalso, Orelse, Not, Where, kind, thryname, thmname, conc, hypP, hypF.
\ENDDOC
\DOC{BigOr}
\TYPE {\small\verb%BigOr : (thmpattern list -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that matches if and only if one or more of the argument
patterns match.
\FAILURE
Never fails.
\SEEALSO
BigAnd, Andalso, Orelse, Not, Where, kind, thryname, thmname, conc, hypP, hypF.
\ENDDOC
\DOC{conc}
\TYPE {\small\verb%conc : (term -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern for testing the conclusion of a theorem.
\DESCRIBE
{\small\verb%conc t%} returns a pattern that matches a theorem if and only if the
term {\small\verb%t%}, when interpreted as a pattern, matches the conclusion of the theorem.
Variables in {\small\verb%t%} match any term of a matching type. Type variables in {\small\verb%t%}
match any type. If a variable or type variable occurs more than once in {\small\verb%t%},
it must match to the same object at each occurrence. If not, {\small\verb%t%} will not
match the term.
\FAILURE
Never fails.
\SEEALSO
hypP, hypF, kind, thryname, thmname, Andalso, Orelse, Not, Where, BigAnd,
BigOr.
\ENDDOC
\DOC{contains}
\TYPE {\small\verb%$contains : (term -> term -> thmpattern)%}\egroup
\SYNOPSIS
Side-condition test. Tests the value bound to a pattern variable to see if
any part of it matches a new pattern.
\DESCRIBE
{\small\verb%contains%} can be used to test whether part of a hypothesis or conclusion
contains a term, anywhere within it, that matches a pattern. Its first
argument is a variable used in a pattern for the hypothesis/conclusion. The
other argument is the pattern to be searched for within the term to which the
variable has been matched.
\FAILURE
Fails if the first argument is not a variable. May also cause a failure to
match, when used in a search, if the pattern variable does not appear in the
binding.
\EXAMPLE
Here is a pattern that matches a theorem if the conclusion is an equality in
which the right-hand side contains a conjunction.
{\par\samepage\setseps\small
\begin{verbatim}
(conc "l = (r:*)") Where ("r:*" contains "x /\ y")
\end{verbatim}
}
\SEEALSO
matches, has_body, Where.
\ENDDOC
\DOC{continue\_search}
\TYPE {\small\verb%continue_search : (searchstep -> searchstep)%}\egroup
\SYNOPSIS
Function to continue a search.
\DESCRIBE
A search can be continued using the function {\small\verb%continue_search%}. It takes a
step of a search as argument, and performs the next step of the search. The
steps correspond to searches of individual theory segments.
\FAILURE
Fails if the step given as argument is a final step. The function may fail for
other reasons. Since the user may supply his/her own side-condition functions
at the beginning of the search, an exhaustive list of possible failures cannot
be given.
\SEEALSO
CS, find_theorems, FT, show_step, run_search, full_search, search_until_find,
search_n_theories, search_n_until_find.
\ENDDOC
\DOC{CS}
\TYPE {\small\verb%CS : (searchstep -> searchstep)%}\egroup
\SYNOPSIS
Function to continue a search. Abbreviation for {\small\verb%continue_search%}.
\DESCRIBE
A search can be continued using the function {\small\verb%CS%}. It takes a step of a search
as argument, and performs the next step of the search. The steps correspond to
searches of individual theory segments.
\FAILURE
Fails if the step given as argument is a final step. The function may fail for
other reasons. Since the user may supply his/her own side-condition functions
at the beginning of the search, an exhaustive list of possible failures cannot
be given.
\SEEALSO
continue_search, find_theorems, FT, show_step, run_search, full_search,
search_until_find, search_n_theories, search_n_until_find.
\ENDDOC
\DOC{Definition}
\TYPE {\small\verb%Definition : thmkind%}\egroup
\SYNOPSIS
Identifier denoting a `kind of theorem', specifically a definition.
\USES
Used to generate patterns that test the `kind' of a theorem.
\SEEALSO
Axiom, Theorem, kind.
\ENDDOC
\DOC{Endofsearch}
\TYPE {\small\verb%Endofsearch : (foundthm list -> searchstep)%}\egroup
\SYNOPSIS
Constructor function for the final step of a search.
\DESCRIBE
Searches proceed in steps, one theory segment at a time. At the end of the
search, the theorems found are presented using the constructor {\small\verb%Endofsearch%}.
At intermediate steps, the name of the theory being searched is displayed. If
the search halts after an intermediate step, a list of theorems found so far
and a function to continue the search are returned.
\FAILURE
Never fails.
\SEEALSO
Step, find_theorems, continue_search, show_step.
\ENDDOC
\DOC{find\_theorems}
\TYPE {\small\verb%find_theorems : (thmpattern -> source -> searchstep)%}\egroup
\SYNOPSIS
The main searching function. Performs the first step of a search.
\DESCRIBE
A search can be initiated using the function {\small\verb%find_theorems%}. It takes a
pattern and a source as arguments, and performs the first step of the search.
If the source was a list of theorems there is only one step. Otherwise, the
steps correspond to searches of individual theory segments.
\FAILURE
Fails if any theory segment in the source is not an ancestor of the current
theory segment. Also fails if a side-condition in the pattern attempts to test
the binding of a variable that does not occur in the main part of the pattern.
The function may fail for other similar reasons. Since the user may supply
his/her own side-condition functions, an exhaustive list of possible failures
cannot be given.
\SEEALSO
FT, continue_search, CS, show_step, run_search, full_search, search_until_find,
search_n_theories, search_n_until_find.
\ENDDOC
\DOC{FT}
\TYPE {\small\verb%FT : (thmpattern -> source -> searchstep)%}\egroup
\SYNOPSIS
The main searching function. Performs the first step of a search.
Abbreviation for {\small\verb%find_theorems%}.
\DESCRIBE
A search can be initiated using the function {\small\verb%FT%}. It takes a pattern and a
source as arguments, and performs the first step of the search. If the source
was a list of theorems there is only one step. Otherwise, the steps correspond
to searches of individual theory segments.
\FAILURE
Fails if any theory segment in the source is not an ancestor of the current
theory segment. Also fails if a side-condition in the pattern attempts to test
the binding of a variable that does not occur in the main part of the pattern.
The function may fail for other similar reasons. Since the user may supply
his/her own side-condition functions, an exhaustive list of possible failures
cannot be given.
\SEEALSO
find_theorems, continue_search, CS, show_step, run_search, full_search,
search_until_find, search_n_theories, search_n_until_find.
\ENDDOC
\DOC{full\_search}
\TYPE {\small\verb%full_search : (thmpattern -> source -> foundthm list)%}\egroup
\SYNOPSIS
Function to perform a complete search.
\DESCRIBE
A search can be performed using the function {\small\verb%full_search%}. It takes a pattern
and a source as arguments, and performs every step of the search without
pausing. If the source was a list of theorems there is only one step.
Otherwise, the steps correspond to searches of individual theory segments.
The result of {\small\verb%full_search%} is a list of theorems found during the search.
\FAILURE
Fails if any theory segment in the source is not an ancestor of the current
theory segment. Also fails if a side-condition in the pattern attempts to test
the binding of a variable that does not occur in the main part of the pattern.
The function may fail for other similar reasons. Since the user may supply
his/her own side-condition functions, an exhaustive list of possible failures
cannot be given.
\SEEALSO
find_theorems, FT, run_search, continue_search, CS, show_step,
search_until_find, search_n_theories, search_n_until_find.
\ENDDOC
\DOC{has\_body}
\TYPE {\small\verb%$has_body : (term -> term -> thmpattern)%}\egroup
\SYNOPSIS
Side-condition test. Tests the value bound to a pattern variable to see if
its body matches a new pattern.
\DESCRIBE
{\small\verb%has_body%} can be used to test whether part of a hypothesis or conclusion
has, as its body, a term that matches a specified pattern. The first argument
is a variable used in a pattern for the hypothesis/conclusion. Let {\small\verb%t%} be the
term to which this variable has been bound. The second argument is the pattern
to be matched with the body of {\small\verb%t%}. The body of a term, in this context, is
the result of stripping any binders from the front of the term.
\FAILURE
Fails if the first argument is not a variable. May also cause a failure to
match, when used in a search, if the pattern variable does not appear in the
binding.
\EXAMPLE
Here is a pattern that matches a theorem if the conclusion is an implication
in which the consequent has a conjunction as its body:
{\par\samepage\setseps\small
\begin{verbatim}
(conc "p ==> q") Where ("q:bool" has_body "x /\ y")
\end{verbatim}
}
\noindent Such a consequent is {\small\verb%"!a b c. a /\ (b \/ c)"%}.
\SEEALSO
contains, matches, Where.
\ENDDOC
\DOC{hypF}
\TYPE {\small\verb%hypF : (term list -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern for testing the hypotheses of a theorem (full match).
\DESCRIBE
{\small\verb%hypF ts%} returns a pattern that matches a theorem if and only if the
terms {\small\verb%ts%}, when interpreted as patterns, match the hypotheses of the theorem.
Each term pattern must match to a distinct hypothesis, and all the hypotheses
must be matched. Variables in a term {\small\verb%t%} match any term of a matching type.
Type variables in {\small\verb%t%} match any type. If a variable or type variable occurs
more than once in the list {\small\verb%ts%}, it must match to the same object at each
occurrence. If not, the match will not succeed.
\FAILURE
Never fails.
\SEEALSO
hypP, conc, kind, thryname, thmname, Andalso, Orelse, Not, Where, BigAnd,
BigOr.
\ENDDOC
\DOC{hypP}
\TYPE {\small\verb%hypP : (term list -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern for testing the hypotheses of a theorem (partial match).
\DESCRIBE
{\small\verb%hypP ts%} returns a pattern that matches a theorem if and only if the
terms {\small\verb%ts%}, when interpreted as patterns, match the hypotheses of the theorem.
Each term pattern must match to a distinct hypothesis, but if there are more
hypotheses than patterns, the match may still succeed. Variables in a term {\small\verb%t%}
match any term of a matching type. Type variables in {\small\verb%t%} match any type. If a
variable or type variable occurs more than once in the list {\small\verb%ts%}, it must
match to the same object at each occurrence. If not, the match will not
succeed.
\FAILURE
Never fails.
\SEEALSO
hypF, conc, kind, thryname, thmname, Andalso, Orelse, Not, Where, BigAnd,
BigOr.
\ENDDOC
\DOC{kind}
\TYPE {\small\verb%kind : (thmkind -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern from a `kind of theorem'.
\DESCRIBE
{\small\verb%kind x%} where {\small\verb%x%} is one of {\small\verb%Axiom%}, {\small\verb%Definition%}, {\small\verb%Theorem%}, returns a
pattern which matches a theorem if and only if it is an axiom, a definition,
or a derived theorem respectively. The pattern can be used in a search for
theorems.
\FAILURE
Never fails.
\SEEALSO
Axiom, Definition, Theorem, thryname, thmname, conc, hypP, hypF, Andalso,
Orelse, Not, Where, BigAnd, BigOr.
\ENDDOC
\DOC{List}
\TYPE {\small\verb%List : (foundthm list -> source)%}\egroup
\SYNOPSIS
Generates a source for a search from a list of previously found theorems.
\DESCRIBE
A {\small\verb%source%} for a search can be either a list of search paths, or a list of
theorems found on a previous search. {\small\verb%List%} generates a {\small\verb%source%} of the second
kind.
\FAILURE
Never fails.
\SEEALSO
List_from, Paths.
\ENDDOC
\DOC{List\_from}
\TYPE {\small\verb%List_from : (searchstep -> source)%}\egroup
\SYNOPSIS
Generates a source for a search from the result of a previous search.
\DESCRIBE
A {\small\verb%source%} for a search can be either a list of search paths, or a list of
theorems found on a previous search. {\small\verb%List_from%} generates a {\small\verb%source%} of the
second kind from a step of a previous search. It extracts the list of found
theorems from the {\small\verb%searchstep%}, and gives them to {\small\verb%List%}.
\FAILURE
Never fails.
\SEEALSO
List, Paths.
\ENDDOC
\DOC{matches}
\TYPE {\small\verb%$matches : (term -> term -> thmpattern)%}\egroup
\SYNOPSIS
Side-condition test. Tests the value bound to a pattern variable to see if
it matches a new pattern.
\DESCRIBE
{\small\verb%matches%} can be used to test whether part of a hypothesis or conclusion
is a term that matches a specified pattern. Its first argument is a variable
used in a pattern for the hypothesis/conclusion. The other argument is the
pattern to be matched with the term to which the variable has been bound. The
pattern is only tested directly against the term; no attempt is made to match
inside the term.
\FAILURE
Fails if the first argument is not a variable. May also cause a failure to
match, when used in a search, if the pattern variable does not appear in the
binding.
\EXAMPLE
Here is a pattern that matches a theorem if the conclusion is an equality in
which the right-hand side is a conjunction:
{\par\samepage\setseps\small
\begin{verbatim}
(conc "l = (r:bool)") Where ("r:bool" matches "x /\ y")
\end{verbatim}
}
\noindent In this simple example, we could equally well have used the following
pattern:
{\par\samepage\setseps\small
\begin{verbatim}
conc "l = (x /\ y)"
\end{verbatim}
}
\SEEALSO
contains, has_body, Where.
\ENDDOC
\DOC{Not}
\TYPE {\small\verb%Not : (thmpattern -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that matches if the argument pattern does not match.
\DESCRIBE
Note that {\small\verb%Not%} throws away binding information. So, one cannot test the
bindings of pattern variables occurring in the pattern used as argument to
{\small\verb%Not%} (at least not from outside the {\small\verb%Not%}).
\FAILURE
Never fails.
\SEEALSO
Andalso, Orelse, Where, BigAnd, BigOr, kind, thryname, thmname, conc, hypP,
hypF.
\ENDDOC
\DOC{Orelse}
\TYPE {\small\verb%$Orelse : ((thmpattern # thmpattern) -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that matches if and only if one or both of the argument
patterns match.
\FAILURE
Never fails.
\SEEALSO
Andalso, Not, Where, BigAnd, BigOr, kind, thryname, thmname, conc, hypP, hypF.
\ENDDOC
\DOC{Paths}
\TYPE {\small\verb%Paths : (searchpath list -> source)%}\egroup
\SYNOPSIS
Generates a source for a search from a list of search paths.
\DESCRIBE
A {\small\verb%source%} for a search can be either a list of search paths, or a list of
theorems found on a previous search. {\small\verb%Paths%} generates a {\small\verb%source%} of the first
kind. The search paths in such a {\small\verb%source%} are searched in sequence.
\FAILURE
Never fails.
\EXAMPLE
To search the ancestry of the theories `{\small\verb%theory1%}' and `{\small\verb%theory2%}' in
`parallel', one would use the source:
{\par\samepage\setseps\small
\begin{verbatim}
Paths [Ancestors ([`theory1`;`theory2`],[])]
\end{verbatim}
}
\noindent To search them in sequence, one would use:
{\par\samepage\setseps\small
\begin{verbatim}
Paths [Ancestors ([`theory1`],[]); Ancestors ([`theory2`],[])]
\end{verbatim}
}
\SEEALSO
List, List_from, Theory, Ancestors.
\ENDDOC
\DOC{run\_search}
\TYPE {\small\verb%run_search : (searchstep -> foundthm list)%}\egroup
\SYNOPSIS
Function to run a stepwise search to completion.
\DESCRIBE
A search can be run to completion using the function {\small\verb%run_search%}. It takes a
step of a search as argument, and performs the remaining steps of the search.
The steps correspond to searches of individual theory segments. The result of
{\small\verb%run_search%} is a list of all the theorems found during the entire search.
\FAILURE
The function may fail for a number of obscure reasons. Since the user may
supply his/her own side-condition functions at the beginning of the search, an
exhaustive list of possible failures cannot be given.
\SEEALSO
find_theorems, FT, continue_search, CS, show_step, full_search,
search_until_find, search_n_theories, search_n_until_find.
\ENDDOC
\DOC{search\_n\_theories}
\TYPE {\small\verb%search_n_theories : (int -> searchstep -> searchstep)%}\egroup
\SYNOPSIS
Function to continue a search for a specified number of steps.
\DESCRIBE
{\small\verb%search_n_theories%} continues a search for a specified number of steps or
until there are no more steps to be performed. It takes an integer and a step
of a search as arguments, and returns a new step.
\FAILURE
The function may fail for a number of obscure reasons. Since the user may
supply his/her own side-condition functions at the beginning of the search, an
exhaustive list of possible failures cannot be given.
\SEEALSO
continue_search, CS, search_until_find, search_n_until_find, find_theorems,
FT, show_step, run_search, full_search.
\ENDDOC
\DOC{search\_n\_until\_find}
\TYPE {\small\verb%search_n_until_find : (int -> searchstep -> searchstep)%}\egroup
\SYNOPSIS
Function to continue a search for a specified number of steps or until a
matching theorem is found.
\DESCRIBE
{\small\verb%search_n_until_find%} continues a search for a specified number of steps or
until a matching theorem is found. If the list of theorems already found is
non-empty the function does nothing. It takes an integer and a step
of a search as arguments, and returns a new step.
\FAILURE
Fails if the steps are exhausted before a theorem is found or the specified
number of steps have been completed. The function may fail for other reasons.
Since the user may supply his/her own side-condition functions at the
beginning of the search, an exhaustive list of possible failures cannot be
given.
\SEEALSO
continue_search, CS, search_until_find, search_n_theories, find_theorems, FT,
show_step, run_search, full_search.
\ENDDOC
\DOC{search\_until\_find}
\TYPE {\small\verb%search_until_find : (searchstep -> searchstep)%}\egroup
\SYNOPSIS
Function to continue a search until a matching theorem is found.
\DESCRIBE
{\small\verb%search_until_find%} continues a search until a matching theorem is found. If
the list of theorems already found is non-empty the function does nothing.
{\small\verb%search_until_find%} takes a step of a search as argument and returns a new
step.
\FAILURE
Fails if the steps are exhausted before a theorem is found. The function may
fail for other reasons. Since the user may supply his/her own side-condition
functions at the beginning of the search, an exhaustive list of possible
failures cannot be given.
\SEEALSO
continue_search, CS, search_n_theories, search_n_until_find, find_theorems,
FT, show_step, run_search, full_search.
\ENDDOC
\DOC{show\_step}
\TYPE {\small\verb%show_step : (searchstep -> foundthm list)%}\egroup
\SYNOPSIS
Function to extract a list of the found theorems from a search step.
\FAILURE
Never fails.
\SEEALSO
find_theorems, FT, continue_search, CS, run_search, full_search,
search_until_find, search_n_theories, search_n_until_find.
\ENDDOC
\DOC{Step}
\TYPE {\small\verb%Step : ((foundthm list # (void -> searchstep)) -> searchstep)%}\egroup
\SYNOPSIS
Constructor function for intermediate steps of a search.
\DESCRIBE
Searches proceed in steps, one theory segment at a time. At the end of the
search, the theorems found are presented. At intermediate steps, the name of
the theory being searched is displayed. If the search halts after an
intermediate step, a list of theorems found so far and a function to continue
the search are returned by means of the constructor {\small\verb%Step%}.
\FAILURE
Never fails.
\SEEALSO
Endofsearch, find_theorems, continue_search, show_step.
\ENDDOC
\DOC{test1term}
\TYPE {\small\verb%test1term : ((term -> bool) -> term -> thmpattern)%}\egroup
\SYNOPSIS
Function for generating a side-condition test from a predicate.
\DESCRIBE
{\small\verb%test1term%} takes a predicate and a term as arguments and produces a
side-condition test. The term is a pattern variable. When the side-condition
comes to be applied, the pattern variable is looked up in the binding created
by the match. The bound object is then fed to the predicate. The side-condition
succeeds or fails based on the Boolean result.
Note that user defined functions which indicate a failure to match by raising
an exception should do so with the string {\small\verb%`no match`%}.
\FAILURE
Fails if the term argument is not a variable. May also cause a failure to
match, when used in a search, if the pattern variable does not appear in the
binding.
\SEEALSO
test1type, test2terms, test2types, Where, contains, matches, has_body.
\ENDDOC
\DOC{test1type}
\TYPE {\small\verb%test1type : ((type -> bool) -> type -> thmpattern)%}\egroup
\SYNOPSIS
Function for generating a side-condition test from a predicate.
\DESCRIBE
{\small\verb%test1type%} takes a predicate and a type as arguments and produces a
side-condition test. The type is a pattern variable. When the side-condition
comes to be applied, the pattern variable is looked up in the binding created
by the match. The bound object is then fed to the predicate. The side-condition
succeeds or fails based on the Boolean result.
Note that user defined functions which indicate a failure to match by raising
an exception should do so with the string {\small\verb%`no match`%}.
\FAILURE
Fails if the type argument is not a type variable. May also cause a failure to
match, when used in a search, if the pattern variable does not appear in the
binding.
\SEEALSO
test1term, test2terms, test2types, Where, contains, matches, has_body.
\ENDDOC
\DOC{test2terms}
\TYPE {\small\verb%test2terms : ((term -> term -> bool) -> term -> term -> thmpattern)%}\egroup
\SYNOPSIS
Function for generating a side-condition test from a predicate.
\DESCRIBE
{\small\verb%test2terms%} takes a predicate and two terms as arguments and produces a
side-condition test. The terms are pattern variables. When the side-condition
comes to be applied, the pattern variables are looked up in the binding
created by the match. The bound objects are then fed to the predicate. The
side-condition succeeds or fails based on the Boolean result.
Note that user defined functions which indicate a failure to match by raising
an exception should do so with the string {\small\verb%`no match`%}.
\FAILURE
Fails if either of the term arguments is not a variable. May also cause a
failure to match, when used in a search, if either of the pattern variables do
not appear in the binding.
\SEEALSO
test1term, test1type, test2types, Where, contains, matches, has_body.
\ENDDOC
\DOC{test2types}
\TYPE {\small\verb%test2types : ((type -> type -> bool) -> type -> type -> thmpattern)%}\egroup
\SYNOPSIS
Function for generating a side-condition test from a predicate.
\DESCRIBE
{\small\verb%test2types%} takes a predicate and two types as arguments and produces a
side-condition test. The types are pattern variables. When the side-condition
comes to be applied, the pattern variables are looked up in the binding
created by the match. The bound objects are then fed to the predicate. The
side-condition succeeds or fails based on the Boolean result.
Note that user defined functions which indicate a failure to match by raising
an exception should do so with the string {\small\verb%`no match`%}.
\FAILURE
Fails if either of the type arguments is not a type variable. May also cause a
failure to match, when used in a search, if either of the pattern variables do
not appear in the binding.
\SEEALSO
test1type, test1term, test2terms, Where, contains, matches, has_body.
\ENDDOC
\DOC{Theorem}
\TYPE {\small\verb%Theorem : thmkind%}\egroup
\SYNOPSIS
Identifier denoting a `kind of theorem', specifically a derived theorem.
\USES
Used to generate patterns that test the `kind' of a theorem.
\SEEALSO
Axiom, Definition, kind.
\ENDDOC
\DOC{Theory}
\TYPE {\small\verb%Theory : (string -> searchpath)%}\egroup
\SYNOPSIS
Generates a {\small\verb%searchpath%} that consists precisely of the named theory segment.
\DESCRIBE
A {\small\verb%searchpath%} is either a single theory segment, or it is a hierarchy of
theory segments. {\small\verb%Theory%} is used to generate a {\small\verb%searchpath%} of the first
kind. A search path is, as its name suggests, a specification of where a
search for theorems should take place.
\FAILURE
Never fails.
\SEEALSO
Ancestors, ancestors_excluding, Ancestry.
\ENDDOC
\DOC{thmname}
\TYPE {\small\verb%thmname : (string -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern for testing the name of a theorem.
\DESCRIBE
{\small\verb%thmname s%} returns a pattern that matches a theorem if and only if the
string {\small\verb%s%} when interpreted as a pattern for names matches the name of the
theorem. The string is used as a pattern in which {\small\verb%*%} is interpreted as
`match any number of characters (including none)' and {\small\verb%?%} is interpreted as
`match any single character'. All other characters in the string are taken
literally.
\FAILURE
Never fails.
\SEEALSO
thryname, kind, conc, hypP, hypF, Andalso, Orelse, Not, Where, BigAnd, BigOr.
\ENDDOC
\DOC{thryname}
\TYPE {\small\verb%thryname : (string -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern for testing the name of the theory to which a theorem
belongs.
\DESCRIBE
{\small\verb%thryname s%} returns a pattern that matches a theorem if and only if the
string {\small\verb%s%} when interpreted as a pattern for names matches the name of the
theory to which the theorem belongs. The string is used as a pattern in
which {\small\verb%*%} is interpreted as `match any number of characters (including
none)' and {\small\verb%?%} is interpreted as `match any single character'. All other
characters in the string are taken literally.
\FAILURE
Never fails.
\SEEALSO
thmname, kind, conc, hypP, hypF, Andalso, Orelse, Not, Where, BigAnd, BigOr.
\ENDDOC
\DOC{Where}
\TYPE {\small\verb%$Where : ((thmpattern # thmpattern) -> thmpattern)%}\egroup
\SYNOPSIS
Generates a pattern that attempts a match, and if this is successful applies
a test to the resulting binding.
\DESCRIBE
{\small\verb%Where%} is used for side-condition tests. Its first argument is a main clause.
The second argument is a side-condition clause and should only contain tests
on the bindings generated by the first argument. These tests may be combined
using the connectives {\small\verb%Andalso%}, {\small\verb%Orelse%} and {\small\verb%Not%}.
{\small\verb%Where%} should not occur within a side-condition clause. Strictly speaking,
side-condition tests should not be allowed to occur within a main clause.
However such an occurrence is interpreted as:
{\par\samepage\setseps\small
\begin{verbatim}
(conc "conc:bool") Where (<side-condition test>)
\end{verbatim}
}
\noindent This is only of use if the side-condition tests the binding of the
pattern variable {\small\verb%"conc"%} (a term).
\FAILURE
Fails if the second argument is not a legal side-condition. A side-condition
can only contain tests on bindings, and the connectives {\small\verb%Andalso%}, {\small\verb%Orelse%}
and {\small\verb%Not%}.
\SEEALSO
Andalso, Orelse, Not, BigAnd, BigOr, kind, thryname, thmname, conc, hypP, hypF.
\ENDDOC
|