/*
 * @(#)$Id: ind_strat,v 1.4.2.3 1999/02/05 18:46:58 rjb Exp $
 *
 * $Log: ind_strat,v $
 * Revision 1.4.2.3  1999/02/05 18:46:58  rjb
 * Annotations removed from `Instances' argument.
 *
 * Revision 1.4.2.2  1999/02/01 10:40:45  rjb
 * `Instances' data added to plan: the lambda terms used to instantiate the
 * induction predicates. For this method the list will always have one element.
 * Base-case induction terms now listed as well as step-case induction terms.
 * The order of the induction terms follows the order of the cases in the
 * induction scheme. For each case there is a list of terms, one for each
 * argument of the induction predicate.
 * Subplans now in the order in which the cases appear in the induction scheme.
 *
 * Revision 1.4.2.1  1998/08/24 12:39:38  rjb
 * The induction suggestion may now be extended with trivial substitutions.
 *
 * Revision 1.4  1997/10/17 17:18:42  rjb
 * Fixed comment.
 *
 * Revision 1.3  1997/10/17 14:25:58  rjb
 * Added source of induction lemma to method arguments.
 *
 * Revision 1.2  1995/10/03 12:54:10  img
 * Induciton preconditions present verbatim to avoid duplication of call
 * to scheme.  Use induction/1 rather than induction/2.
 *
 * Revision 1.1  1994/09/16  09:33:29  dream
 * Initial revision
 *
 */

	% IND_STRAT: Version (I)
	% 
	% Preconditions of ind_strat are same as that of
	% induction-method, so see comments there.
	% 
	% Postconditions vary from version to version:
	% - Version (I) explicitly calls upon the constituent methods (wave,
	%   sym_eval, fertilize) to achieve the same effect.
	% 
method(ind_strat(induction(Lemma-Instances-IndTerms) then SubPlans),
       H==>G,
       [induction_suggestion(H,G,Suggestion),  % ind. preconditions (avoiding recomputation of scheme/8)
	scheme(Lemma,InstancesAnn,IndTerms,SubPlans,Suggestion,H==>G,
               BSeqPs,SSeqPs)],
       [map_list(BSeqPs,BSeq-Plan:=>BSeq1,
                        ((applicable_submethod(BSeq,base_case(Ms),_,BSeq1),
                          Plan = base_case(Ms)) orelse
                         (BSeq1-Plan = BSeq-idtac)),
                 BSeq1s),
        flatten(BSeq1s,FBSeq1s),
        map_list(SSeqPs,SSeq-Plan:=>SSeq1,
                        (applicable_submethod(SSeq,step_case(Ms),_,SSeq1),
                         Plan = step_case(Ms)),
                 SSeq1s),
        flatten(SSeq1s,FSSeq1s),
	append(FBSeq1s,FSSeq1s,AllSeqs),
        map_list(InstancesAnn,IA:=>I,unannotated(IA,I),Instances)
       ],
       AllSeqs,
       ind_strat(induction(Lemma-Instances-IndTerms) then SubPlans)
      ).

