Debian Codegraph @

contrib/wordn/help/ENTRIES/wordn_X_CASES_TAC.doc

raw
1 \DOC wordn_X_CASES_TAC
2
3 \TYPE {wordn_X_CASES_TAC : term -> thm -> (term list) -> tactic}
4
5 \LIBRARY wordn
6
7 \SYNOPSIS
8 Instantiates variables of type {:wordn} with a list of bits.
9
10 \DESCRIBE
11 The tactic {wordn_X_CASES_TAC} instantiates occurrences of a variable of
12 type {:wordn} in the goal with a list of bits. It takes, as its
13 arguments, a term which indicates which variable is to be
14 instantiated, a theorem which should in the form returned by
15 {prove_wordn_cases} and a list of terms which is used as the bits in
16 the instantiation. The specification of {wordn_X_CASES_TAC} is:
17 {
18 A ?- t[w]
19 =============================== wordn_X_CASES_TAC "w" wordn_CASES
20 A ?- t[WORDn[c0;...;cn-1]/w] ["c0";..."cn-1"]
21 }
22 \noindent where {wordn_CASES} has the following theorem:
23 {
24 |- !w. ?b0...bn. w = WORDn[b0;...bn]
25 }
26
27 This function specializes the universally quantified variable in the
28 theorem {wordn_CASES} with the given term which should match the
29 variable required to be instantiated in the goal. It then eliminates
30 the existentially quantified vairables {b0},...,{bn-1} using the terms
31 given in the last argument as specific witness.
32 It then substitutes the right-hand side of the
33 equation for the occurrences of the variable {w} in the goal.
34
35 \FAILURE
36 Fails if the substitution cannot be performed due to no matching
37 variable of the correct type is found, or the supplied
38 terms involve variables which are free in the assumption or other reasons
39 as given in the failure conditions of {X_CHOOSE_TAC} and {SUBST1_TAC}.
40
41 \EXAMPLE
42 Suppose that one wants to solve the following goal:
43 {
44 "!w. LENGTH(BITS3 w) = 3"
45 }
46 \noindent The tactic {GEN_TAC THEN wordn_X_CASES_TAC "w" word3_CASES ["c1";"c2";"c3"]}
47 may be used to transform it to
48 {
49 "LENGTH(BITS3(WORD3[c1;c2;c3])) = 3"
50 }
51
52 \SEEALSO
53 {wordn_CASES_TAC}, {prove_wordn_cases_thm},
54 {X_CHOOSE_TAC}, {SUBST1_TAC}.
55
56 \ENDDOC