use(subst).
%use(int_lemmas).
use(lemmaF3).
use(lemmaF2).
lemmaF2(S,K,I).
/* these should be built into the variable elimination rules
(s(X)= lemmaF3(var(j),s,k,l)),
% step case for abstractions
((all(K,all(I,all(S,lemmaF3(t,S,K,I))))) => lemmaF3(abs(t),s,k,i)),
% step case for applications
all(K,all(I,(lemmaF3(t,s,K,I) and lemmaF3(u,s,K,I)))) => lemmaF3(app(t,u),s,k,i) -> [].
option([var_overlaps(off),search_depth(-1),full_cnf(yes)]).
%:-sama([]),sarp(+[15]),saci([2]). % 20031216 mpino2202 122.8 s
:-sarp(+[15]),saci([2]). % 20031216 mpino2202 70.3 s
%:-sarp(+[15]). % 20031216 mpino2202 76.7 s
top_predicates_precedence([lemmaF3,lemmaF2]).
/*
Proof:
======
7 : s(A)=s(B) -> A=B [input]
9 : p(s(A))=A [input]
10 : s(p(A))=A [input]
11 : A s(A)= A=
subst(var(B),A,C)=var(p(B)) [input]
15 : subst(var(A),A,B)=B [input]
16 : A subst(var(A),B,C)=var(A) [input]
17 : subst(app(A,B),C,D)=app(subst(A,C,D),subst(B,C,D)) [input]
18 : subst(abs(A),B,C)=abs(subst(A,s(B),lift(C,0))) [input]
23 : free(var(A),B)==(A=B) [input]
24 : free(app(A,B),C)==(free(A,C)or free(B,C)) [input]
25 : free(abs(A),B)==free(A,s(B)) [input]
27 : A= s(A)=free(subst(A,C,B),D)<=>free(A,C)and free(B,D)or(D free(t,s(k))and(free(s,i)and 0 s(k)= free(t,s(s(i))) [expansion from 597]
601 + p$453,p$492,p$454,s(i) free(t,s(k)) [expansion from 598]
603 + p$453 -> free(s,i)and 0 free(s,i)and 0 s(i) free(t,s(i)) [expansion from 601]
608 + p$492,p$454,p$453,s(i) p$492,p$454,p$488 [negative chaining of 622 from 99]
625 + free(s,i) -> p$492,p$454 [reduction of 624 by [96,L]]
627 + p$492,p$454,free(s,s(i))and s(i)<0,free(s,i)and 0 s(i)<0 [expansion from 629]
633 + p$451 -> [reduction of 632 by [11,582,L]]
634 + p$454,p$492 [reduction of 630 by [633,L]]
635 + p$492,s(k)= s(k)=s(i),k p$492,k [reduction of 580 by [657]]
659 + free(t,s(k))and(free(s,i)and 0 [reduction of 94 by [578,11,583,L,11,582,L,45,11,582,L,9,658,L]]
661 + free(t,s(i)),p$475,p$483 [reduction of 194 by [658,L]]
662 + i [expansion from 659]
665 + free(t,s(k)),free(s,i)and 0 [expansion from 663]
666 + s(i) [expansion from 664]
667 + s(k)= [expansion from 664]
668 + s(i) [expansion from 666]
669 + free(t,s(i)) -> s(k)= [expansion from 667]
671 + free(t,s(s(i))) -> s(i) p$483,p$482 [negative chaining of 682 from 665]
693 + 0 p$482,p$483 [reduction of 692 by [681,L]]
695 + 0 p$450 [expansion from 693]
697 + s(i)=<0,p$450 [totality resolution from 695]
698 + p$450,s(i)=0 [reduction of 697 by [11,582]]
701 + i<0,p$450 [chaining of 11 from 698]
720 + p$450 [reduction of 701 by [582,L]]
749 + p$475,p$483,p$483,p$475 [chaining of 662 from 680]
755 + p$483,p$475 [condensement of 749]
758 + p$483,free(s,i) [negative chaining of 755 from 151]
759 + p$483,free(t,s(k)) [negative chaining of 755 from 150]
760 + free(s,i)and 0 p$483 [negative chaining of 759 from 665]
762 + 0 p$483 [reduction of 760 by [758,L]]
764 + p$450 -> p$483 [expansion from 762]
765 + p$483 [reduction of 764 by [720]]
766 + k=