
\DOC{INT\_CASES\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
INT_CASES_TAC : tactic
\end{verbatim}}\vspace*{-3mm}

\SYNOPSIS
A tactic for turning a problem over the integers into two cases over
the natural numbers.

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}
\noindent reduces a universally quantified goal over the integers,
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "!n:integer. P n")
\end{verbatim}}\vspace*{-3mm}
\noindent to two subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "!n1:num. P (INT n1)")

   (["!n1:num. P (INT n1)";a1;...;an], "!n2:num. P (neg(INT n2))")
\end{verbatim}}\vspace*{-3mm}
\noindent After making this reduction one can proceed by induction on the
natural numbers.


\FAILURE
The tactic {\small\verb%INT_CASES_TAC%} fails if it is applied to a goal that is
not a universal quantification over the type {\small\verb%":integer"%}.

\EXAMPLE
\vspace*{-3mm}{\small\begin{verbatim}
   INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}
\noindent when applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   (["SUBGROUP((\N. T),$plus)H"], "!m p. H p ==> H(m times p)")
\end{verbatim}}\vspace*{-3mm}
\noindent returns the subgoals
\vspace*{-3mm}{\small\begin{verbatim}
   (["SUBGROUP((\N. T),$plus)H"], "!n1 p. H p ==> H((INT n1) times p)")
\end{verbatim}}\vspace*{-3mm}
\noindent and
\vspace*{-3mm}{\small\begin{verbatim}
   (["!n1 p. H p ==> H((INT n1) times p)"; "SUBGROUP((\N. T),$plus)H"],
    "!n2 p. H p ==> H((neg(INT n2)) times p)")
\end{verbatim}}\vspace*{-3mm}

\USES
Reducing a goal over the integers to ones over the natural numbers,
where induction can be applied.

\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
SIMPLE_INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC

\DOC{SIMPLE\_INT\_CASES\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
SIMPLE_INT_CASES_TAC : tactic
\end{verbatim}}\vspace*{-3mm}

\SYNOPSIS
A tactic for splitting a problem over the integers into the three cases
of positive integers, negative integers, and zero.

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   SIMPLE_INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}
\noindent reduces a universally quantified goal over the integers,
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "!N:integer. P N")
\end{verbatim}}
\noindent to three subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "!N. POS N ==> P N")

   (["!N. POS N ==> P N";a1;...;an], "!N. NEG N ==> P N")

   ([a1;...;an], "P (INT 0)")
\end{verbatim}}\vspace*{-3mm}

\FAILURE
The tactic {\small\verb%SIMPLE_INT_CASES_TAC%} fails if it is applied to a goal
that is not a universal quantification over the type {\small\verb%":integer"%}.

\EXAMPLE
\vspace*{-3mm}{\small\begin{verbatim}
   SIMPLE_INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}
\noindent when applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   (["SUBGROUP((\N. T),$plus)H";
     "~(!m1. H m1 ==> (m1 = INT 0))";
     "!N. N below MIN ==> ~(POS N /\ H N)";
     "POS MIN";
     "H MIN"],
    "!N. H N ==> ?p. N = p times MIN")
