/*  This is a proof plan for theorem:
    memsort2: []==>x:int=>l:int list=>member(x,l)=>member(x,sort(l))
    planner = dplan, clam_version(2.7.0), oyster_version(1.20)

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

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

*/

proof_plan([]==>x:int=>l:int list=>member(x,l)=>member(x,sort(l)),memsort2,6370,ind_strat(induction(lemma(list_primitive)-[(l:int list)-v1::v0])then[base_case(sym_eval(normalize_term([reduction([1],[member1,equ(u(1),left)]),reduction([2,2],[sort1,equ(int list,left)]),reduction([2],[member1,equ(u(1),left)])]))then[elementary(intro(new[x])then[intro(new[v0])then[hyp(v0),wfftacs],wfftacs])]),step_case(ripple(direction_out,wave(direction_out,[2,2],[sort2,equ(int list,left)],[])then[casesplit(disjunction([x=v1 in int=>void,x=v1 in int]))then[wave(direction_out,[2],[meminsert2,equ(u(1),left)],[])then[wave(direction_out,[1],[member3,equ(u(1),left)],[])],wave(direction_out,[1],[member2,complementary,equ(u(1),left)],[])]])then[unblock_then_fertilize(strong,unblock_fertilize_lazy([idtac])then fertilize(strong,v2)),idtac])])then[base_case(sym_eval(equal(v3,right)))then[ind_strat(induction(lemma(list_primitive)-[(v0:int list)-v4::v3])then[base_case(sym_eval(normalize_term([reduction([2,2,2],[sort1,equ(int list,left)]),reduction([2,2],[insert1,equ(int list,left)]),reduction([2],[member2,equ(u(1),left)])]))then[elementary(intro(new[v3])then[hyp(v3),wfftacs])]),step_case(ripple(direction_out,wave(direction_out,[2,2,2],[sort2,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,=>,[],v5)]))))])])then[generalise(sort(v3),v6:int list)then[ind_strat(induction(lemma(list_primitive)-[(v6:int list)-v8::v7])then[base_case(sym_eval(normalize_term([reduction([2,1],[insert1,equ(int list,left)]),reduction([1],[member2,equ(u(1),left)]),reduction([2,2,2],[insert1,equ(int list,left)])])then[casesplit(disjunction([v1<v4=>void,v1<v4]))then[normalize_term([reduction([2,2],[insert3,equ(int list,left)]),reduction([2,2,2],[insert1,equ(int list,left)])])then[casesplit(disjunction([v1=v4 in int=>void,v1=v4 in int]))then[normalize_term([reduction([2],[member3,equ(u(1),left)]),reduction([2],[member2,equ(u(1),left)])]),equal(v8,left)then[normalize_term([reduction([2],[member2,equ(u(1),left)])])]]],normalize_term([reduction([2,2],[insert2,equ(int list,left)]),reduction([2],[member2,equ(u(1),left)])])]])then[elementary(intro(new[v9])then[hyp(v9),wfftacs]),elementary(intro(new[v8])then[hyp(v8),wfftacs]),elementary(intro(new[v8])then[hyp(v8),wfftacs])]),step_case(ripple(direction_out,casesplit(disjunction([v4<v8=>void,v4<v8]))then[wave(direction_out,[2,2,2],[insert3,equ(int list,left)],[])then[casesplit(disjunction([v1<v8=>void,v1<v8]))then[wave(direction_out,[2,2],[insert3,equ(int list,left)],[])then[wave(direction_out,[2,1],[insert3,equ(int list,left)],[])then[casesplit(disjunction([v1=v8 in int=>void,v1=v8 in int]))then[wave(direction_out,[2],[member3,equ(u(1),left)],[])then[wave(direction_out,[1],[member3,equ(u(1),left)],[])],wave(direction_out,[2],[member2,complementary,equ(u(1),left)],[])]]],wave(direction_out,[2,2],[insert2,complementary,equ(int list,left)],[])]],wave(direction_out,[2,2,2],[insert2,complementary,equ(int list,left)],[])then[casesplit(disjunction([v1<v4=>void,v1<v4]))then[casesplit(disjunction([v1<v8=>void,v1<v8]))then[idtac,idtac],casesplit(disjunction([v1<v8=>void,v1<v8]))then[idtac,idtac]]]])then[unblock_then_fertilize(strong,unblock_fertilize_lazy([idtac])then fertilize(strong,v9)),idtac,idtac,idtac,idtac,idtac,idtac])])then[base_case(elementary(intro(new[v13])then[istrue,wfftacs])),base_case(sym_eval(normalize_term([reduction([2,1],[insert2,equ(int list,left)]),reduction([1],[member2,equ(u(1),left)]),reduction([2],[member2,equ(u(1),left)])]))then[elementary(intro(new[v12])then[hyp(v12),wfftacs])]),base_case(sym_eval(normalize_term([reduction([2,1],[insert3,equ(int list,left)]),reduction([2,2],[insert3,equ(int list,left)]),reduction([2,2,2],[insert3,equ(int list,left)])])then[casesplit(disjunction([v1=v4 in int=>void,v1=v4 in int]))then[normalize_term([reduction([2],[member3,equ(u(1),left)])])then[casesplit(disjunction([v1=v8 in int=>void,v1=v8 in int]))then[normalize_term([reduction([1],[member3,equ(u(1),left)]),reduction([2],[member3,equ(u(1),left)])]),equal(v14,left)then[normalize_term([reduction([1],[member2,equ(u(1),left)]),reduction([2],[member2,equ(u(1),left)])])]]],equal(v13,left)then[normalize_term([reduction([2],[member2,equ(u(1),left)])])then[casesplit(disjunction([v1=v8 in int=>void,v1=v8 in int]))then[normalize_term([reduction([1],[member3,equ(u(1),left)])]),equal(v13,left)then[normalize_term([reduction([1],[member2,equ(u(1),left)])])]]]]]])then[elementary(intro(new[v15])then[hyp(v15),wfftacs]),elementary(intro(new[v14])then[hyp(v14),wfftacs]),elementary(intro(new[v14])then[istrue,wfftacs]),elementary(intro(new[v13])then[hyp(v13),wfftacs])]),base_case(sym_eval(normalize_term([reduction([2,1],[insert2,equ(int list,left)]),reduction([1],[member2,equ(u(1),left)]),reduction([2,2],[insert3,equ(int list,left)]),reduction([2,2,2],[insert2,equ(int list,left)])])then[casesplit(disjunction([v1=v4 in int=>void,v1=v4 in int]))then[normalize_term([reduction([2],[member3,equ(u(1),left)]),reduction([2],[member2,equ(u(1),left)])]),equal(v13,left)then[normalize_term([reduction([2],[member2,equ(u(1),left)])])]]])then[elementary(intro(new[v14])then[hyp(v14),wfftacs]),elementary(intro(new[v13])then[hyp(v13),wfftacs])]),base_case(sym_eval(normalize_term([reduction([2,1],[insert3,equ(int list,left)]),reduction([2,2],[insert2,equ(int list,left)]),reduction([2],[member2,equ(u(1),left)])])then[casesplit(disjunction([v1=v8 in int=>void,v1=v8 in int]))then[normalize_term([reduction([1],[member3,equ(u(1),left)])]),equal(v13,left)then[normalize_term([reduction([1],[member2,equ(u(1),left)])])]]])then[elementary(intro(new[v14])then[istrue,wfftacs]),elementary(intro(new[v13])then[hyp(v13),wfftacs])]),base_case(sym_eval(normalize_term([reduction([2,1],[insert2,equ(int list,left)]),reduction([1],[member2,equ(u(1),left)]),reduction([2,2],[insert2,equ(int list,left)]),reduction([2],[member2,equ(u(1),left)])]))then[elementary(intro(new[v13])then[hyp(v13),wfftacs])])]]]]],dplan).
