/*  This is a proof plan for theorem:
    lensort: []==>l:int list=>length(sort(l))=length(l)in pnat
    planner = dplan, clam_version(2.7.0), oyster_version(1.20)

    Time taken to find plan: 1580ms
    Environment:
    []
 */

/* This is the pretty-printed form
ind_strat([(l:int list)-v1::v0]) then 
  generalise(sort(v0),v3:int list) then 
    ind_strat([(v3:int list)-v5::v4]) then 
      base_case(...)

*/

proof_plan([]==>l:int list=>length(sort(l))=length(l)in pnat,lensort,1580,ind_strat(induction(lemma(list_primitive)-[(l:int list)-v1::v0])then[base_case(sym_eval(normalize_term([reduction([1,1,1],[sort1,equ(int list,left)]),reduction([1,1],[length1,equ(pnat,left)]),reduction([2,1],[length1,equ(pnat,left)])]))then[elementary(identity)]),step_case(ripple(direction_out,wave(direction_out,[2,1],[length2,equ(pnat,left)],[])then[wave(direction_out,[1,1,1],[sort2,equ(int list,left)],[])])then[unblock_then_fertilize(weak,unblock_fertilize_lazy([idtac])then fertilize(weak,fertilize_then_ripple(fertilize_left_or_right(right,[weak_fertilize(right,in,[1],v2)]))))])])then[generalise(sort(v0),v3:int list)then[ind_strat(induction(lemma(list_primitive)-[(v3:int list)-v5::v4])then[base_case(sym_eval(normalize_term([reduction([1,1,1],[insert1,equ(int list,left)]),reduction([1,1],[length2,equ(pnat,left)]),reduction([1,1,1],[length1,equ(pnat,left)]),reduction([1,2,1],[length1,equ(pnat,left)])]))then[elementary(identity)]),step_case(ripple(direction_out,wave(direction_out,[1,2,1],[length2,equ(pnat,left)],[])then[casesplit(disjunction([v1<v5=>void,v1<v5]))then[wave(direction_out,[1,1,1],[insert3,equ(int list,left)],[])then[wave(direction_out,[1,1],[length2,equ(pnat,left)],[])],wave(direction_out,[1,1,1],[insert2,complementary,equ(int list,left)],[])]])then[unblock_then_fertilize(weak,unblock_fertilize_lazy([idtac])then fertilize(weak,fertilize_then_ripple(fertilize_left_or_right(left,[weak_fertilize(left,in,[1],v6)]))then elementary(identity))),idtac])])then[base_case(sym_eval(normalize_term([reduction([1,1],[length2,equ(pnat,left)]),reduction([1,1,1],[length2,equ(pnat,left)])]))then[elementary(identity)])]]],dplan).