\end{verbatim}}\vspace*{-3mm}
\noindent returns the subgoals
\vspace*{-3mm}{\small\begin{verbatim}
   (["SUBGROUP((\N. T),$plus)H";
     "~(!m1. H m1 ==> (m1 = INT 0))";
     "!N. N below MIN ==> ~(POS N /\ H N)";
     "POS MIN";
     "H MIN"],
    "!N. POS N ==> H N ==> ?p. N = p times MIN")

   (["!N. POS N ==> H N ==> ?p. N = p times MIN";
     "SUBGROUP((\N. T),$plus)H";
     "~(!m1. H m1 ==> (m1 = INT 0))";
     "!N. N below MIN ==> ~(POS N /\ H N)";
     "POS MIN";
     "H MIN"],
    "!N. NEG N ==> H N ==> ?p. N = p times MIN")

   (["SUBGROUP((\N. T),$plus)H";
     "~(!m1. H m1 ==> (m1 = INT 0))";
     "!N. N below MIN ==> ~(POS N /\ H N)";
     "POS MIN";
     "H MIN"],
    "H (INT 0) ==> ?p. INT 0 = p times MIN"
\end{verbatim}}\vspace*{-3mm}
The value for {\small\verb%p%} that is needed for the first of these subgoals is
the greatest integer that can be multiplied times {\small\verb%MIN%} and subtracted
from {\small\verb%N%} leaving a non-negative result.  (This value is not found
by induction (at least not in any direct fashion.)  The value for
{\small\verb%p%} needed for the second subgoal is the negative of the one given
for {\small\verb%neg N%} by the first case.  The value for {\small\verb%p%} in the last case is
(INT 0).

\USES
Reducing a goal over the integers to the cases of positive integers,
negative integers, and the zero case, particularly when you do not want
to reduce the problem to one of induction over the natural numbers.

\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
INT_CASES_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC

\DOC{INT\_MIN\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
INT_MIN_TAC : term -> tactic
\end{verbatim}}\vspace*{-3mm}

\SYNOPSIS
Tactic to add the assumption that {\small\verb%MIN%} is the least element 
given set of integers, and add the additional subgoals to prove
that such a least element exists.

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_MIN_TAC "S:integer -> bool"
\end{verbatim}}\vspace*{-3mm}
\noindent adds to a goal {\small\verb%([a1;...;an], Goal)%} the assumptions
\vspace*{-3mm}{\small\begin{verbatim}
   S MIN
\end{verbatim}}\vspace*{-3mm}
\noindent and
\vspace*{-3mm}{\small\begin{verbatim}
   !N. N below MIN ==> ~S N
\end{verbatim}}\vspace*{-3mm}
\noindent and returns the additional subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "?M:integer. S M")

   (["S M";a1;...;an], "?LB. !N. N below LB ==> ~S N")
\end{verbatim}}\vspace*{-3mm}
\noindent to show {\small\verb%S%} is not empty, and {\small\verb%S%} has a lower bound.

\FAILURE
The tactic {\small\verb%NT_MIN_TAC%} fails if it is not given a term of type
{\small\verb%":integer -> bool"%}.


\EXAMPLE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_MIN_TAC "\q. ~NEG (Y minus (q times X))";;
\end{verbatim}}\vspace*{-3mm}
\noindent when applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   (["POS X"; "POS Y"],
    "?q r. (Y = (q times X) plus r) /\ r below Y /\ ~NEG r")
\end{verbatim}}\vspace*{-3mm}
\noindent yields the following three subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   (["~NEG(Y minus (MIN times X))";
     "!N. N below MIN ==> ~~NEG(Y minus (N times X))";
     "POS X";
     "POS Y"],
    "?q r. (Y = (q times X) plus r) /\ r below Y /\ ~NEG r")

   (["POS X"; "POS Y"], "?M. ~NEG(Y minus (M times X))")

   (["~NEG(Y minus (M times X))"; "POS X"; "POS Y"],
    "?LB. !N. N below LB ==> ~~NEG(Y minus (N times X))");;
\end{verbatim}}\vspace*{-3mm}
\noindent The next step would then be to use {\small\verb%EXISTS_TAC "MIN:integer"%} on the
first subgoal.


\USES
Setting up to solve an existence goal, where the solution will be
given by the least element satisfying some property.


\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
INT_MAX_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC

\DOC{INT\_MAX\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
INT_MAX_TAC : term -> tactic
\end{verbatim}}\vspace*{-3mm}

\SYNOPSIS
Tactic to add the assumption that {\small\verb%MAX%} is the greatest element 
given set of integers, and add the additional subgoals to prove
that such a greatest element exists.

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_MAX_TAC "S:integer -> bool"
\end{verbatim}}\vspace*{-3mm}
\noindent adds to a goal {\small\verb%([a1;...;an], Goal)%} the assumptions
\vspace*{-3mm}{\small\begin{verbatim}
   S MAX
\end{verbatim}}\vspace*{-3mm}
\noindent and
\vspace*{-3mm}{\small\begin{verbatim}
   !N. MAX below N ==> ~S N
\end{verbatim}}\vspace*{-3mm}
\noindent and returns the additional subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   ([a1;...;an], "?M:integer. S M")

   (["S M";a1;...;an], "?UB. !N. UB below N ==> ~S N")
\end{verbatim}}\vspace*{-3mm}
\noindent to show {\small\verb%S%} is not empty, and {\small\verb%S%} has an upper bound.

\FAILURE
The tactic {\small\verb%NT_MAX_TAC%} fails if it is not given a term of type
{\small\verb%":integer -> bool"%}.


\EXAMPLE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_MAX_TAC "\q. ~POS (Y minus (q times X))";;
\end{verbatim}}\vspace*{-3mm}
\noindent when applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   (["POS X"; "POS Y"],
    "?q r. (Y = (q times X) minus r) /\ r below Y /\ ~NEG r")
\end{verbatim}}\vspace*{-3mm}
\noindent yields the following three subgoals:
\vspace*{-3mm}{\small\begin{verbatim}
   (["~POS(Y minus (MAX times X))";
     "!N. MAX below N ==> ~~POS(Y minus (N times X))";
     "POS X";
     "POS Y"],
    "?q r. (Y = (q times X) minus r) /\ r below Y /\ ~NEG r")

   (["POS X"; "POS Y"], "?M. ~POS(Y minus (M times X))")

   (["~POS(Y minus (M times X))"; "POS X"; "POS Y"],
    "?UB. !N. UB below N ==> ~~POS(Y minus (N times X))");;
\end{verbatim}}\vspace*{-3mm}
The next step would then be to use {\small\verb%EXISTS_TAC "MAX:integer"%} on the
first subgoal.


\USES
Setting up to solve an existence goal, where the solution will be
given by the greatest element satisfying some property.


\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
INT_MIN_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC

\DOC{INT\_RIGHT\_ASSOC\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
INT_RIGHT_ASSOC_TAC : term -> tactic
\end{verbatim}}\vspace*{-3mm}

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_RIGHT_ASSOC_TAC tm
\end{verbatim}}\vspace*{-3mm}
\noindent rewrites a goal {\small\verb%P(tm)%} into {\small\verb%P(tm')%} where {\small\verb%tm%} is of the form
{\small\verb%(a plus b) plus c)%} and {\small\verb%tm'%} is {\small\verb%(a plus (b plus c))%}.

\FAILURE
The tactic {\small\verb%INT_RIGHT_ASSOC_TAC%} fails if it is not given a term of
the form {\small\verb%((a plus b) plus c)%}.

\EXAMPLE
\vspace*{-3mm}{\small\begin{verbatim}
   INT_RIGHT_ASSOC_TAC " ((u plus v) plus s) plus t"
\end{verbatim}}\vspace*{-3mm}
\noindent applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   ([], "(((u plus v) plus s) plus t) plus (neg(s plus t)) = u plus v")
\end{verbatim}}\vspace*{-3mm}
\noindent returns the subgoal
\vspace*{-3mm}{\small\begin{verbatim}
   ([],"((u plus v) plus (s plus t)) plus (neg(s plus t)) = u plus v")
\end{verbatim}}\vspace*{-3mm}

\USES
Careful rewriting of computational expressions over the integers.

\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
GROUP_RIGHT_ASSOC_TAC, GROUP_LEFT_ASSOC_TAC, INT_LEFT_ASSOC_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC

\DOC{INT\_LEFT\_ASSOC\_TAC}
\vspace*{-3mm}{\small\begin{verbatim}
INT_LEFT_ASSOC_TAC : term -> tactic
\end{verbatim}}\vspace*{-3mm}

\DESCRIBE
The tactic
\vspace*{-3mm}{\small\begin{verbatim}
   INT_LEFT_ASSOC_TAC tm
\end{verbatim}}\vspace*{-3mm}
\noindent rewrites a goal {\small\verb%P(tm)%} into {\small\verb%P(tm')%} where {\small\verb%tm%} is of the form
{\small\verb%(a plus (b plus c))%} and {\small\verb%tm'%} is {\small\verb%(a plus b) plus c)%}.

\FAILURE
The tactic {\small\verb%INT_LEFT_ASSOC_TAC%} fails if it is not given a term of
the form {\small\verb%(a plus (b plus c))%}.

\EXAMPLE
\vspace*{-3mm}{\small\begin{verbatim}
   INT_LEFT_ASSOC_TAC " u plus (v plus (s plus t))"
\end{verbatim}}\vspace*{-3mm}
\noindent applied to the goal
\vspace*{-3mm}{\small\begin{verbatim}
   ([], "(neg (u plus v)) plus (u plus (v plus (s plus t))) = s plus t")
\end{verbatim}}\vspace*{-3mm}
\noindent returns the subgoal
\vspace*{-3mm}{\small\begin{verbatim}
   ([],"(neg(u plus v)) plus ((u plus v) plus (s plus t)) = s plus t")
\end{verbatim}}\vspace*{-3mm}

\USES
Careful rewriting of computational expressions over the integers.

\SEEALSO
\vspace*{-3mm}{\small\begin{verbatim}
GROUP_RIGHT_ASSOC_TAC, GROUP_LEFT_ASSOC_TAC, INT_LEFT_ASSOC_TAC
\end{verbatim}}\vspace*{-3mm}

\ENDDOC
