Sindbad~EG File Manager

Current Path : /usr/home/beeson/public_html/michaelbeeson/research/papers/
Upload File :
Current File : /usr/home/beeson/public_html/michaelbeeson/research/papers/induction.dvi

����;� TeX output 2006.08.24:2200������y�����?�����Y=/�src:22induction.tex�D��tG�G�cmr17�Mathematical�7tInduction�in�Otter�Lam��qb�s�da��������»��X�Qcmr12�Mic��rhael��Beeson�����2��K�cmsy8���������fj�����August��24,�2006��.���!K�src:37induction.tex�t�:		cmbx9�Abstract���э�d��src:38induction.tex�o���		cmr9�Otter-lam��9b�A�da���is�Otter�mo�died�b��9y�adding�co�de�to�implemen��9t�an�algo-����Writhm���for�lam��9b�A�da�unication.��ROtter�is�a�resolution-based,��>clause-language����Wrst-order��pro��9v�er�that�accum�ulates�deduced�clauses�and�uses�strategies����Wto���con��9trol�the�deduction�and�reten�tion�of�clauses.��ZThis�is�the�rst�time����Wthat�q�suc��9h�a�rst-order�pro�v�er�has�b�A�een�com�bined�in�one�program�with�a����Wunication��Xalgorithm�capable�of�instan��9tiating�v��|rariables�to�lam�b�A�da�terms����Wto���assist�in�the�deductions.��The�resulting�pro��9v�er���has�all�the�adv��|ran��9tages����Wof��zthe�pro�A�of-searc��9h�algorithm�of�Otter�(sp�eed,��Cv��|rariet��9y�of�inference�rules,����Wexcellen��9t�;,handling�of�equalit�y)�and�also�the�p�A�o�w�er�of�lam�b�A�da�unication.����WW��:�e��illustrate�ho��9w�these�capabilities�w�ork�w�ell�together�b�y�using�Otter-����Wlam��9b�A�da��to�nd�pro�ofs�b��9y�mathematical�induction.�$kLam�b�A�da�unication����Winstan��9tiates���the�induction�sc�hema�to�nd�a�useful�instance�of�induction,����Wand�orthen�Otter's�rst-order�reasoning�can�b�A�e�used�to�carry�out�the�base����Wcase��and�induction�step.���If�necessary��:�,�*}induction�can�b�A�e�used�for�those,����Wto�A�o.�X�W��:�e�)�presen��9t�and�discuss�a�v��|rariet�y�of�examples�of�inductiv�e�pro�A�ofs����Wfound��b��9y�Otter-lam�b�A�da:�'�some�in�pure�P�eano�arithmetic;���some�in�P�eano����Warithmetic��with�dened�predicates;���some�in�theories�com��9bining�algebra����Wand��the�natural�n��9um�b�A�ers;���some��in�v�olving�algebraic�simplication�(used����Win�<�the�induction�step)�b��9y�simplication�co�A�de�from�MathXp�ert;�Pand�some����Win��9v�olving��list�induction�instead�of�n��9umerical�induction.�љThese�examples����Wdemonstrate��othe�feasibilit��9y�and�usefulness�of�adding�lam�b�A�da�unication�to����Wa�Trst-order�pro��9v�er.��!č�>���N�ffcmbx12�In���tro�s3duction�����>�src:55induction.tex�K�`y

cmr10�Our���purp�Gose�in�this�pap�er�is�to�demonstrate�the�capabilities�of�the�theorem����>pro���v�er��BOtter-lam�b�Gda,��or�Otter-�
�b>

cmmi10��,�[�7��]�in�nding�pro�Gofs�b���y�mathematical�induc-����>tion.�7�Otter-���O�com���bines�a�new�algorithm,���lam�b�Gda�unication,���with�the�w�ell-����>kno���wn��Jresolution-based�theorem�pro�v�er�Otter�[�12��
].���Results�obtained�with�this����>com���bination��go�b�Gey�ond�what�can�b�Ge�done�with�standard�Otter,���b�ecause�lam���b�da����>unication�^+can�b�Ge�used�to�instan���tiate�a�sc�hema�of�mathematical�induction,�``au-����>tomatically�UUnding�the�instance�needed�for�a�particular�pro�Gof.��>�X-�ff��v�	@����
����-:�q�%cmsy6����L��|{Ycmr8�Researc�Îh��Xsupp�<rorted�b�y�NSF�gran�t�n�um�b�<rer�CCR-0204362.�������1����*�y�����?������M�src:62induction.tex�Second-order���(or�higher-order)�unication�has�t���ypically�b�Geen�used�in�t�yp�Ged����>systems;�ϣsee���[�7��]�for�a�detailed�comparison�of�Otter-���with�other�theorem�pro���v�ers.����>These�+Tsystems�ha���v�e,�`�ho�w�ev�er,�not�+Tb�Geen�esp�ecially�go�o�d�at�automating�pro�ofs����>b���y���induction.��<An�excellen�t�surv�ey�of�the�state�of�the�art�in�inductiv�e�theorem����>pro���ving�'�(in�2001)�is�Bundy's���':

cmti10�Handb��}'o�ok�'��article�[�9��].����^��ٓ�Rcmr7�1�����The�b�Gest�inductiv�e�theorem����>pro���v�ers�>�are�A���CL2�[�8��]�(the�presen�t-da�y�incarnation�of�the�Bo�y�er-Mo�Gore�theorem����>pro���v�er),�ryRRL�l�[�11��
],�and�l�Bundy's�Oyster-Clam�system�in�Edin���burgh�[�10��].���These����>pro���v�ers��Mha�v�e�used�sp�Gecial�tec�hniques�to�iden�tify�the�correct�induction�sc�hema�to����>use,�
�to���iden���tify�the�correct�induction�v��q�ariable,�and�to�nd�a�go�Go�d���generalization����>of��7the�theorem�to�b�Ge�pro���v�ed,���should��7the�original�attempt�not�succeed.�mOne����>should�UUalso�men���tion�the�early�w�ork�of�Aubin�[�2��],�[�3��].����M�src:73induction.texOtter-��4��uses�lam���b�Gda�unication�to�nd�the�correct�instance�of�induction;�?�in����>the��{pro�Gcess�it�selects�the�induction�v��q�ariable.�SThis�is�a�non-deterministic�pro�cess����>and��Otter-���do�Ges�ha���v�e��the�abilit���y�to�bac�ktrac�k,���trying�dieren�t�c�hoices�of�the����>induction��fv��q�ariable,��b���y�returning�more�than�one�lam�b�Gda�unier.�W�The�user�can����>sp�Gecify��(b���y�parameters�set�in�the�input�le)�the�maxim�um�n�um�b�Ger�of�uniers����>to�8Treturn�for�a�single�lam���b�Gda-unication.��Some�heuristics�are�used�to�return����>the�eq\most�in���teresting"�uniers�rst.��All�but�one�of�the�examples�in�this�pap�Ger,����>ho���w�ev�er,�?�can�ݤb�Ge�solv���ed�b�y�returning�only�one�unier.�	
�W��*�e�demonstrate�the����>success���of�this�approac���h�b�y�sho�wing�the�Otter-���can�w�ork�a�wide�v��q�ariet�y�of����>examples�UUof�pro�Gof�b���y�induction.�q�These�fall�in�to�sev�eral�classes:��$D�����M�
!",�

cmsy10�����W�src:81induction.tex�Pur��}'e��(Pe�ano�arithmetic�.���Using��mathematical�induction�and�the�deni-����Wtions�Ȏof�successor,�%[addition,�and�Ȏm���ultiplication,�Otter-���can�pro���v�e�the����Wbasic���prop�Gerties�of�addition�and�m���ultiplication.�;nSome�of�these�prop�er-����Wties�.�require�a�double�induction|the�induction�step�and�base�case�need�to����Wpro���v�ed��Iin�turn�b���y�induction.�QnOtter-���nds�all�these�instances�of�induction����Wautomatically��*�.��A������M�����W�src:83induction.tex�Inductive��pr��}'o�ofs�in�algebr�a�and�analysis�.��UIn���these�pro�Gofs,��some�v��q�ariables����Wrange�f�o���v�er�natural�n�um�b�Gers�and�some�o�v�er�a�ring,�kcor�a�group,�or�the�real����Wn���um�b�Gers.�������M�����W�src:86induction.tex�Inductive��pr��}'o�ofs�involving�algebr�aic�simplic�ation�.��yUsing��;a�link�to�the����Wcomputer�Y�algebra�system�of�MathXp�Gert,�Z�Otter-���is�able�to�nd�pro�ofs�b���y����Winduction�=$in�whic���h�the�induction�step�and/or�base�case�requires�consider-����Wable�UUalgebraic�simplication.�������M�����W�src:89induction.tex�List��winduction�.�{�Otter-��X��can�w���ork�induction�problems�in�other�domains����Wthan�UUthe�natural�n���um�b�Gers.��$D��M�src:92induction.texW��*�e�H�do�not�regard�Otter-���as�a�\com���bination�of�rst-order�logic�and�higher-����>order��klogic".��	Lam���b�Gda�logic�is�not�higher-order,��0it�is�un�t�yp�Ged.��	Lam�b�da��kunica-����>tion�v�is�not�higher-order�unication,�0it�is�unication�in�(un���t�yp�Ged)�v�lam�b�da�v�logic.��>�(�ff��v�	J=�����"5��-:��Aa�cmr6�1����LܻThe�.surv�Îey�in�[�9��@]�is�no�w�v�e�y�ears�old,�]�and�of�course�researc�h�in�inductiv�e�theorem-��	��pro�Îving��Shas�con�tin�ued;��but�the�dev�elopmen�ts�are�not�directly�relev��an�t�to�this�pap�<rer,�ǻsince�w�e���are���taking�a�dieren�Ît�approac�h�to�the�sub�x�ject,���and�the�basic�approac�hes�describ�<red�in�[�9��@]�ha�v�e���not��Xc�Îhanged.�������2����
�y�����?������>�While�there�probably�are�in���teresting�connections�to�t�yp�Ged�logics,�0�some�of�the����>questions���ab�Gout�those�relationships�are�op�en�at�presen���t,�"�and�out�of�the�scop�e����>of�!cthis�pap�Ger.�`vSimilarly��*�,�+�while�there�are�pro��8jects�aimed�at�com���bining�rst-order����>pro���v�ers��Uand�higher-order�pro���v�ers,��that��Uapproac�h�is�quite�dieren�t�from�ours.����>Otter-��n�is�a�single,�uQin���tegrated�pro�v�er,�uQnot�a�com�bination�of�a�rst-order�pro�v�er����>and�;�a�higher-order�pro���v�er.�%�There�;�is�just�one�database�of�deduced�clauses�on����>whic���h�UUinferences�are�p�Gerformed;�there�is�no�need�to�pass�data�b�et���w�een�UUpro�v�ers.����M�src:98induction.texIn��this�pap�Ger,�"sw���e�presen�t�a�high-lev�el,�"sbut�precise�and�thorough,�description����>of�{�the�lam���b�Gda�unication�algorithm,�łand�a�n�um�b�Ger�of�examples�of�inductiv�e����>pro�Gofs���found�using�Otter-��,��illustrating�the�v��q�ariet���y�of�induction�problems�that����>can��ob�Ge�solv���ed�with�Otter-��,���and�discussing�some�of�the�diculties�in�v�olv�ed.����>Pro�Gofs�/�output�b���y�the�pro�v�er�ha�v�e�b�Geen�included,�7osince�the�discussion�requires�a����>detailed���examination�of�those�pro�Gofs.�JZThe�complete�input�and�output�les�are����>not��
included,���but�these�les,�and�the�pro���v�er��
itself,�are�a���v��q�ailable�at�the�Otter-�����>�w���ebsite�UU[�7��].��!č�>�Lam���b�s3da�fflogic�and�lam�b�s3da�unication�����>�src:105induction.tex�Lam���b�Gda�k3logic�is�the�logical�system�one�obtains�b�y�adding�lam�b�Gda�calculus�to�rst����>order�GSlogic.�mThis�system�w���as�form�ulated,�J and�some�fundamen�tal�metatheorems����>w���ere�yOpro�v�ed,��Nin�an�earlier�publication�[�4��].�ݶThe�appropriate�generalization�of����>unication�d�to�lam���b�Gda�logic�is�this�notion:��~t�w�o�terms�are�said�to�b�Ge��lamb��}'da���unie�d����>�b���y�v�substitution����e�if��t�ZL�=��s�s��is�pro���v��q�able�in�lam�b�Gda�logic.��k�L��}'amb�da��vunic�ation�v��is����>an�t�algorithm�for�pro�Gducing�lam���b�da�unifying�substitutions.�ЉIn�Otter-��,�|�lam���b�da����>unication�wTis�used,��instead�of�only�rst-order�unication,�in�the�inference�rules����>of�UUresolution,�factoring,�paramo�Gdulation,�and�demo�dulation.����M�src:113induction.texIn�`wOtter-���input�les,�c@w���e�write��l�2`ambda�(�x;���t�)�for��x:�t�,�c@and�w���e�write��Ap�(�t;�s�)����>for�"��t��applied�to��s�,�,�whic���h�is�often�abbreviated�in�tec�hnical�pap�Gers�to��t�(�s�)�or�ev�en����>�ts�.��In��othis�pap�Ger,���Ap��and��l�2`ambda��will�alw���a�ys��ob�e�written�explicitly��*�,��so�that�w���e����>do�P>not�ha���v�e�P>to�switc���h�notation�b�Get�w�een�the�pap�Ger�and�the�input�les�or�the����>computer-pro�Gduced�UUpro�ofs.����M�src:118induction.texAlthough���the�lam���b�Gda�unication�algorithm�has�b�een�describ�ed�in�[�4��],��Fw���e�will����>describ�Ge���it�again�here,��jsince�the�reader�m���ust�understand�lam�b�Gda-unication�to����>follo���w�O�the�examples�in�this�pap�Ger.�o�As�w�e�dene�it�here,�P�lam�b�Gda�unication�is�a����>non-deterministic��+algorithm:�	rit�can�return,�� in�general,�man���y�dieren�t�unifying����>substitutions�for�t���w�o�giv�en�input�terms.��The�input�to�the�lam�b�Gda-unication����>algorithm,��lik���e�Pthe�input�to�ordinary�unication,�is�t���w�o�Pterms��t��and��s��(this�time����>terms�.of�lam���b�Gda�logic).�]eThe�output,�$iif�the�algorithm�succeeds,�is�a�substitution����>���.�suc���h�UUthat��t�"�=���s��is�pro���v��q�able�in�lam�b�Gda�logic.����M�src:125induction.texW��*�e��rst�giv���e�the�relativ�ely�simple�clauses�in�the�denition.�(�These�ha�v�e�to����>do���with�rst-order�unication,��oalpha-con���v�ersion,�and���b�Geta-reduction.�Q9The�rule����>related�bgto�rst-order�unication�just�sa���ys�that�w�e�try�that�rst;���for�example����>�Ap�(�x;���y�[ٲ)���unies�with��Ap�(�a;�b�)�directly�in�a�rst-order�w���a�y��*�.�~LHo�w�ev�er,��7the���usual����>recursiv���e��calls�in�rst-order�unication�no�w�b�Gecome�recursiv�e�calls�to�lam�b�Gda����>unication.�[8In��other�w���ords:�O�to�unify��f���(�t����1��|s�;����:�:�:����;���t����	0e�rcmmi7�n��q~�)�with��g�[ٲ(�s����1���;����:�:�:����;���s����m�����)�(according������3����$�y�����?������>�to�C$this�rule)�w���e�m�ust�ha�v�e��f�ڧ�=���g����and��n��=��m�;�I4in�that�case�w���e�do�the�follo�wing:��߄��M�src:134induction.tex��"�=���<x

cmtt10�identity�?�substitution�;����M�src:138induction.tex�for�?��i���=�1��to��n��f����M�src:140induction.tex����a��=�?�unify�(�t����i��TL�;���s����i���)�;����M�src:142induction.tex���if�?�(���߲=��failure)����M�src:144induction.tex�)��return�?�failure;����M�src:146induction.tex����"�=��������8��!��;�?��g����M�src:148induction.tex�return�?���[��;����>�src:153induction.tex�Here�L�the�call�to��unify��is�a�recursiv���e�call�to�the�algorithm�b�Geing�dened.��Since�the����>algorithm��is�non-deterministic,�there�are�c���hoices�to�b�Ge�made�for�eac�h�argumen�t.����>F��*�or�/�example,�7if�there�are�t���w�o�/�substitutions������i���Ͳthat�unify��a��and��c�,�and�t���w�o�/�w�a�ys����>to�UUunify��b����i�����and��d����i��TL�,�then�there�will�b�Ge�four�w���a�ys�UUto�unify��f���(�a;���b�)�with��f��(�c;���d�).����M�src:158induction.texT��*�o�#dunify�a�v��q�ariable��x��with�a�term��t�,�V�return�the�substitution��x���:=��t�#d�if��t��is����>iden���tical�UUto��x��or��x��is�not�b�Gound�and��x��do�es�not�o�ccur�in��t�.����M�src:161induction.texThe�8�rule�related�to�alpha-con���v�ersion�8�sa�ys�that,�q�if�w�e�w�an�t�to�unify��l�2`ambda�(�z�p�;���t�)����>with�&��l�2`ambda�(�x;���s�),�[hrst�rename�b�Gound�v��q�ariables�if�necessary�to�ensure�that��x����>�do�Ges��not�o�ccur�in��t��and��z�.��do�es�not�o�ccur�in��s�.��Then�let����ڲb�e�the�substitution����>�z�;0�:=�ʙ�x��	�and�unify��t�вwith��s�,��rejecting�an���y�substitution�that�assigns�a�v��q�alue�to����>�x��s�or�a�v��q�alue�dep�Gending�on��x�.����^��2���	���If�this�unication�succeeds�with�substitution���[ٲ,����>return�UU��[ٲ.����M�src:171induction.texThe�d�rule�related�to�b�Geta-reduction�sa���ys�that,���to�unify��Ap�(�l�2`ambda�(�z�p�;���s�)�;�q�[ٲ)����>with����t�,�֒w���e�rst�b�Geta-reduce�and�then�unify��*�.���That�is,�w���e�unify��s�[�z��:=�sh�q�[ٲ]�with��t����>�and�UUreturn�the�result.����M�src:174induction.texLam���b�Gda���unication's�most�in�teresting�instructions�tell�ho�w�to�unify��Ap�(�x;���w�D�)����>with��a�term��t�,�where��t��ma���y�con�tain�the�v��q�ariable��x�,�and��t��do�Ges�not�ha�v�e�main����>sym���b�Gol�'o�Ap�.�b{Note�that�the�o�ccurs�c���hec�k�'oof�rst-order�unication�do�es�not�apply����>in�&�this�case.��The�term��w�D�,�[[ho���w�ev�er,�is�&�not�allo���w�ed�&�to�con���tain��x�.��In�this�case����>lam���b�Gda�UUunication�is�giv�en�b�y�the�follo�wing�non-deterministic�algorithm:����>�src:182induction.tex1.��Pic���k�8Ta��masking�d�subterm��q��-�of��t�.�That�means�a�subterm��q��-�suc���h�that�ev�ery����>o�Gccurrence��of��x��in��t��is�con���tained�in�some�o�ccurrence�of��q�=l�in��t�.��(So��q��\masks"����>the���o�Gccurrences�of��x�;�N�if�there�are�no�o�ccurrences�of��x��in��t�,�%then��q�Wb�can�b�e�an���y����>subterm�UUof��t�,�but�see�the�next�step.)����>�src:188induction.tex2.�&�Call�s�lam���b�Gda�unication�to�unify��w����with��q�[ٲ.�Let���ϫ�b�Ge�the�resulting�substitution.����>If��"this�unication�fails,��Uor�assigns�an���y�v��q�alue�other�than�a�v�ariable�to��x�,��Ureturn����>failure.�b�If�'�it�assigns�a�v��q�ariable�to��x�,�0�sa���y��x���:=��y����rev�erse�'�the�assignmen�t�to��y�"�:=���x����>�so�UUthat��x��remains�unassigned.����>�src:194induction.tex3.��If�|R�q�[���+�o�Gccurs�more�than�once�in��t��,��then�pic���k�a�set��S�߲of�its�o�Gccurrences.��If��q����>�con���tains� !�x��then��S����m�ust�b�Ge�the�set�of��al���l��o�ccurrences�of��q�[��{��in��t�.�`Let��z����b�e�a�fresh����>v��q�ariable�!and�let��r�h2�b�Ge�the�result�of�substituting��z����in��t�|�for�eac���h�o�ccurrence�of��q�[�����>�in�UUthe�set��S����.����>�src:200induction.tex4.�q�App�Gend�UUthe�substitution��x���:=��z�p�:���r��r�to�UU���.�and�return�the�result.��>�7��ff��v�	J=�����"5��-:�2����LܻCare��is�called�for�in�this�clause,�4�as�illustrated�b�Îy�the�follo�wing�example:�b�Unify���2cmmi8�l�Kambda�(�x;�j�y�I{�)��	��with���l�Kambda�(�x;�j�f��ǻ(�x�)).�fThe�\solution"��y�~ݻ=�5b�f��(�x�)�is�wrong,�8since�substituting��y�~ݻ=�5b�f��(�x�)�in����l�Kambda�(�x;�j�y�I{�)��Xgiv�Îes��l�ambda�(�z�V�;�j�f��ǻ(�x�)),�b�<recause�the�b�ound�v��ariable�is�renamed�to�a�Îv�oid��Xcapture.�������4����/�y�����?������M�src:203induction.tex�There�M�are�t���w�o�M�sources�of�non-determinism�in�the�ab�Go���v�e,���namely�M�in�steps�1�and����>3.�S>Otter-�����has�a�parameter��max���E�ff&f��ǫunifiers�,�that�can�b�Ge�set�in�the�input�le�b���y�a����>command�slik���e��assign(max���E�ff&f��ǫunifiers,9)�.��&In�that�case,�z�lam�b�Gda�unication�will����>bac���ktrac�k��o�v�er�dieren�t�selections�of�a�masking�subterm�and�set��S����,�
xup�to�the����>maxim���um�?�n�um�b�Ger�of�uniers�sp�ecied�(p�er�lam���b�da�unication).�1�The�default����>v��q�alue�4�of�this�parameter�is�one,�lain�whic���h�case�there�is�no�bac�ktrac�king,�lai.e.�~a����>deterministic��selection�is�made.��VEv���en�if�bac�ktrac�king�is�allo�w�ed,�M{Otter-���still����>attempts�zto�pic���k�\go�Go�d"�zmasking�subterms�according�to�some�heuristics.��Here����>are��Wsome�of�the�heuristics�used:�;Hin�step�1,��#if��x��o�Gccurs�in��t�,�w���e�prefer�the�smallest����>masking�=Ssubterm��q��,�that�o�Gccurs�as�a�second�argumen���t�of��Ap�.����^��3����4�If��x��o�ccurs�in����>�t�,��but��(no�masking�subterm�o�Gccurs�as�a�second�argumen���t�of��Ap�,�w���e�prefer�the����>smallest�D;masking�subterm����^��4������If��x��do�Ges�not�o�ccur�in��t�,��w���e�pic�k�a�constan�t�that����>o�Gccurs�l�in��t�,�r�or�more�generally�a�constan���t�subterm�of��t�;�xuif�there�is�none,�w���e�fail.����>Whic���h��constan�t�subterm�w�e�pic�k�is�determined�b�y�some�heuristics�that�seem�to����>w���ork���w�ell�in�the�examples�w�e�ha�v�e�tried.�O�In�step�3,�%if��q�K��do�Ges�not�con�tain��x�,�%then����>an�6Iimp�Gortan���t�application�of�this�c�hoice�is�to�pro�Gofs�b�y�mathematical�induction,����>where�u�the�c���hoice�of��q�Ѯ�corresp�Gonds�to�c�ho�Gosing�a�constan�t��n�,���replacing�some�of�the����>o�Gccurrences�=bof��n��b���y�a�v��q�ariable,�B,and�deciding�to�pro�v�e�the�theorem�b�y�induction����>on�a$that�v��q�ariable.� bTherefore�the�c���hoice�of��S��is�determined�b�y�heuristics�that�pro�v�e����>useful�'#in�this�case.�baIn�particular,�0awhen�pro���ving�equations�b�y�induction,�0aw�e�pic�k����>a�nconstan���t�that�o�Gccurs�on�b�oth�sides�of�the�equation,�t-but�not�necessarily�when����>pro���ving���non-equations.�YIf�there�is�a�constan�t�term�of�w�eigh�t�1�that�o�Gccurs�on����>b�Goth�K�sides�of�the�equation,�M�that�term�is�used�instead�of�a�constan���t|this�allo�ws����>Otter-���1�to�\generalize"�a�goal,��hand�since�w���eigh�t��1templates�can�b�Ge�sp�ecied�in����>the��input�le,��Tit�also�giv���es�the�user�some�con�trol�o�v�er�what�terms�can�b�Ge�selected����>as��cmasking�subterms.���Our�presen���t�heuristics�call�for�nev�er�c�ho�Gosing�a�term�of����>w���eigh�t�a�greater�than�1;�g�but�w���eigh�ts�a�can�b�Ge�set�b���y�the�user�in�the�input�le,�d�if�it����>should�UUb�Ge�necessary��*�.����M�src:232induction.texFinally��*�,��glam���b�Gda�Edunication�needs�some�rules�for�unifying��Ap�(�r���;���w�D�)�with��t�,����>when��L�r��i�is�not�a�v��q�ariable.��The�rule�is�this:�߶create�a�fresh�v�ariable��X���,��
unify����>�Ap�(�X�:�;���w�D�)�g�with��t��generating�substitution���[ٲ,���then�unify��X�����Ӳwith��r�G��,���generat-����>ing��]substitution���!Dz;�7�if�this�succeeds�return���[���,�or�rather,�the�substitution�that����>agrees�oAwith���[����but�is�not�dened�on��X���,�u�since��X�8#�do�Ges�not�o�ccur�in�the�original����>unication�UUproblem.����M�src:238induction.tex�Example��[�.��SUnify��.�Ap�(�Ap�(�x;���y�[ٲ)�;�z�p��)�with�3.��SCho�Gose�fresh��X���,��$unify��Ap�(�X�:�;�z�p��)����>with��3,�Cbgetting��z�u�:=�}3�and��X��_�:=��l�2`ambda�(�u;���u�).��No���w�unify��l�ambda�(�u;���u�)�with����>�Ap�(�x;���y�[ٲ),���getting�|2�y�c��:=�ݵl�2`ambda�(�u;�u�)�and��x�ݲ:=��l�2`ambda�(�v�[�;���v��).��]So�the�nal�answ���er����>is�׵x���:=��l�2`ambda�(�v�[�;���v��),�#W�y�"�:=���l�ambda�(�u;���u�),��z�7��:=��3.�\�W��*�e��can�c���hec�k��that�this�really�is����>a�UUcorrect�lam���b�Gda�unier�as�follo�ws:������ic��Ap�(�Ap�(�x;���y�[ٲ)�;�z�p��)�������=�����ƽ��Ap�(�Ap�(�l�2`ambda�(�u;���u�)�;�l�ambda�(�v�[�;�v��))�;��3)����>��f�ff��v�	J=�����"5��-:�3����LܻThe���p�<roin�Ît�of�this�c�hoice�is�that,��kif�w�e�w�an�t�the�pro�<rof�to�b�e�implicitly�t�Îypable,��kthen��q��	���should��Xb�<re�c�Îhosen�to�ha�v�e�the�same�t�yp�<re�as��w�7�,�and��w�t�is�a�second�argumen�t�of��Ap�.��	�>�����"5��-:�4����LܻThis���will�not�b�<re�done�if�the�input�le�con�Îtains���C�scmtt8�set(types)�,�ٖb�ecause�it�migh�Ît�result�in���mis-t�Îypings;��(unless,���of��course,�the�input�le�also�pro�Îvides�a��list(types)��that�can�b�<re�used�to���c�Îhec�k��Xthe�t�Îyp�<re�of�the�masking�subterm.�������5����BF�y�����?�����������=�����ƽ��Ap�(�l�2`ambda�(�v�[�;���v��)�;��3)����������=�����ƽ�3�:���� �n��>�F���form���ulating�ffinduction�in�lam�b�s3da�logic�����>�src:249induction.tex�In��hthis�section,��mw���e�sho�w�ho�w�mathematical�induction�is�form�ulated�in�lam�b�Gda����>logic,�c�and��Lho���w�lam�b�Gda�unication�can�b�e�used�to�instan���tiate�the�induction����>sc���hema�Ɓto�pro�Gduce�a�sp�ecic�instance�of�induction�needed�for�a�particular�pro�of.����>W��*�e�5Qb�Gegin�b���y�translating�the�usual�rst-order�form�of�induction�to�clausal�form.����>In��writing�this�axiom,�
�w���e�use�v��q�ariables��n�,��m��to�range�o���v�er��nonnegativ�e�in�tegers,����>and��(�s�(�n�)�is�the�successor�of��n�,���that�is,��n�X��+�1;�
�but��(in�formal�arithmetic,��s��is�tak���en����>as�UUprimitiv���e,�and�+�is�dened.����M�src:255induction.texHere�P�is�one�common�form�of�P���eano's�induction�axiom,���form�ulated�with�a����>v��q�ariable�UU�X�7�for�sets�of�natural�n���um�b�Gers:��������0���2��X�¸^�8�8�n�(�n��2��X����!��s�(�n�)��2��X���)��!�8�m�(�m��2��X��)����>�src:258induction.texThe��theory�logicians�call�\P���eano�Arithmetic"�(P��*�A)��is�a�theory�with�v��q�ariables����>only�|for�n���um�b�Gers,�!tnot�|for�sets,�and�the�single�induction�axiom�is�replaced�b���y�an����>axiom���sc���hema,���that�is,�b���y�innitely�man�y�axioms�all�of�the�same�form,���obtained����>b���y�UUreplacing�\�n���2��X���"�UUb�y��P�c��(�n�),�for�an�y�form�ula��P���with�one�free�v��q�ariable:��������P�c��(0)�8�^�8�n�(�P��(�n�)���!��P��(�s�(�n�)))��!�8�m�(�P��(�m�))�:����>�src:262induction.tex�T��*�o��form���ulate�induction�in�lam�b�Gda�logic,��zw�e�replace�\�n���2��X���"��b�y��Ap�(�X�:�;���n�).�.WWhen����>�Ap�(�X�:�;���n�)���o�Gccurs�in�the�syn���tactic�p�osition�of�a�form���ula,�bit�is�synon�ymous�with����>�Ap�(�X�:�;���n�)�*C=��tr�Gue�;���no���w�*p�X��R�ranges�o�v�er�prop�Gositional�functions�(b�o�olean-v��q�alued����>functions,�jin�e�to�Gda���y's�terminology)�dened�on�the�natural�n�um�b�Gers.���W��*�e�get�the����>follo���wing�UUform�ulation:����^��5��������i���Ap�(�X�:�;����0)�8�^�8�n�(�Ap�(�X�;���n�)���!��Ap�(�X�;���s�(�n�)))��!�8�m�(�Ap�(�X�;���m�))�:�����8�(1)������M�src:274induction.texLam���b�Gda���logic�is�an�un�t�yp�Ged�theory��*�,��but�the�v�ersion�of�induction�w�e�ha�v�e�just����>giv���en�+is�implicitly�t�yp�Ged:��the�v��q�ariables��n��and��m��ha�v�e�t�yp�Ge��N��F�(the�t�yp�Ge�of�natural����>n���um�b�Gers),�4and���the�v��q�ariable��X��Ͳhas�t���yp�e��i�(�N���;���bool�2`�)�(the�t���yp�e�of�functions�from��N����>�to��9�bool�2`�).�1In�turn��Ap��has�t���yp�Ge��i�(�i�(�N���;���bool��)�;�bool��);���s��9�has�t���yp�Ge��i�(�N���;���N��);�the�constan���t����>0�uthas�t���yp�Ge��N��.�''One�migh�t�think�that�w�e�should�in�tro�Gduce�a�unary�predicate��N��(�x�)����>and���restrict�the�in���teger�v��q�ariables�to��N��(�x�)�to�ac�hiev�e�a�prop�Ger�formalization�of����>arithmetic��Sin�lam���b�Gda�logic,�but�this�approac�h,�as�in�rst-order�man�y-sorted����>logic,��Uleads�x�to�ineciencies�in�automated�deduction�(notably��*�,�it�in���terferes�with����>the�o�applicabilit���y�of�h�yp�Gerresolution).�%BW��*�e�therefore�pro�ceed�without�suc���h�explicit����>t���ypings.��In�Yy[�5��],���w�e�ha�v�e�pro�v�ed�a�theorem�justifying�this�pro�Gcedure:���if�the�axioms��>��c�ff��v�	J=�����"5��-:�5����LܻThis��5theory�do�<res�not�express�the�full�strength�of�P�Îeano's�informal�axioms,���since�there�are��	��man�Îy�}predicates�on�natural�n�um�b�<rers�that�cannot�b�e�dened�in�this�theory��J�.���The�situation�is���more�\\lik�Îe�what�logicians�call�\w�eak�second�order�arithmetic",�t�whic�h�has�v��ariables�for�sets,�t�and���induction��is�expressed�using�a�single�form�Îula�with�a�set�v��ariable,���but�the�theory�is�still�w�eak���b�<recause��Xit�can't�pro�Îv�e��Xman�y�sets�exist.�������6����U��y�����?������>�can��b�Ge�correctly�t���yp�ed�(in�a�certain�precise�sense),��and�Otter-���nds�a�pro�of,����>then�uSall�the�steps�of�the�pro�Gof�can�b�e�correctly�t���yp�ed�as�w���ell.�'The�t�ypings�w�e�just����>ga���v�e�شfor��s�,��0,�and�ش�Ap��are�suc���h�that�the�induction�axiom�is�correctly�t�yp�Ged,��so�[�5��]����>justies�A�us�in�omitting�a�unary�predicate��N��(�x�)�in�the�form���ulation�of�induction.����M�src:285induction.texOur�8gnext�step�is�to�con���v�ert�8g(1)�to�clausal�form.��Using�the�equiv��q�alence�of����>�A���!��B��Ʋwith�UU�:�A�8�_��B��q�,�w���e�get����gd��:�Ap�(�X�:�;����0)�8�_�9�n�(�Ap�(�X�;���n�)��^�:�Ap�(�X�;���s�(�n�)))��_�8�m�(�Ap�(�X�;���m�))�:����>�src:287induction.tex�No���w�UUw�e�m�ust�in�tro�Gduce�a�Sk�olem�function��g��.�and�replace��n��b�y��g�[ٲ(�X���).�q�W��*�e�get����]2��:�Ap�(�X�:�;����0)�8�_��(�Ap�(�X�;���g�[ٲ(�X���))��^�:�Ap�(�X�;���s�(�g�[ٲ(�X���))))��_�8�m�(�Ap�(�X�;���m�))�:����>�src:289induction.tex�Distributing��othe��^��o���v�er��o�_��w���e�arriv�e�at�the�clausal�form.�kIn�clausal�form�it����>is�9traditional�to�use�`��'�for�negation,�J1instead�of�`�:�',�and�to�use��j��for�disjunc-����>tion���instead�of��_�.�kW��*�e�obtain�the�follo���wing�t�w�o�clauses�as�the�clausal�form�of����>mathematical�UUinduction:�������b���Ap�(�X�:�;����0)�
�j��Ap�(�X�;���g�[ٲ(�X���))��j��Ap�(�X�;���w�D�)������8�(2)���������b���Ap�(�X�:�;����0)�
�j�8��8�Ap�(�X�;�s�(�g�[ٲ(�X���)))�
�j��Ap�(�X�:�;�w�D�)������8�(3)������>�src:297induction.texIn��all�clausal-form�form���ulas,��rw�e��follo�w�the�con�v�en�tion�that�v��q�ariables�ha�v�e�names����>b�Geginning��with�(upp�er�or�lo���w�er��case)��x�,�J�y�[ٲ,��z�p��,��u�,��v�u��or�ɵw�^��and�other�letters�are����>constan���ts.���T��*�o���follo�w�this�con�v�en�tion,�Ҷw�e�c�hanged�the�quan�tied�v��q�ariable��m��to����>�w�P�in�.passing�to�clausal�form,�where��m��w���ould�b�Ge�considered�constan�t.�YNote�that����>if�5^w���e�had�pro�Gceeded�in�another�order,�m`w�e�migh�t�ha�v�e�come�out�with��g�[ٲ(�X�:�;���w�D�)����>instead���of�just��g�[ٲ(�X���);��that�w���ould�also�w�ork,�Qbut�it�is�simpler�to�Sk�olemize�b�Gefore����>remo���ving�UUthe�quan�tier�on��m�.�q�Clausal�form�is�not�unique.����M�src:305induction.texThis�R�is�one�form�in�whic���h�induction�can�written�in�an�Otter-���input�le;����>sp�Gecically��*�,�)this��eis�the�form�w���e�use�when�pro�ving�theorems�in�P�eano�Arith-����>metic.���W��*�e�Wwill�sho���w�b�Gelo�w�that�Otter-���can�pro�v�e�the�standard�theorems�at����>the��
foundation�of�arithmetic|for�example,��:the�asso�Gciativit���y�and�comm�utativ-����>it���y�Weof�addition�and�m�ultiplication,�W�and�the�distributiv�e�la�ws|directly�from�the����>denitions���of�addition,��m���ultiplication,�and���successor,�using�this�form���ulation�of����>induction��!and�lam���b�Gda�unication.�++Other�forms�of�induction�will�also�b�e�in���tro-����>duced���and�used�in�other�examples�b�Gelo���w,���but�w�e�will�b�Gegin�with�this�one,���the����>arc���het�ypal�
�form.�Y�P�eano�arithmetic�also�includes�the�usual�axioms�for�successor:������Ŭx�s�(�x�)���6�=�0������8�(4)����������c�s�(�x�)���6�=��s�(�y�[ٲ)�����0�j������x���=��y�[�:������8�(5)����!č�>�Lam���b�s3da�~?unication�applied�to�pro�of�b���y�induction�����>�src:319induction.tex�In��this�section,��w���e�will�sho�w�ho�w�lam�b�Gda�unication�w�orks�to�nd�an�instance����>of�x�induction.��iLet�us�pic���k�a�sample�problem:���the�asso�Gciativit�y�of�addition.��iOur������7����eҠy�����?������>�axioms�UUwill�include�the�denition�of�addition,�namely������Ŭv�x�8�+�0������q=������c��x������8�(6)����������a�x�8�+��s�(�y�[ٲ)������q=������c��s�(�x�8�+��y�[ٲ)������8�(7)���������8�(8)������>�src:326induction.texT��*�o���pro���v�e�the�asso�Gciativit�y�of�addition,���w�e�en�ter�its�negation�as�an�axiom,���with����>the�UUv��q�ariables�c���hanged�to�constan�ts,�as�usual�in�clausal�pro�Gof�systems:��������(�a�8�+��b�)�+��c���6�=��a�8�+�(�b��+��c�)�����8�(9)������>�src:331induction.texW��*�e�� no���w�sho�w�ho�w�binary�resolution,��^extended�to�use�lam�b�Gda�unication�instead����>of�M�just�ordinary�(Robinson)�unication,��Ucan�b�Ge�used�in�this�axiom�set.��W��*�e�resolv���e����>the���negated�goal�with�(2)�and/or�with�(3).�21Either�of�these�attempted�resolutions����>giv���es���rise�to�the�unication�problem,�Jto�unify��Ap�(�X�:�;���w�D�)�with�(�a�%��+��b�)�+��c��=����>�a���+�(�b��+��c�).�K�W��*�e�H�follo���w�the�steps�for�lam�b�Gda�unication�giv�en�ab�Go�v�e.�K�Step�1����>requires�qus�to�pic���k�a�masking�term.��Since�there�are�no�o�Gccurrences�of��X�9��in����>the��:asso�Gciativ���e�la�w,��4w�e�could�pic�k�an�y�term.�wBut�Otter-��'s�algorithm�will�pic�k����>either��aa�constan���t�or�a�term�o�Gccurring�as�a�second�argumen�t�of��Ap�.���There�are����>no��o�Gccurrences�of��Ap�,���so�w���e�ha�v�e�to�pic�k�one�of�the�constan�ts��a�,����b�,�or���c�.�T�Let's����>pic���k��N�c�.���W��*�e�then�unify��w��1�with��c�,�ӌgetting�the�substitution���'�that�assigns��w��the����>v��q�alue���c�.���Con���tin�uing�to�step�3�of�lam�b�Gda�unication,�Lw�e�ha�v�e�to�pic�k�a�set��S����>�of��`o�Gccurrences�of��c�9�(whic���h�is�just��c��in�this�case)�in�the�asso�ciativ���e�la�w.���Let's����>pic���k�7Rthe�set��S��߲consisting�of�b�Goth�o�ccurrences�of��c�.��Then�the�instructions�for����>lam���b�Gda�x�unication�sa�y��*�,���\let��z��d�b�Ge�a�fresh�v��q�ariable,�and�let��r���b�Ge�the�result�of����>substituting�g�z�t��for�eac���h�o�Gccurrence�of��c�".�~�The�term��r�K��that�w�e�get�in�this�w�a�y����>is��(�a���+��b�)�+��z�iL�=����a��+�(�b��+��z�p��).���Step�4�no���w�tells�us�to�pro�Gduce�the�substitution����>�X��>�:=��\�l�2`ambda�(�z�p�;����(�a�b�+��b�)�+��z�h�=��a��+�(�b��+��z�p��))�;���w�=?�:=��c���as�the�result�of�lam���b�Gda����>unication.�LQLet's��v���erify�that�in�this�case,�w�e�ha�v�e�indeed�pro�Gduced�a�lam�b�Gda����>unier.�q�Call�UUthis�substitution���!Dz.�Applying���w�to��Ap�(�X�:�;���w�D�),�w���e�nd������h�f�Ap�(�X�:�;���w�D�)��������]�=�������{�Ap�(�l�2`ambda�(�z�p�;����(�a�8�+��b�)�+��z�7��=���a��+�(�b��+��z��))�;���c�)����������]=�������{(�a�8�+��b�)�+��c���=��a�8�+�(�b��+��c�)������>�src:351induction.texso�c�indeed,��
���G�is�a�lam���b�Gda�unier�of�the�t�w�o�input�terms.��GThis�v��q�alue�of��X�,b�is����>exactly�athe�instance�of�induction�required�to�pro���v�e�athe�asso�Gciativ���e�la�w.�V�W��*�e�no�w����>sho���w�<)ho�w�the�pro�Gof�pro�ceeds.�&BBy�resolving�the�negated�asso�ciativ���e�la�w�with����>�Ap�(�X�:�;���w�D�)�UUin�(2)�w���e�deriv�e�����67��Ap�(�X������;����0)�
�j��Ap�(�X����;���g�[ٲ(�X��!Dz))����>�src:356induction.texIf�q�w���e�write�out��X�����߲=���l�2`ambda�(�z�p�;����(�a�r%�+��b�)�+��z�7��=��a��+�(�b��+��z�p��))�q�explicitly��*�,��pbut�abbreviate����>the�UUSk���olem�term��g�[ٲ(�X����!Dz)�b�y��d�,�this�b�Gecomes�������?��Ap�(�l�2`ambda�(�z�p�;����(�a�8�+��b�)�+��z�7��=���a��+�(�b��+��z��))�;����0)�
�j�����������Ap�(�l�2`ambda�(�z�p�;����(�a�8�+��b�)�+��z�7��=���a��+�(�b��+��z��))�;���d�)��������8����	t��y�����?������>�src:362induction.tex�Beta-reducing,�UUw���e�ha�v�e����r��(�a�8�+��b�)�+�0���6�=��a�8�+�(�b��+�0)�
�j��(�a�8�+��b�)�+��d���=��a�8�+�(�b��+��d�)�:����>�src:364induction.tex�Using���the�la���w�(6),���the�rst�literal�reduces�to��a�a��+��b�-,�6�=��a�a��+��b�.�)�This���resolv�es�with����>the�UUequalit���y�axiom��x���=��x�UU�and�falls�a�w�a�y��*�,�lea�ving�����p�(�a�8�+��b�)�+��d���=��a�8�+�(�b��+��d�)�;����>�src:367induction.tex�whic���h��Uis�recognizable�as�the�induction�h�yp�Gothesis.�1rW��*�e�no�w�start�again,���resolving����>the��negated�asso�Gciativ���e�la�w�with��Ap�(�X�:�;���w�D�)�in�(3).�XMThe�same�lam�b�Gda�unication����>problem�UUarises,�and�the�same�substitution�is�pro�Gduced.�q�W��*�e�obtain�this�time�������?��Ap�(�l�2`ambda�(�z�p�;����(�a�8�+��b�)�+��z�7��=���a��+�(�b��+��z��))�;����0)�
�j���������?�Ap�(�l�2`ambda�(�z�p�;����(�a�8�+��b�)�+��z�7��=���a��+�(�b��+��z��))�;���s�(�d�))������>�src:374induction.texand�UUafter�b�Geta-reduction,����f�(�a�8�+��b�)�+�0���6�=��a�8�+�(�b��+�0)�
�j��(�a�8�+��b�)�+��s�(�d�)���6�=��a�8�+�(�b��+��s�(�d�))�:����>�src:376induction.tex�Again�UUusing�(6)�to�disp�Gose�of�the�base�case�(the�rst�literal)�w���e�obtain�������(�a�8�+��b�)�+��s�(�d�)���6�=��a�8�+�(�b��+��s�(�d�))�;����>�src:378induction.tex�whic���h��is�recognizable�as�the�negated�induction�step.���Using�the�second�la�w�of����>addition�UU(7),�w���e�obtain�����Nݵs�((�a�8�+��b�)�+��d�)���6�=��a�8�+��s�(�b��+��d�))����>�src:381induction.texand�UUthen�using�it�again�on�the�righ���t�w�e�ha�v�e��������s�((�a�8�+��b�)�+��d�)���6�=��s�(�a�8�+�(�b��+��d�))�:����>�src:383induction.tex�No���w�UUone�application�of�the�induction�h�yp�Gothesis�yields��������s�(�a�8�+�(�b��+��d�))���6�=��s�(�a�8�+�(�b��+��d�))�;����>�src:385induction.tex�whic���h�_Rresolv�es�with�the�equalit�y�axiom��x�׾�=��x�,�a�pro�Gducing�the�empt���y�clause�and����>completing�UUthe�pro�Gof.����M�src:387induction.texThis�
�has�b�Geen�a�hand-pro�duced�pro�of�b���y�binary�resolution�and�equalit�y�rea-����>soning,��3using�^lam���b�Gda�unication�in�resolution.���W��*�e�no�w�discuss�ho�w�Otter-�����>�nds�޻this�pro�Gof.�J?W��*�e�will�assume�familiarit���y�with�the�basics�of�the�clausal-searc�h����>paradigm���of�automated�deduction,���including�the�rules�of�inference�binary�res-����>olution,�FJh���yp�Gerresolution,�paramo�dulation,�and�demo�dulation,�all�of�whic���h�are����>explained�7�(for�example)�b���y�W��*�os�and�Piep�Ger�[�15��
].� W�e�also�assume�familiarit���y����>with���the�terms�\set�of�supp�Gort"�and�\usable".��These�terms�are�also�dened�in����>[�15��
];�M:on�I-page�94�of�[�15��]�the�basic�searc���h�algorithm�of�Otter,�K�whic�h�in�v�olv�es�lists����>of�UUform���ulas�with�these�names,�is�lucidly�explained.������9����
���y�����?������M�src:395induction.tex�W��*�e�o�b�Gegin�b���y�preparing�an�input�le:���w�e�put�the�negated�goal�in�the�set����>of��supp�Gort,�9and�the�other�axioms�in�\usable".��W��*�e�include�the�equalit���y�axiom����>�x���=��x�;�J�in�Eythe�con���text�of�lam�b�Gda�logic,�H�this�sa�ys�that��Ap�(�x;���y�[ٲ)�is�alw�a�ys�dened,����>i.e.,�Nw���e�LGare�w�orking�with�(total)�lam�b�Gda�logic�rather�than�partial�lam�b�Gda�logic.����>W��*�e�f'put�the�t���w�o�f'axioms�ab�Gout�addition�in�as�demo�dulators,��[orien���ted�so�that����>�x�Z��+��s�(�y�[ٲ)��will�b�Ge�rewritten�as��s�(�x�Z��+��y��)��and��x�Z��+�0��will�b�Ge�c���hanged�to��x�.�
Otter-�����>�applies�>ub�Geta-reduction�in�the�same�w���a�y�>uthat�Otter�applies�demo�dulation.�j'Th���us����>sev���eral���steps�at�the�last�of�the�hand�crafted�pro�Gof�ab�o���v�e���actually�get�compressed����>in���to���one�Otter-���step,�Pas�b�Geta�reductions�and�demo�dulations�are�applied�as����>\simplications"�(�of�deduced�clauses,�]�and�the�in���termediate�steps�sho�wn�ab�Go�v�e����>are��not�retained�as�deduced�clauses.��The�pro�Gof�that�Otter-���pro�duces�is�th���us����>somewhat��*shorter�in�out���w�ard��*app�Gearance,��_although�in�realit���y�it�represen�ts�the����>same���pro�Gof�sho���wn�ab�o���v�e.�5�Otter-�����pro�ofs�follo���w�the�same�format�as�Otter�pro�ofs;����>those�b�not�accustomed�to�reading�Otter�pro�Gofs�will�nd�some�hin���ts�b�elo���w.��]Here����>is���the�pro�Gof�exactly�as�Otter-���pro�duces�it,��Zexcept�that�extra�line�breaks�ha���v�e����>b�Geen�UUinserted�to�mak���e�it�prin�t�within�the�margins:����>�src:428induction.tex�1�?�[]�x+0=x.����>3�?�[]�x=x.����>6�?�[]�-ap(y,0)|ap(y,g(y))|ap(y,z).����>7�?�[]�-ap(y,0)|�-ap(y,s(g(y)))|ap(y,z).����>8�?�[]�x+s(y)=s(x+y).����>10�?�[]�(a+b)+n!=a+b+n.����>11�?�[binary,10.1,7.3,demod,beta,1,1,beta,unit_del,3]����M��(a+b)+s(g(lambda(x,(a+b)+x=a+b+x)))!=����M��a+b+s(g(lambda(x,(a+b)+x=a+b+x))).����>12�?�[binary,10.1,6.3,demod,beta,1,1,beta,unit_del,3]����M��(a+b)+g(lambda(x,(a+b)+x=a+b+x))=a+b+g(lambda(x,(a+b)+x=a+b+x)).����>14�?�[para_from,12.1.1,8.1.2.1]����M��(a+b)+s(g(lambda(x,(a+b)+x=a+b+x)))=����M��s(a+b+g(lambda(x,(a+b)+x=a+b+x))).����>18�?�[para_into,11.1.2.2,8.1.1]����M��(a+b)+s(g(lambda(x,(a+b)+x=a+b+x)))!=����M��a+s(b+g(lambda(x,(a+b)+x=a+b+x))).����>25�?�[para_into,14.1.2,8.1.2]����M��(a+b)+s(g(lambda(x,(a+b)+x=a+b+x)))=����M��a+s(b+g(lambda(x,(a+b)+x=a+b+x))).����>26�?�[binary,25.1,18.1]�$F.����>�src:431induction.tex�and�r~here�it�is�again,�y�but�with�the�Sk���olem�term��g(lambda(x,(a+b)+x=a+b+x))����>�replaced�v�b���y�a�constan�t��d�;���this�mak�es�the�pro�Gof�m�uc�h�easier�to�read.�֚In�general����>suc���h�UUa�Sk�olem�term�essen�tially�represen�ts�an�\arbitrary�constan�t".����>�src:449induction.tex�1�?�[]�x+0=x.����>3�?�[]�x=x.����>6�?�[]�-ap(y,0)|ap(y,g(y))|ap(y,z).����>7�?�[]�-ap(y,0)|�-ap(y,s(g(y)))|ap(y,z).��������10�������y�����?������>�8�?�[]�x+s(y)=s(x+y).����>10�?�[]�(a+b)+n!=a+b+n.����>11�?�[binary,10.1,7.3,demod,beta,1,1,beta,unit_del,3]����M��(a+b)+s(d)!=a+b+s(d).����>12�?�[binary,10.1,6.3,demod,beta,1,1,beta,unit_del,3]����M��(a+b)+d=a+b+d.����>14�?�[para_from,12.1.1,8.1.2.1]�(a+b)+s(d)=s(a+b+d).����>18�?�[para_into,11.1.2.2,8.1.1]�(a+b)+s(d)!=a+s(b+d).����>25�?�[para_into,14.1.2,8.1.2]�(a+b)+s(d)=a+s(b+d).����>26�?�[binary,25.1,18.1]�$F.����M�src:451induction.tex�Hints�/	for�r��}'e�ading�/	Otter�pr��}'o�ofs��!�:��The���n���um�b�Gers�at�the�left�are�line�n�um�b�Gers.����>They���indicate�the�n���um�b�Ger���of�eac���h�deduced�clause�among�all�clauses�generated����>during��the�searc���h.�If�some�of�the�n�um�b�Gers�are�large,�݆that�means�that�a�lot����>of�	�clauses�w���ere�generated.���After�the�n�um�b�Gers�on�eac�h�line�come�some�square����>brac���k�ets.�P�If��Fthere�is�nothing�inside�these�brac���k�ets,�that��Fmeans�that�this�line�w���as����>an�<�axiom.�i�If�there�is�something�inside,�A�that�tells�what�rule�or�rules�of�inference����>w���ere���used�to�deduce�this�line,���and�the�n�um�b�Gers�tell�what�the�\paren�t�clauses"����>w���ere,�Mi.e.,�from�Kwhic�h�previous�lines�this�line�w�as�deduced.�nWF��*�or�example,�Min�the����>ab�Go���v�e�_!pro�of,�a�line�11�w���as�deduced�b�y�binary�resolution�from�lines�10�and�7,�a�but����>the��direct�result�of�resolution�w���as�simplied�b�y�demo�Gdulation,��Pb�eta��reduction,����>and��Munit�deletion.���The�extra�digits�after�the�decimal�p�Goin���ts�tell�whic�h�part�of����>the�/�form���ula�w�as�used,�7Ue.g.�eG10.1�is�the�rst�literal�in�line�10,�and�7.3�is�the�third����>literal���in�line�7.��When�line�14�is�deduced,���the�n���um�b�Gers���12.1.1�refer�to�the�rst����>subterm�
xof�the�rst�literal�of�line�12,��that�is,�to�the�left�side�of�that�equation.�Y�If����>y���ou�nare�new�to�reading�Otter�pro�Gofs,�*6compare�the�ab�o���v�e�nexample�in�detail�with����>the�,�hand�crafted�pro�Gof,�bUun���til�y�ou�see�what�eac�h�of�the�annotations�in�square����>brac���k�ets�UUmeans.��!č�>�Cho�s3osing�ffthe�righ���t�induction�v���ariable�����>�src:467induction.tex�The��ab�Go���v�e�example�illustrates�the�problem�of�c�ho�Gosing�an�induction�v��q�ariable.����>When�OClam���b�Gda�unication�has�to�pic�k�a�masking�subterm�of�(�a�,��+��b�)�+��c���=��a�,��+�(�b��+��c�),����>there��are�nine�p�Gossible�c���hoices�to�consider�(all�subterms�of�the�t�w�o�sides).�6Otter-����>lam���b�Gda��Ican�bac�ktrac�k�and�return�m�ultiple�uniers,��but�this�impro�v�emen�t�to�the����>implemen���tation���w�as�made�rather�late�in�this�researc�h(Decem�b�Ger�2005),���after�a����>long�thesitation�ab�Gout�exactly�ho���w�to�do�it,�$�since�Otter's�arc�hitecture�seemed�at����>rst��to�dep�Gend�hea���vily�on�the�single-v��q�aluedness�of�unication.�M.Therefore,��~atten-����>tion�0�w���as�paid�to�v��q�arious�heuristics�for�making�a�go�Go�d�0�selection;�<�these�heuristics����>are�USstill�used�if�sev���eral�selections�are�allo�w�ed,�but�they�are�no�longer�necessary��*�.����>Otter-��(
�allo���ws�a�user�to�put�a�command�of�the�form��assign(max���E�ff&f��ǫunifiers,����>8)���in�an�input�le.�e�This�causes�Otter-���to�bac���ktrac�k���o�v�er�dieren�t�selections����>of�F�masking�terms�and�sets�of�o�Gccurrences�of�the�masking�term,�I�up�to�the�sp�eci-����>ed�Jmaxim���um�n�um�b�Ger�(p�er�unication�of��Ap�(�X�:�;���w�D�)�with��t�)�and�return�m���ultiple����>uniers�UUcorresp�Gonding�to�these�c���hoices.�������11�������y�����?������M�src:479induction.tex�In���c���ho�Gosing�a�masking�term�to�b�e�replaced�b���y�an�induction�v��q�ariable,���it�is�also����>imp�Gortan���t��ito�c�ho�Gose�a�term�that�is�\implicitly�t�yp�Ged"�as�an�in�teger,��ein�the�sense����>of�M
[�5��].��This�is�necessary�if�w���e�w�an�t�to�b�Ge�assured�in�adv��q�ance�b�y�the�theorems�of�[�5��]����>that�c�our�deductions�will�b�Ge�correctly�t���yp�eable.��iThis�can�b�e�assured�b���y�putting����>�set(types)�sزin�the�input�le,�{yin�whic���h�case�only�constan�ts�will�b�Ge�tried;��unless����>the��input�le�also�con���tains�a��list(types)�,�N�in�whic�h�the�t�yp�Ges�of�some�other����>terms�vcan�b�Ge�sp�ecied.��*The�heuristic�used�to�select�a�constan���t,�=�when�sev�eral����>o�Gccur,��lis��2this:�05if�the�main�sym���b�ol�is�`=',��land�some�constan���t�o�ccurs�on�b�oth�sides����>of��the�equation,�A�then�select�the�righ���tmost�constan�t�that�o�Gccurs�on�b�oth�sides����>of�S�the�equation.�q2Otherwise�(if�the�sym���b�Gol�is�not�equalit�y�or�no�constan�t�o�Gccurs����>on��"b�Goth�sides)�select�the�righ���tmost�constan�t.��.Ho�w�ev�er,��Uif�one�of�the�constan�ts����>is�2Sliterally�`�n�'�or�`�m�',�9Sthen�select�that�constan���t|this�feature�allo�ws�the�writer�of����>the�UUinput�le�to�giv���e�Otter-���a�hin�t.����M�src:489induction.texSuc���h��hin�ts�w�ere�imp�Gortan�t�in�early�v�ersions�of�Otter-lam�b�Gda,�>�whic�h�could����>not�7�bac���ktrac�k�to�pro�Gduce�m�ultiple�uniers,�p.but�they�are�no�longer�necessary��*�.����>All�-Dthe�examples�in�this�pap�Ger,�c@except�those�in���v�olving�-Dthe�need�to�generalize����>the��Etheorem�b�Gefore�pro���ving�it�b�y�induction,���can�b�Ge�pro�v�ed�b�y�Otter-���without����>needing��to�bac���ktrac�k��o�v�er�dieren�t�c�hoices�of�the�induction�v��q�ariable,�a�but�if����>bac���ktrac�king��Ois�allo���w�ed,�
the��Ometho�Gd�is�essen���tially�free�of�the�need�for�heuristics;����>w���e��Rcould�tak�e�those�heuristics�out�of�the�program�without�diminishing�its�p�Go�w�er.��!č�>�P���eano�ffarithmetic�����>�src:498induction.tex�W��*�e���ha���v�e�already�seen�one�simple�example�of�a�pro�Gof�in�P�eano�arithmetic,��&but����>Otter-lam���b�Gda�ӽhas�pro�v�ed�other,�3Wmore�complicated�examples.��Eac�h�of�these����>examples�UUhas�some�p�Goin���ts�of�in�terest,�so�w�e�review�them�here.����>�src:501induction.tex�The�Hc��}'anc�el���lation�law��a��t�+��n��	�=��b��t�+��n��implies��a��	�=��b�.�
�Since�޳what�is�to�pro���v�ed�޳is����>an���implication,�)the�input�le�con���tains�the�assumption��a��ɲ+��n��^�=��b��ɲ+��n����and�the����>negated�UUconclusion��a���6�=��b:����M�src:504induction.tex�Otter-���ղthen�pro���v�es��յa��5�+��n���6�=��b��5�+��n��b���y�induction,��using��a���6�=��b��for�the�base����>case.�YSince�Gthe�theorem�b�Geing�pro���v�ed�Gb�y�induction�is�an�inequation�rather�than����>an��equation,��induction�needs�to�b�Ge�giv���en�in�a�sligh�tly�dieren�t�form,��with��Ap����>�and��e��Ap��in���terc�hanged.�?"It��etak�es�b�Goth�forms�to�fully�express�induction�in�lam�b�Gda����>logic,���since��the�meta-lev���el�negation�is�not�expressed�at�the�ob��8ject�lev�el.�J�In�other����>w���ords,��Otter-����is�nev�er�going�to�try�to�unify��Ap�(�y�[�;���x�)�with���P�c��(�x�),��so�if�w�e�w�an�t����>induction�	to�apply�to�negated�literals,�Pw���e�ha�v�e�to�supply�also�the�form�in�whic�h����>�Ap�(�y�[�;���x�)�UUis�negated.��!�6��B����N�cmbx12�Comm��utativit�y��of�addition��uT��>�src:511induction.tex�This�.example�is�of�in���terest�b�Gecause�the�induction�step�requires�a�lemma,�9�and����>the��lemma�itself�has�to�b�Ge�pro���v�ed��b�y�induction.�1lNot�only�that,��the�base�case����>also�^Thas�to�b�Ge�pro���v�ed�^Tb�y�induction.���This�is�an�inevitable�situation�in�inductiv�e����>theorem-pro���ving,�UUas�is�p�Goin�ted�out�in�Bundy's�surv�ey�article�[�9��],�p.�q�869:�������12����
�<�y�����?������W�src:514induction.tex�Sometimes�E�a�lemma�required�to�complete�the�pro�A�of�is�not�already�a��9v��|railable����Wand�{gis�not�deducible�from�the�existing�theory�without�a�nested�application����Wof���induction.��kThis�is�a�consequence�of�the�failure�of�cut�elimination�for����Winductiv��9e��theories.���Suc�h�lemmata�m�ust�b�A�e�conjectured�and�then�pro�v�ed����Was�Tsubgoals.����M�src:519induction.tex�Here�
�is�an�outline�of�the�pro�Gof:�Lnw���e�w�an�t�to�pro�v�e��x��{�+��y�"�=���y��T�+��x�
��b�y�induction����>on�˳�y�[ٲ.�C�The�base�case�is��x�%��+�0��=�0�%�+��x�.�Since�˳�x��+�0��=��x��is�one�of�the�P���eano�axioms,����>this��b�Goils�do���wn�to��x���=�0��O+��x�.�TThat��has�to�b�e�pro���v�ed��b�y�induction�on��x�.�TPutting����>that�UUaside�for�no���w,�the�induction�step�of�the�main�induction�is�to�pro�v�e�����+I�x�8�+��s�(�y�[ٲ)��=��s�(�y��)�8�+��x����>�src:521induction.tex�assuming�G�x�	�+��y�"�=���y�y�+��x�.�mNThis�lemma�also�has�to�b�Ge�pro���v�ed�b�y�induction.�mNTh�us����>three�`Oapplications�of�the�induction�axiom�are�needed�to�complete�this�pro�Gof.����>Otter-lam���b�Gda��successfully�nds�all�three�instances�of�induction�automatically��*�,����>using�ilam���b�Gda�unication.��In�fact,���Otter-lam�b�Gda�pro�v�es��s�(�y�[ٲ)�T�+��x�
9�=��s�(�x�T�+��y��)�ib���y����>induction,��6but��nthat�is�only�one�step�remo���v�ed��n(b�y�the�denition�of�addition)�from����>the�UUinduction�step�of�the�main�induction.����M�src:523induction.texNo���w���w�e�examine�the�pro�Gof�more�closely��*�.�:�The�rst�thing�to�notice�is�the�three����>lam���b�Gda�UUterms�that�o�ccur�in�the�pro�of:����>�src:529induction.tex�lambda(x,a+x=x+a)����>lambda(y,y=0+y)����>lambda(y,s(g(n,lambda(z,a+z=z+a))+y)=s(g(n,lambda(u,a+u=u+a)))+y)����M�src:532induction.tex�These�Bterms�represen���t�the�prop�Gositional�functions�to�b�e�used�in�the�applica-����>tion�UUof�the�induction�sc���hema.�q�The�corresp�Gonding�Sk�olem�terms�are����>�src:539induction.tex�c�?�=�g(n,lambda(x,a+x=x+a))����>d�?�=�g(a,lambda(y,y=0+y))����>b�?�=�g(a,lambda(y,s(g(n,lambda(z,a+z=z+a))+y)=����R��s(g(n,lambda(u,a+u=u+a)))+y))����M�src:542induction.tex�The��follo���wing�v�ersion�of�the�pro�Gof�w�as�obtained�from�the�mac�hine�output����>b���y�j�replacing�these�Sk�olem�terms�(and�v��q�arian�ts�dieren�t�only�b�y�renaming�of����>lam���b�Gda-b�ound�v��q�ariables)�b�y��c�,�*��d�,�and��b��as�dened�here.�q�I���ha�v�e�also�stripp�Ged����>o���the�names�of�the�inference�rules�used,��7lea���ving�only�the�line�n�um�b�Gers�of�the����>paren���ts�UUin�v�olv�ed.����>�src:572induction.tex�1�?�[]�x+0=x.����>2�?�[]�x=x.����>5�?�[]�-ap(y,0)|ap(y,g(z,y))|ap(y,z).����>6�?�[]�-ap(y,0)|�-ap(y,s(g(z,y)))|ap(y,z).����>7�?�[]�x+s(y)=s(x+y).����>8�?�[]�a+n!=n+a.��������13�����g�y�����?������>�9�?�[8.1,6.3]�a!=0+a|a+s(c)!=s(c)+a.����>10�?�[8.1,5.3]�a!=0+a|a+c=c+a.����>27�?�[9.1,6.3,1,2]�a+s(c)!=s(c)+a|s(d)!=0+s(d).����>28�?�[9.1,5.3,1,2]�a+s(c)!=s(c)+a|d=0+d.����>51�?�[10.1,6.3,1,2]�a+c=c+a|s(d)!=0+s(d).����>52�?�[10.1,5.3,1,2]�a+c=c+a|d=0+d.����>85�?�[52.2.2,7.1.2.1]�0+s(d)=s(d)|a+c=c+a.����>150�?�[28.2.2,7.1.2.1]�0+s(d)=s(d)|a+s(c)!=s(c)+a.����>962�?�[85.1.1,51.2.2]�a+c=c+a.����>968�?�[962.1.1,7.1.2.1]�a+s(c)=s(c+a).����>976�?�[968.1.1,7.1.1]�s(c+a)=s(a+c).����>991�?�[976.1.2,7.1.2]�s(c+a)=a+s(c).����>2852�?�[150.1.1,27.2.2,2]�a+s(c)!=s(c)+a.����>2873�?�[2852.1.1,991.1.2]�s(c+a)!=s(c)+a.����>2880�?�[2873.1,6.3,1,1,2]�s(c+s(b))!=s(c)+s(b).����>2881�?�[2873.1,5.3,1,1,,2]�s(c+b)=s(c)+b.����>2893�?�[2881.1.1,7.1.2]�c+s(b)=s(c)+b.����>2927�?�[2893.1.1,7.1.2.1]�c+s(s(b))=s(s(c)+b).����>3015�?�[2880.1.2,7.1.1]�s(c+s(b))!=s(s(c)+b).����>3091�?�[2927.1.1,7.1.1]�s(c+s(b))=s(s(c)+b).����>3092�?�[3091.1,3015.1]�$F.����M�src:575induction.tex�No���w�@nfor�the�commen�tary��*�.�{Line�8�is�the�negation�of�the�main�goal��a��+��n���=��n��+��a�.����>Lines���9�and�10�sa���y��*�,���Let's�pro�v�e�it�b�y�induction�on��n�.��Lines�27,���28,�51,�and���52����>sa���y��*�,���OK,��#the�base�case�b�Goils�do�wn�to�0��i+��a��o�=��a�;��let's��#pro�v�e�that�b�y�induction����>on��W�a�.�4�(It�needs�four�lines�to�sa���y�that.)�The�next�three�lines,���85,�150,�and��W962,����>p�Golish���o�that�induction,�8lik���e�this:���assuming�0���+��d�͛�=��d�,�tak���e���the�successor�of����>b�Goth�tsides�to�get��s�(0�MR+��d�)��4=�0�MR+��s�(�d�)��4=��s�(�d�).���The�tbase�case�is�tak���en�care�of�b�y����>the�Tdemo�Gdulator��x��߲+�0��=�0.���A���t�Tline�962�the�inductiv�e�pro�Gof�of�the�base�case����>of��the�main�induction�is�completed,�9lea���ving�the�no�w-unencum�b�Gered�induction����>h���yp�Gothesis�w*of�the�main�induction,���a�On�+��c��z�=��c�On�+��a�.��EAgain�w*taking�the�successor�of����>b�Goth�sides�w���e�ha�v�e��s�(�a���+��c�)��
=��a���+��s�(�c�)��
=��s�(�c���+��a�)�(lines�968,�<L976)�and�using����>the�/Kdenition�of�addition�on��s�(�c��.�+��a�)�2[=��s�(�a��.�+��c�),�e�w���e�/Kget��s�(�c��.�+��a�)�2[=��a��.�+��s�(�c�)����>(line���991).�U@Some�eigh���teen�h�undred�clauses�later,��w�e�nd�the�negated�goal�of�the����>main���induction�step�at�clause�2852:���a�[D�+��s�(�c�)��6�=��s�(�c�)�[D+��a�.��Otter-lam���b�Gda���applies����>the��denition�of�addition�(bac���kw�ards!)�N�to��the�left�hand�side�to�get,��at�line�2873,����>�s�(�c�8�+��a�)���6�=��s�(�c�)�8�+��a�.����M�src:580induction.texThen�~nlines�2880�and�2881�sa���y�\Let's�pro�v�e�that�b�y�induction�on��a�."��Otter-����>lam���b�Gda��~c�ho�oses��~the�constan���t��a��b�ecause�it�programmed�to�prefer�a�constan���t����>o���v�er���a�Sk���olem�term�for�replacemen�t�b�y�a�new�lam�b�Gda�v��q�ariable�in�unication|����>remem���b�Ger��R�c��is�a�complicated�Sk�olem�term|ev�en�when�that�Sk�olem�term�o�Gccurs����>as���a�second�argumen���t�of��Ap�.�n�The�induction�h�yp�Gothesis�is��s�(�c���+��b�)���=��s�(�c�)���+��b����>�(line��2881);�Crthat�can�b�Ge�written��c����+��s�(�b�)�ϩ=��s�(�c�)���+��b�,��and��taking�the�successor����>of�T�b�Goth�sides�w���e�ha�v�e��s�(�c�7��+��s�(�b�))��=��s�(�s�(�c�)�7�+��b�)�T�(line�2927)�and�hence,�T�using�the����>denition��+of�addition�on�the�left,�g�s�(�c����+��s�(�b�))��=��s�(�s�(�c�)���+��b�)��+(line�3091).�UUsing�the����>denition��rof�addition�once�more�on�the�righ���t�side,��w�e�get��s�(�c���+��s�(�b�))��=��s�(�c�)��+��s�(�b�).�������14�����0�y�����?������>�That�Ocompletes�the�induction�step�and�the�pro�Gof.�o�Actually��*�,�PUOtter-lam���b�da�Odo�es����>this��slast�step�sligh���tly�dieren�tly:�it�applies�the�denition�of�addition�to�the����>negated��goal�of�the�induction�step,��whic���h�is��s�(�c����+��s�(�b�))��a�6�=��s�(�c�)���+��s�(�b�),�getting����>�s�(�c�8�+��s�(�b�))���6�=��s�(�s�(�c�)�8�+��b�),�UUcon���tradicting�line�3091.���	��>�Comm��utativit�y��of�m��ultiplication��uT��>�src:584induction.tex�The��comm���utativit�y�of�addition�requires�ab�Gout�four�seconds�on�a�2.8�ghz.��Dma-����>c���hine.���Our��Xnext�example,���the�comm�utativit�y�of�m�ultiplication,���requires�ab�Gout����>42�$�seconds�on�the�same�mac���hine.��Ab�Gout�149,000�clauses�are�generated.�The����>pro�Gof,�p�ho���w�ev�er,�is�7�only�12�steps�long,�and�is�ab�Gout�what�a�h���uman�w�ould�do.����>Y��*�ou��are�recommended�to�nd�a�pro�Gof�y���ourself,��using�p�encil�and�pap�er,��b�efore����>lo�Goking��at�the�pro�of�found�b���y�Otter-��.���The�input�le�con�tains,��in�addition�to����>the���P���eano�axioms,��9some�consequences�of�the�P�eano�axioms�that�are�pro�v�ed�in����>separate��
Otter-lam���b�Gda�runs�from�the�P�eano�axioms:�!namely��*�,��the�three�examples����>discussed�Wab�Go���v�e,�.�and�the�lemma��x���+��s�(�y�[ٲ)��=��s�(�x�)���+��y�_0�pro���v�ed�as�the�induction����>step�UUof�the�asso�Gciativit���y�of�addition.����M�src:588induction.texThe���rst�part�of�the�pro�Gof�lists�the�axioms�that�are�used;��#w���e�list�that�part����>here:��ި��>�src:601induction.tex�1�?�[]�x+0=x.����>2�?�[]�x*0=0.����>3�?�[]�0*x=0.����>12�?�[]�x=x.����>15�?�[]�-ap(y,0)|ap(y,g(z,y))|ap(y,z).����>16�?�[]�-ap(y,0)|�-ap(y,s(g(z,y)))|ap(y,z).����>18�?�[]�x+y+z=�(x+y)+z.����>19�?�[]�x+y=y+x.����>20�?�[]�x*s(y)=x*y+x.����>21�?�[]�x+s(y)=s(x)+y.����>23�?�[]�m*n!=n*m.����M�src:604induction.tex�The��w���a�y�to�approac�h�an�Otter-���pro�Gof�b�y�induction�is�to�rst�lo�Gok�at�the����>��-terms.�{They�Xotell�y���ou�what�Otter-���has�decided�to�pro�v�e�b�y�induction.�{In����>this���case�the���-term�corresp�Gonding�to�the�main�induction�is��l�2`ambda�(�x;���x�`d���n�)�=����>�n�����x�),�iwhic���h�1�sa�ys�that�Otter-���is�going�to�pro�v�e��x�����n�6²=��n�����x��b���y�induction����>on�o��x�.���Then,��'using�a�text�editor,�replace�all�o�Gccurrences�of�the�Sk���olem�term����>�g�[ٲ(�l�2`ambda�(�x;���x��k���n���=��n��k���x�))�,�(and�terms�that�dier�from�it�only�b���y�renaming�the����>b�Gound���v��q�ariable��x�)�b���y�a�constan�t�c.��{That�exp�Goses�the�second�induction�in�this����>pro�Gof,���in���whic���h�Otter-lam�b�Gda�pro�v�es��s�(�c�)�R
���y�"�=���c����y���+��y�=²b�y���induction�on��y�[ٲ.�KNNo�w,����>using�a�text�editor,��replace�the�Sk���olem�term��g�[ٲ(�n;���l�2`ambda�(�y�;�s�(�c�)��]���y�"�=���c����y�6�+��y�[ٲ))����>b���y��aa�constan�t�b.���Finally��*�,���to�mak�e�the�pro�Gof�t�nicely�on�the�prin�ted�page,���w�e����>omit��the�names�of�the�inference�rules�used,�3lea���ving�only�the�line�n�um�b�Gers�of�the����>paren���ts��:to�indicate�the�deduction�steps.�uF��*�or�example,���the�rst�deduced�step�is����>shortened�UUfrom���S��>�src:612induction.tex�24�?�[binary,23.1,16.3,demod,beta,3,2,beta,unit_del,12]��������15������y�����?������>�s(c)*n!=n*s(c).����>�src:614induction.tex�to�UUsimply����>�src:618induction.tex�24�?�[23,16,3,2,12]�s(c)*n!=n*s(c).����>�src:620induction.tex�Here�UUare�the�deduced�steps�of�the�pro�Gof:����>�src:636induction.tex�24�?�[23,16,3,2,12]�s(c)*n!=n*s(c).����>25�?�[23,15,3,2l,12]�c*n=n*c.����>28�?�[25,20]�n*s(c)=c*n+n.����>54�?�[28,24]�s(c)*n!=c*n+n.����>125�?�[54,16,2,2,1,12]�s(c)*s(b)!=c*s(b)+s(b).����>126�?�[54,15,2,2,1,12]�s(c)*b=c*b+b.����>230�?�[126,20]�s(c)*s(b)=�(c*b+b)+s(c).����>877�?�[125,20]�s(c)*s(b)!=�(c*b+c)+s(b).����>1773�?�[230,18]�s(c)*s(b)=c*b+b+s(c).����>21899�?�[877,18]�s(c)*s(b)!=c*b+c+s(b).����>23692�?�[1773,19]�s(c)*s(b)=c*b+s(c)+b.����>89895�?�[21899,21]�s(c)*s(b)!=c*b+s(c)+b.����>89896�?�[89895,23692]�$F.����M�src:639induction.tex�Let�D*us�lo�Gok�at�this�line�b���y�line.�lThe�rst�t�w�o�lines�are�the�induction�step�to����>b�Ge�.�pro���v�ed.�d�The�base�case�has�already�b�Geen�dealt�with,�6awhic�h�mak�es�sense�since����>�x�]����0��=�0�g�is�one�of�P���eano's�axioms�and�w�e�also�ga�v�e�it�0�]����x���=�0.�"�The�g�next�t�w�o�lines����>apply�Ȗthe�denition�of�m���ultiplication,��fand�as�already�remark�ed,��fOtter-lam�b�Gda����>then��-\decides"�to�pro���v�e��-28�b���y�induction�on��n�.�lNLines�125�and�126�record�this����>\in���ten�tion",���stating�j�the�induction�step�to�b�Ge�pro���v�ed.�#�What�j�happ�ened�to�the�base����>case?��pThat�^�w���ould�b�Ge�0�?���s�(�c�)��v=��c�?���0�+�0.�Both�^�sides�ha���v�e�^�demo�Gdulated�to�zero����>and��Runit�deletion�has�remo���v�ed��Rthat�literal.�I�Line�230�app�Gears�to�b�e�a�clev���er�step:����>mak���e��the�left�side�of�126�matc�h�the�left�side�of�125�b�y�adding��s�(�c�)�to�b�Goth�sides����>and�9�then�using�the�denition�of�m���ultiplication�bac�kw�ards�to�collapse�the�left����>side.�Y[Of���course,���Otter-���has�no�suc���h�\in�ten�tion"|it�just�uses�paramo�Gdulation����>when�6�it�can,�oand�this�clause�turned�out�to�b�Ge�useful.��877�results�from�using����>the���denition�of�m���ultiplication�on�125,��1the�negated�goal�of�the�induction�step.����>A���t��this�p�Goin�t�a�h�uman�can�see�the�pro�Gof�coming:��w�e�just�need�to�manipulate����>the��origh���t-hand�sides�of�230�and�877�in�to�the�same�form.��The�next�lines�apply����>asso�Gciativit���y�<�of�addition�and�the�giv�en�fact�that��b�в+��s�(�c�)��=��s�(�b�)��+��c�<Ͳto�complete����>the�UUpro�Gof.����M�src:641induction.texWh���y��5did�it�tak�e�more�than�sixt�y�thousand�clauses�(with�the�original�input����>le)��@to�nd�the�last�step�of�this�pro�Gof��?�C�Because�it�to�ok�that�long�for�21899�to����>b�Gecome��the�giv���en�clause.�K�That�clause�has�w�eigh�t�14,��~and�there�are�lot�of�clauses����>of�(1that�w���eigh�t�(1or�smaller,�19but�part�of�the�problem�is�that�the�input�le�had,�for����>this��run,�q�pick���E�ff&f��ǫgiven���E�ff&f��ratio��set�to�4,�qso�that�ev���ery�fth�giv�en�clause�had�w�eigh�t����>20�ّor�so,���and�these�hea���vy�clauses�generated�a�lot�of�lo�w�er�w�eigh�t�clauses�that����>got�~�in�the�w���a�y��*�.��?Observing�~�that,��2and�observing�that�no�clauses�hea���vier�than�14�������16�����ՠy�����?������>�are�,_required,�4�I�,Uc���hanged�the�input�le,�remo���ving��pick���E�ff&f��ǫgiven���E�ff&f��ratio�,�and�,_setting����>max�����ff����w���eigh�t�b�to�14.��HThis�cut�the�running�time�from�17�min���utes�to�less�than�one����>min���ute,�UUand�decreased�the�n�um�b�Ger�of�generated�clauses�b�y�ab�Gout�40%.���6��>�T���ransitivit��y��of�Order��uT��>�src:645induction.tex�Order���is�dened�in�P��*�A��/b���y��x��c���y��]�i����9�z�p��(�x���+��z�X��=��c�y�[ٲ).�GSLam�b�Gda���logic�p�ermits����>treating�;1quan���tiers�as�op�Gerations�that�apply�to�prop�ositional�functions,�@kso�that����>�9�z�p�Ap�(�y�[�;���z��)�8�is�rendered�as��exists(lambda(z,Ap(y,z)))�;���hence�this�denition����>can�}�b�Ge�form���ulated�directly�in�lam�b�Gda�logic,���rather�than�requiring�a�Sk�olemiza-����>tion�E�rst,�H�as�w���ould�b�Ge�required�in�a�rst-order�pro�v�er.�l�W��*�e�sho�w�ho�w�Otter-���is����>able��$to�handle�this�kind�of�denition,��and�that�it�can�pro���v�e��$the�transitivit���y�of����>equalit���y���so�dened.�%Although�induction�is�not�required,��'some�inductiv�e�pro�Gofs����>in���v�olving��6order�are�discussed�b�Gelo���w,�oso�w�e�need�to�dev�elop�the�concept�of�order.����M�src:653induction.texIn�8�lam���b�Gda�logic,�q�the�existen�tial�quan�tier�is�represen�ted�b�y�a�constan�t��exists�,����>and�UUthe�t���w�o�UU\la�ws�of�existence"�are�as�follo�ws:����>�src:659induction.tex�-Ap(Z,w)�?�|�exists(lambda(x,�Ap(Z,x))).���%�first�law�of�existence����>-exists(lambda(x,Ap(Z,x)))�?�|�Ap(Z,�e(Z)).%�second�law�of�existence����M�src:662induction.tex�The��reader�will�recognize�these�la���ws�as�corresp�Gonding�to�the�usual�quan�tier����>axioms��_in�rst-order�logic:��۵e�(�Z���)�is�similar�to�a�\fresh"�v��q�ariable,�"ai.e.�]�one�that����>do�Ges���not�o�ccur�free�in�the�rest�of�the�clause.���Also,��ϵe�(�Z���)�is�similar�to�Hilb�ert's����>��-sym���b�Gol,�H]whic�h�Ehe�wrote��x:Z���(�x�),�and�means�\some��x��suc���h�that��Z���(�x�),�if�there����>is�<�one."�'�In�lam���b�Gda�logic,�v��exists��is�applied�to�predicates,�so��9�x�P�c��(�x�)�w���ould����>b�Gecome��q�Ap�(�9�;���x:�P�c��(�x�)),�bxor�p�Gerhaps��Ap�(�9�;�x:�Ap�(�P�G;�x�),�bxif��P�]�is�considered�a����>constan���t�UUinstead�of�a�predicate.�q�(Both�are�p�Gossible�in�lam�b�Gda�logic.)����M�src:668induction.texNo���w���the�denition�of��n�����m��ʲfor�in�tegers��n��and��m��can�b�Ge�expressed�this�w�a�y:����>�src:673induction.tex�-(x�?�<=�y)�|�exists(lambda(z,x�+z=�y)).����>-exists(lambda(z,x+z�?�=�y))�|�x�<=�y.����M�src:676induction.tex�These��form���ulae,���together�with�P�eano's�axioms�in�the�form�used�in�the�previ-����>ous�g>examples,�k�and�the�asso�Gciativit���y�of�addition,�go�in��list(usable)�.���Then�w���e����>giv���e�UUOtter-���the�goal�of�pro�ving�the�transitivit�y�of�equalit�y�as�follo�ws:����>�src:687induction.tex�list(sos).����>a�?�<=�b.����>b�?�<=�c.����>-(a�?�<=�c).����>end_of_list.����M�src:689induction.tex�It��qturns�out�that�induction�is�not�needed�for�the�pro�Gof,��8since�w���e�supplied�the����>asso�Gciativit���y�+)of�addition.�c�Here�is�the�pro�of�it�nds,�3�whic���h�corresp�onds�nicely�to����>the�UUnatural�pro�Gof:�������17������y�����?������>�src:711induction.tex�8�?�[]�-Ap(Z,w)|exists(lambda(x,Ap(Z,x))).����>9�?�[]�-exists(lambda(x,Ap(Z,x)))|Ap(Z,e(Z)).����>11�?�[]�-(x<=y)|exists(lambda(z,x+z=y)).����>12�?�[]�-exists(lambda(z,x+z=y))|x<=y.����>13�?�[]�(x+y)+z=x+y+z.����>14�?�[]�a<=b.����>15�?�[]�b<=c.����>16�?�[]�-(a<=c).����>17�?�[binary,14.1,11.1]�exists(lambda(x,a+x=b)).����>19�?�[binary,15.1,11.1]�exists(lambda(x,b+x=c)).����>21�?�[binary,16.1,12.2]�-exists(lambda(x,a+x=c)).����>31�?�[binary,17.1,9.1,demod,beta]�a+e(lambda(x,a+x=b))=b.����>33�?�[binary,19.1,9.1,demod,beta]�b+e(lambda(x,b+x=c))=c.����>36�?�[binary,21.1,8.2,demod,beta]�a+x!=c.����>40�?�[para_into,36.1.1,13.1.2]�(a+x)+y!=c.����>367�?�[para_into,33.1.1.1,31.1.2]����R��(a+e(lambda(x,a+x=b)))+e(lambda(y,b+y=c))=c.����>368�?�[binary,367.1,40.1]�$F.���6��>�T���ric��hotom�y��of�Order��uT��>�src:714induction.tex�Con���tin�uing���with�the�theory�of�order,�ȴthe�next�natural�theorem�to�pro���v�e���is�the����>tric���hotom�y��Ola�w:��it�is�con�tradictory�to�assume��a�Gc���b��and��b����a��and��a��6�=��b�.�X�F��*�or����>this���problem,��the�input�le�assumes�(as�w���ell�as�induction�and�the�denition�of����>addition):��the���asso�Gciativit���y�of�addition,��xthe�\la�ws�of�existence",��xand�t�w�o�more����>facts:�V if��x��F�+��y�"�=���x��then��y��=��0,�)and�if��x��F�+��y�"�=��0�then��y��=��0.�_XThese�are�expressed����>in��the�input�le�as�follo���ws,�with�line�n�um�b�Gers�from�the�pro�of�for�later�reference:����>�src:723induction.tex�18�?�x+y!=x�|�y=0.����>20�?�x+y!=0�|�y=0����M�src:726induction.tex�Of��	course,��these�can�b�Ge�pro���v�ed��	in�turn�b���y�induction,�but�the�p�Goin���t�of�this����>example�'kis�the�correct�manipulation�of�a�denition�that�in���v�olv�es�'k"there�exists",����>so�UUw���e�just�put�those�needed�extra�form�ulas�in.����M�src:728induction.texThe��hpro�Gof,��informally��*�,�go�es��hlik���e�this.�Q#Since��a�����b�,��that��hmeans�there�exists�an����>�x���suc���h�that��a�i�+��x���=��b�.�?�Fix��suc�h�an��x�,��%call�it��e�1.�?�Then��a�i�+��e�1��=��b�.�Similarly��*�,��%since����>�b������a�,��there���exists�an��x��suc���h�that��b���+��x����=��a�.��VFix���suc�h�an��x�,��call�it��e�2.��VThen����>�b����+��e�2��j=��a�.�ϏTherefore���(�a����+��e�1)�+��e�2��j=��a�.�By���asso�Gciativit���y��*�,���a����+�(�e�1�+��e�2)��j=��a�.����>Then���b���y�18,����e�1�j�+��e�2�CV=�0.�QkBy���20,��e�1�=�0.�QkThen���b��=��a�j��+��e�1�CV=��a�j��+�0�CV=��a�.�That����>con���tradicts�UU�a���6�=��b�,�and�completes�the�pro�Gof.����M�src:739induction.texHere���is�the�pro�Gof�that�Otter-���nds�(with�the�names�of�the�inference�rules����>remo���v�ed):����>�src:767induction.tex�?��[]�x+0=x.����>2�?�[]�(x+y)+z=x+y+z.����>11�?�[]�-exists(lambda(x,Ap(Z,x)))|Ap(Z,e(Z)).��������18�����h�y�����?������>�16�?�[]�-(x<=y)|exists(lambda(z,x+z=y)).����>18�?�[]�x+y!=x|y=0.����>20�?�[]�x+y!=0|y=0.����>21�?�[]�a<=b.����>22�?�[]�b<=a.����>23�?�[]�a!=b.����>24�?�[21,16]�exists(lambda(x,a+x=b)).����>26�?�[22,16]�exists(lambda(x,b+x=a)).����>31�?�[24,11,demod,beta]�a+e(lambda(x,a+x=b))=b.����>32�?�[26,11,demod,beta]�b+e(lambda(x,b+x=a))=a.����>35�?�[31.1.1,18.1.1]�b!=a|e(lambda(x,a+x=b))=0.����>58�?�[32.1.1.1,31.1.2,demod,2]����b��a+e(lambda(x,a+x=b))+e(lambda(y,b+y=a))=a.����>66�?�[32.1.2,23.1.1]�b+e(lambda(x,b+x=a))!=b.����>91�?�[35.2.1,31.1.1.2,demod,1]�a=b|b!=a.����>94�?�[91.1.1,32.1.2]�b+e(lambda(x,b+x=a))=b|b!=a.����>275�?�[58,18]�e(lambda(x,a+x=b))+e(lambda(y,b+y=a))=0.����>820�?�[94,66]�b!=a.����>823�?�[820.1.1,31.1.2]�a+e(lambda(x,a+x=b))!=a.����>1308�?�[275,20]�e(lambda(x,b+x=a))=0.����>1321�?�[1308.1.1,58.1.1.2.2,demod,1]�a+e(lambda(x,a+x=b))=a.����>1322�?�[321.1,823.1]�$F.����M�src:770induction.tex�The��pro�Gof�uses�the�\second�la���w�of�existence"�to�formalize�the�line�\Fix�suc�h����>an�8�x�,�q�call�it��e�1."��In�the�Otter-���pro�Gof,�instead�of��e�1�it�is�called��e(lambda(x,a+x=b))�.����>The��|pro�Gof�lo�oks�quite�natural,��but�app�earances�are�deceptiv���e:�&it�w�as�not�easy����>to��get�Otter-���to�nd�this�pro�Gof.�Z�If�I��had�c���heated�b�y�lea�ving�out�the�rst�la�w�of����>existence,��
it���w���ould�ha�v�e�b�Geen�quite�easy��*�,��
but�the�rst�la�w�of�existence�is�there����>in��^the�input�le,���ev���en�though�it�is�not�used�in�the�pro�Gof.��A�t�rst,���it�generated����>lots���of�useless�conclusions,��that�sw���amp�Ged�Otter-���in�a�sea�of�nested��exists��and����>�lambda�'��terms,�\
and�prev���en�ted�'�the�pro�Gof�from�b�eing�found.��GIn���tuitiv�ely��*�,�\
it�'�rea-����>soned�<�lik���e�this:�enSa�y�it�deriv�ed�2�}+�2��=�4.�i�W��*�ell�<�then,�A�there�exists�an��x��suc�h�that����>2���+�2��=�4.�f�And�4Gthere�exists�a��y�� �suc���h�that�there�exists�an��x��suc�h�that�2���+�2��=�4.����>And�Ithere�exists�a��z����suc���h�that�there�exists�a��y��޲suc�h�that�there�exists�an��x��suc�h����>that��u2��J+�2�ӡ=�4.�U&And�so�on,��un���til��max���E�ff&f��ǫweight��is�exceeded.�But�b���y�that�time,����>ev���en��with�a�relativ�ely�lo�w��max���E�ff&f��ǫweight�,�
�enough�conclusions�ha�v�e�b�Geen�generated����>to�UUclog�up�the�w���orks,�sp�Gecically�to�clog�up�the�set�of�supp�ort.����M�src:773induction.texThe���solution�to�this�dicult���y�is�to�tell�Otter-���to�discard�conclusions�with����>nested���exists��or�nested��lambda�.��Luc���kily��*�,�
Otter�(and�hence�Otter-��)�has�a����>mec���hanism��:for�doing�that�(a�v��q�ailable�since�Otter�v�ersion�3.0.3,�
sApril�1994).�$uIt����>uses��the�syn���tax��$dots��to�giv�e�the�un�w�an�ted�nested�terms�a�w�eigh�t�greater�than����>�max���E�ff&f��ǫweight�,�UUwhic���h�will�cause�them�to�b�Ge�discarded.����M�src:775induction.texWh���y���is�it�\c�heating"�to�just�omit�the�rst�la�w�of�existence�from�the�input�le,����>and���not�\c���heating"�to�put�in�a�directiv�e�to�eliminate�its�un�w�an�ted�consequences?����>Because�the�p�Goin���t�of�the�example�is�to�sho�w�ho�w�to�w�ork�with�existence�and����>its�Fla���ws�using�lam�b�Gda�unication�plus�standard�rst-order�tec�hnques.�[mA�5h�uman�������19����	S�y�����?������>�do�Ges�ipnot�get�sidetrac���k�ed�ipmaking�useless�deductions�as�illustrated,�nwprecisely�b�e-����>cause��\s/he�can�recognize�them�as�useless.�?�The�directiv���e�in�question�tells�Otter-�����>�that��conclusions�of�a�certain�form�are�going�to�b�Ge�useless.�P�This�kind�of�directiv���e����>is���a�standard�tec���hnique�when�using�Otter,��Uso�w�e�are�simply�sho�wing�that,��Uit�is����>all��2righ���t�to�include�the�lam�b�Gda�axioms�for�\there�exists",��9b�ecause�standard�tec���h-����>niques��from�rst-order�pro���ving�can�b�Ge�applied�to�con�trol�un�w�an�ted�conclusions,����>also�UUin�this�new�setting.���Z��B��More��inductiv��e�pro�`ofs�in�v�olving�order��uT��>�src:780induction.tex�The�[�next�example�is�this�theorem:�~w�a�ѫ���0��!��a��=�0.���Otter-��[��is�able�to�automat-����>ically�>�nd�an�inductiv���e�pro�Gof.�jEHere�is�a�sk�etc�h�of�the�pro�Gof:�f�First,�COOtter-���uses����>the��\la���ws�of�existence",��applied�to��a��|���0,�to��deduce��a����+��e�(�l�2`ambda�(�x;���a��+��x��|�=����>0))��=�0.�PEThen���pro���v�es��a�oղ+��n���6�=�0�b���y�induction�on��n�.�PEThe�base�case�is�the�negated����>goal���a��e�6�=�0.�? F��*�or�the�induction�step,��if��a��e�+��s�(�n�)��e=�0,��then�b���y�the�denition�of����>addition,�UU�s�(�a�8�+��n�)��=�0,�con���tradicting�one�of�P�eano's�axioms.����M�src:786induction.texThe�A�pro�Gof�pro�duced�b���y�Otter-���is�quite�succinct:�g�the�en�tire�induction�argu-����>men���t�UUtak�es�place�in�one�hea�vily-annotated�step,�line�18�b�Gelo�w:��R���>�src:801induction.tex�1�?�[]�a!=0.����>3�?�[]�s(x)!=0.����>6�?�[]�ap(y,0)|ap(y,s(g(y)))|�-ap(y,z).����>9�?�[]�-exists(lambda(x,ap(Z,x)))|ap(Z,e(Z)).����>11�?�[]�x+0=x.����>12�?�[]�x+s(y)=s(x+y).����>13�?�[]�(u<=v)=exists(lambda(x,u+x=v)).����>14�?�[]�a<=0.����>16�?�[14,demod,13]�exists(lambda(x,a+x=0)).����>17�?�[binary,16.1,9.1,demod,beta]�a+e(lambda(x,a+x=0))=0.����>18�?�[binary,17.1,6.3,demod,beta,11,beta,12,unit_del,1,3]�$F.��
B��M�src:804induction.tex�A�UUmore�dicult�theorem�in���v�olving�UUorder�is������G�a�����s�(0)��!��a��=�0�8�_��a���=��s�(0)�:����>�src:806induction.tex�This�
Vis�an�imp�Gortan���t�principle�ab�out�the�ordering�on�the�in���tegers,�;Woften�used����>in�<(the�pro�Gofs�of�more�complicated�inequalities.�&@The�pro�of�(from�nothing�but����>induction,��the���denitions�of�addition�and�successor,�and�the�denition�of���)�can����>b�Ge�UUfound�on�the�Otter-���w���ebsite�[�7��]����M�src:868induction.texOur�Ӌnext�example�sho���ws�ho�w�Otter-���can�w�ork�with�inequalities�and�a�func-����>tion�UUdened�b���y�recursion.�q�Otter-���can�pro�v�e�����B@�s�(0)���<�a��!��n�<�a�����n��q~�:����>�src:871induction.tex�The�m�axioms�used�in�the�pro�Gof�are�induction,�� the�denition�of�m���ultiplication,����>the�߲recursion�equations�for�exp�Gonen���tiation,�BHplus�sev�eral�other�lemmas�(lines����>13,19{21,22,�F�and�C'28).�k�These�lemmas�w���ere�c�hosen�b�y�seeing�what�is�needed�in�a�������20������y�����?������>�hand-constructed���pro�Gof.�Q�Otter-���is�not�able�to�pro���v�e���this�theorem�from�P���eano's����>axioms���and�the�recursion�equations�for�exp�Gonen���tiation�alone.�	@Of�course,��rw�e����>do�N6exp�Gect�that�at�some�p�oin���t�this�will�happ�en:�c�w���e�don't�exp�ect�to�pro���v�e�N6all����>theorems�UUdirectly�from�P���eano's�axioms,�w�e�exp�Gect�to�use�lemmas.����>�src:896induction.tex�2�?�[]�x*0=0.����>5�?�[]�x^s(y)=x*x^y.����>9�?�[]�-ap(y,0)|ap(y,g(y))|ap(y,z).����>10�?�[]�-ap(y,0)|�-ap(y,s(g(y)))|ap(y,z).����>13�?�[]�-(u<v)|x*u<x*v|�-(0<x).����>15�?�[]�0<s(0).����>17�?�[]�0<a.����>19�?�[]�x<y|y<=x.����>20�?�[]�-(y<=x)|�-(x<y).����>21�?�[]�-(u<v)|�-(v<=w)|u<w.����>22�?�[]�-(s(0)<z)|�-(0<y)|s(y)<=z*y.����>24�?�[]�-(x<=0)|x=0.����>25�?�[]�s(0)<a.����>26�?�[]�x*s(y)=x*y+x.����>28�?�[]�0+x=x.����>29�?�[]�x^0=s(0).����>30�?�[]�-(n<a^n).����M�src:899induction.tex�Here�UUis�the�rest�of�the�pro�Gof,�with�the�inductiv���e�Sk�olem�term����M�g(lambda(x,x<a^x))�UU�replaced�b���y�a�constan�t��c�:����>�src:914induction.tex�32�?�[binary,30.1,10.3,demod,beta,29,beta,5,unit_del,15]�-(s(c)<a*a^c).����>33�?�[binary,30.1,9.3,demod,beta,29,beta,unit_del,15]�c<a^c.����>35�?�[hyper,33,13,17]�a*c<a*a^c.����>37�?�[binary,32.1,19.1]�a*a^c<=s(c).����>41�?�[hyper,37,21,35]�a*c<s(c).����>42�?�[binary,41.1,20.2]�-(s(c)<=a*c).����>45�?�[binary,42.1,22.3,unit_del,25]�-(0<c).����>46�?�[binary,45.1,19.1]�c<=0.����>52�?�[binary,46.1,24.1]�c=0.����>67�?�[para_from,52.1.1,32.1.2.2.2,demod,29,26,2,28]�-(s(c)<a).����>76�?�[para_from,52.1.2,25.1.1.1]�s(c)<a.����>77�?�[binary,76.1,67.1]�$F.��!č�>�Inductiv���e�ffpro�s3ofs�in�v�olving�non-in�teger�v���ariables�����>�src:917induction.tex�Real�v�mathematics�often�in���v�olv�es�v�pro�ving�theorems�that�con�tain�some�v��q�ariables����>ranging�9�o���v�er�real�n�um�b�Gers,�?or�o�v�er�mem�b�Gers�of�an�algebraic�structure�suc�h�as�a����>group�ƚor�ring,���and�other�v��q�ariables�ranging�o���v�er�ƚin�tegers.�ŕThe�fact�that�Otter-����>�l�2`ambda��_�is�not�based�on�a�xed�t���yp�Ge�system�helps�it�to�b�e�able�to�deal�with�suc���h�������21����#y�y�����?������>�problems.�i�On�<�the�other�hand,�A�since�lam���b�Gda�logic�and�Otter-���are�un�t�yp�Ged,�A�the����>question�bsarises�as�to�whether�the�resulting�pro�Gofs�(if�an���y)�can�b�e�mapp�ed�bac���k����>in���to�)va�t�yp�Ged�logic.�c(That�is,�2=are�w�e�guaran�teed�that�the�pro�Gofs�Otter-���nds�are����>correctly�UUt���yp�Geable?����M�src:924induction.texThe�fmetho�Gd�used�to�answ���er�this�question�is�called��implicit���typing�.��FIt�w�orks����>lik���e�Ywthis:�zAssume�that�all�the�predicate�and�function�sym�b�Gols�(including�the����>constan���ts)�3�in�a�giv�en�input�le�can�b�Ge�giv�en�t�yp�Ge�sp�ecications,�:�b���y�sp�ecifying�a����>t���yp�Ge��Tfor�eac�h�argumen�t�p�Gosition�and�a�\v��q�alue�t�yp�Ge"�for�the�v��q�alue�of�constan�ts����>and��yfunctions.�t3Predicates�ha���v�e��yv��q�alue��b��}'o�ole�an�.�The��yv��q�ariables�are�not�t���yp�Ged.����>Eac���h��^predicate�and�function�sym�b�Gol�m�ust�ha�v�e�a��unique��t�yp�Ge,��except��Ap��and����>�l�2`ambda�,��and��Uthey�can�ha���v�e��Uonly�t���w�o��Ut�yp�Ges:��one�for�use�when��Ap��is�applied�to����>prop�Gositional��{functions�to�pro�duce�prop�ositions,�%and�one�for�when��Ap��is�used����>to��apply�to�ob��8jects�of�some�\ground�t���yp�Ge"�and�pro�duce�other�ob��8jects�of�ground����>t���yp�Ge.�,�Under�>>those�assumptions,�xxthe�pro�ofs�pro�duced�b���y�Otter-���will�also�b�e����>correctly���t���ypable.��^Detailed�form�ulations�and�pro�Gofs�of�metatheorems�with�this����>imp�Gort�UUare�in�[�5��].���z��>�No��nilp�`oten��ts�in�an�in�tegral�domain��uT��>�src:935induction.tex�An�4��inte��}'gr�al�a�domain��is�a�ring��R�H��in�whic���h��xy����=�;�0�implies��x��=�0�or��y����=�0.��A����>�nilp��}'otent��J�is�a�nonzero�elemen���t�of��R���suc�h�that��x���^��n��	-�=���0�for�some��n�,��where��x���^��n��	EȲis����>dened��b���y��x���^��o��9��=��1�and��x���^��n�+1��X��=��x�J!���x���^��n��q~�,���where���o��is�the�zero�of�the�natural�n���um�b�Gers����>and�vv1�is�the�unit�elemen���t�of��R�Dz.��*The�theorem�in�question�here�is�that�there�are����>no�UUnilp�Goten���ts�in�an�in�tegral�domain.�q�Here�is�Otter-��'s�pro�Gof�of�this�theorem:�����>�src:954induction.tex�27�?�[]�1!=0.����>28�?�[]�x*y!=0|x=0|y=0.����>30,29�?�[]�pow(s(x),y)=y*pow(x,y).����>32,31�?�[]�pow(o,x)=1.����>35�?�[]�ap(x,o)|�-ap(x,g(y,x))|�-ap(x,y).����>36�?�[]�ap(x,o)|ap(x,s(g(y,x)))|�-ap(x,y).����>37�?�[]�b!=0.����>39�?�[]�pow(n,b)=0.����>41�?�[binary,39.1,36.3,demod,beta,32,beta,30,unit_del,27]����M��b*pow(g(n,lambda(x,pow(x,b)=0)),b)=0.����>43�?�[binary,39.1,35.3,demod,beta,32,beta,unit_del,27]����M��pow(g(n,lambda(x,pow(x,b)=0)),b)!=0.����>136�?�[binary,41.1,28.1,unit_del,37,43]�$F.�����>�src:956induction.tex�This�W�is�not�alleged�to�b�Ge�a�particular�in���teresting�pro�of�for�its�o���wn�sak�e,�Xpthough����>it���is�satisfying�that�Otter-���pro���v�es���it�so�cleanly��*�.��BThe�reason�for�including�this����>example�WZis�that�it�in���v�olv�es�WZt�w�o�t�yp�Ges�(or�\sorts"):�u�the�t�yp�Ge�of�natural�n�um�b�Gers����>and�$jthe�t���yp�Ge�of�ring�elemen�ts.��In�addition,�X0the�induction�axiom�in�v�olv�es�the����>t���yp�Ge�U�of�prop�ositional�functions�on�in���tegers.�s�It�therefore�illustrates�the�situa-����>tion��addressed�b���y�the�implicit�t�yping�theorem.�
 Sp�Gecically:��Xho�w�can�w�e�b�Ge����>assured��that�an�Otter-���pro�Gof�of�the�no-nilp�oten���ts�theorem�is�actually�correctly�������22����,��y�����?������>�t���yp�Geable?�{�There��are�three�w�a�ys:�#(1)�W��*�e�could�examine�the�pro�Gof�once�it�is�in����>hand���(either�b���y�hand�or�mec�hanically).�AA(2)�W��*�e�could�include��set(types)��in�the����>input�T�le,�T�and�replace�one�of�the�t���w�o�T�constan�ts��o��and�0�b�y�a�function�term,�T�for����>example�"�o���=��r�G�(0)�(since�the�metatheorem�in�[�5��]�requires�that�all�constan���ts�ha�v�e����>the���same�t���yp�Ge).�BN(3)�W��*�e�could�include��list(types)��in�the�input�le,��fand�sp�ecify����>�type(o,R)�]�and���type(0,N)�.�Both�(2)�and�(3)�are�done�b�Gefore�w���e�run�Otter-�����>�and�UUapply�to�an���y�p�Gossible�Otter-���pro�of�from�that�input�le.��!č�>�Pro�s3ofs�ffb���y�induction�in�v�olving�simplication�����>�src:971induction.tex�W��*�e��Jha���v�e�also�added�to�Otter�the�abilit�y�to�mak�e�use�of�an�external�computation����>system;��"that�Ɉof�course�is�dangerous�in�general�b�Gecause�of�the�p�ossibilit���y�that�the����>computation�-ma���y�dep�Gend�on�assumptions�that�are�not�v��q�alid�at�the�p�oin���t�where����>the��computation�is�applied.���Otter-���is�link���ed�to�the�computation�mo�Gdules�of����>MathXp�Gert��a[�6��],��dwhic���h�do�not�suer�from�this�defect.���This�enables�us�to�pro�v�e����>theorems�]#b���y�induction�in�whic�h�the�induction�step�in�v�olv�es�some�computation.����>These�UUsteps�app�Gear�in�the�Otter�pro�of�with�the�justication��Simplify�.����M�src:974induction.texThis�e�feature�is�indep�Genden���t�(with�regard�to�the�implemen�tation)�of�lam�b�Gda����>unication,��oin��5the�sense�that�w���e�could�easily�compile�a�v�ersion�with�only�lam�b�Gda����>unication,�[or�Y�only�external�computation�link��q�age.��Both�are�presen���t�in�Otter-��,����>but�_hcan�b�Ge�indep�enden���tly�activ��q�ated�b�y�switc�hes�in�the�input�le:����set(lambda)����>�turns�
�on�lam���b�Gda-unication�and��set(simplify)��turns�on�external�simplica-����>tion.����M�src:978induction.texCom���bining���external�simplication�with�lam�b�Gda�unication�is�in�teresting�in����>the���con���text�of�mathematical�induction,��since�it�enables�Otter-���to�handle�the����>examples��+of�pro�Gof�b���y�induction�that�are�usually�giv�en�to�studen�ts�learning�math-����>ematical�K�induction.�n�W��*�e�will�sho���w�some�examples�of�suc�h�pro�Gofs�in�this�section.���6��B��Gauss's��sum��uT��>�src:983induction.tex�This�UUis�the�form���ula�that�Gauss�supp�Gosedly�redisco�v�ered�at�age�12:��uX�������ȭB�n��������������u

cmex10�X�������7�k�+B�=1����r�k���=�����<$���K�n�(�n�8�+�1)���K�w�fe%1�	(֍��2�����*.��:���捑>�src:985induction.tex�Here�UUis�the�pro�Gof�found�b���y�Otter-��,�after�replacing�the�Sk�olem�term����>�src:989induction.tex�g(lambda(y,2*sum(z,z,0,y)=y*�?�(y+1)))����>�src:993induction.tex�b���y�UUa�constan�t��c��to�impro�v�e�the�readabilit�y�of�the�pro�Gof:����>�src:1010induction.tex�2�?�[]�sum(u,v,x,x)=Ap(lambda(u,v),x).����>4�?�[]�sum(u,v,x,y+1)=sum(u,v,x,y)+Ap(lambda(u,v),1+y).����>7�?�[]�x+1!=y+1|x=y.����>8�?�[]�-Ap(y,0)|Ap(y,g(y))|Ap(y,z).����>9�?�[]�-Ap(y,0)|�-Ap(y,g(y)+1)|Ap(y,z).��������23����:ˠy�����?������>�10�?�[]�2*sum(x,x,0,n)!=n*�(n+1).����>11�?�[binary,10,9,demod,beta,2,beta,beta,4,beta,simplify]����r�2*�?�(sum(x,x,0,c)+1+c)!=�(1+c)*�(2+c).����>12�?�[binary,10,8,demod,beta,2,beta,beta,simplify]����r�2*sum(x,x,0,c)=�?�(1+c)*c.����>22�?�[binary,11,7,simplify]����r�2*c+2*sum(x,x,0,c)!=3*c+c^2.����>29�?�[para_into,22,12,simplify]�$F.��7��M�src:1013induction.tex�The�.�rst�v���e�form�ulas�are�axioms.�d�F��*�orm�ula�(10)�is�the�negation�of�the�goal.����>F��*�orm���ula�F�(12)�is�recognizable�as�the�induction�h�yp�Gothesis�and�(11)�as�the�negation����>of��what�has�to�b�Ge�pro���v�ed��in�the�induction�step;��Unote�that�the�sum�up�to��c�eR�+�1����>has���already�b�Geen�split�b���y��simplify��in�to�the�sum�up�to��c��and�the��c�tR�+�1-st���term.����>No���w,��(11)���needs�to�b�Ge�further�simplied�b�y�m�ultiplying�out�the�righ�t-hand�side.����>But���simplify��hasn't�already�done�that�to�(11)�since�it�will�only�m���ultiply�out�a����>pro�Gduct��of�sums�if�it�o�ccurs�as�a�summand�of�another�sum.��tSo�instead,�M(11)����>is��Presolv���ed�with�(7),��Owhic�h�in�eect�adds�1�to�b�Goth�sides�of�(11).�	�No�w�on�the����>righ���t�~�w�e�ha�v�e�(1��++��c�)����(2�+��c�)�+�1,��#so��simplify��will�m���ultiply�out�and�collect����>terms.�}�Then�Y?there�is�a�constan���t�term�3�on�b�Goth�sides,�Z9whic�h��simplify��subtracts����>from�bb�Goth�sides.��The�result�is�form���ula�(22).�But�in�this�form���ula,�eKthe�induction����>h���yp�Gothesis�&�(12)�o�ccurs�as�a�subform���ula,�03so�it�can�b�e�used�(b���y�paramo�dulation).����>The��(resulting�left-hand�side�then�simplies�to�b�Ge�iden���tical�to�the�righ�t-hand����>side,�UUso�it�resolv���es�with��x���=��x�UU�to�pro�Gduce�a�con�tradiction.����M�src:1021induction.texOtter-��UU�has�no�trouble�pro���ving�the�form�ula���؍�������n��n�������������X���������k�+B�=1������k��P�����2���"�=�����<$���K�n�(�n�8�+�1)(2�n��+�1)���K�w�feIɟ	(֍�"�6�����N/G�:��if��>�src:1023induction.tex�in�UUa�similar�fashion.��!���>�Bernoulli's��inequalit��y��uT��>�src:1027induction.tex�This�UUis�the�inequalit���y��p����
�1�8�+��na�����(1�8�+��a�)�����n���q��if�UU��1���<�a��B�:����>�src:1029induction.tex�Otter-����successfully�pro���v�es���this�b���y�induction�on��n�.�<�This�example�is�of�particular����>in���terest�UUfor�sev�eral�reasons:����M�src:1032induction.tex(i)���It�in���v�olv�es���t�w�o�t�yp�Ges:��reals�and�natural�n�um�b�Gers.�3,In�order�to�form�ulate����>this�Fmtheorem�in�suc���h�a�w�a�y�that�the�axioms�can�b�Ge�correctly�t�yp�Ged,�Ihso�that�the����>soundness��theorems�of�[�5��]�will�apply��*�,�BWw���e�m�ust�use�a�function�sym�b�Gol��i��for�an����>injection��i���:��N��3�!��R�Dz.�U]W��*�e�use��o��for�the�zero�in��N�3�and�0�=��i�(�o�)�for�the�zero�in��R�Dz.����^��6����>���ff��v�	J=�����"5��-:�6����LܻT��J�ec�Îhnically�,��Gif�r�w�e�w�an�t�the�soundness�theorem�to�apply�� #�f�cmti8�a���priori��to�an�y�pro�<rof�that�Otter-���	���migh�Ît��nd,���w�e�should�not�use�0�at�all,���but�only��i�(�o�);���and�indeed�if�w�e�mak�e�that�replacemen�t,���the�bUpro�<rof�will�still�b�e�found;���but�w�Îe�can�also�simply�observ�e�that�if�w�e�do�use�0,���the�pro�<rof���that��Xis�found�is�in�fact�correctly�t�Îyp�<red.��������24����GРy�����?������M�src:1041induction.tex�(ii)�q�It�oers�an�in���teresting�in�terpla�y�b�Get�w�een�algebra�p�Gerformed�b�y�MathX-����>p�Gert���(external�simplication)�and�algebra�p�erformed�in�the�clausal�searc���h�sys-����>tem,��2since�~�at�some�p�Goin���t�a�la�w�of�exp�Gonen�ts�has�to�b�Ge�used�in�the�opp�osite����>direction�from�whic���h�simplication�uses�it.�W\This�is�p�Gerformed�b�y�demo�Gdulation.����M�src:1045induction.tex(iii)�\�Simplication�is�p�Gerformed�not�only�on�terms�of�t���yp�e��N�t�or��R�Dz,�^�but�also����>on�UUterms�of�t���yp�Ge�\prop�osition",�sp�ecically�inequalities.����M�src:1049induction.texHere�8�is�the�pro�Gof,�q�with�the�Sk���olem�term��g(lambda(x,a*i(x)+1<=�?�(a+1)^x))����>�replaced�UUb���y�a�constan�t��c��for�readabilit�y��*�.����>�src:1098induction.tex�2�?�[]�x<=x.����>3�?�[]�x+1!=0.����>7�?�[]�-ap(y,o)|ap(y,g(y))|ap(y,z).����>8�?�[]�-ap(y,o)|�-ap(y,s(g(y)))|ap(y,z).����>10�?�[]�-(x<y)|�-(z<=x)|z<y.����>12�?�[]�-(x<=y)|�-(y<x).����>13�?�[]�0<a+1.����>17�?�[]�-(x<=y)|�-(0<z)|z*x<=y*z.����>19�?�[]�-(x<y)|x+�-y<0.����>22�?�[]�x^o=1|x=0.����>23�?�[]�0<=i(x).����>25�?�[]�i(o)=0.����>26�?�[]�i(s(x))=i(x)+1.����>27�?�[]�x^s(y)=x*x^y.����>28�?�[]�x*0=0.����>30�?�[]�0+x=x.����>33�?�[]�x^�(y+z)=x^y*x^z.����>34�?�[]�x^1=x.����>35�?�[]�-(1+i(n)*a<=�(1+a)^n).����>36�?�[simplify,35]�(a+1)^n<a*i(n)+1.����>41�?�[binary,36,12]�-(a*i(n)+1<=�(a+1)^n).����>43�?�[binary,41,8,demod,beta,25,28,30,beta,26,27]����X?�-(1<=�?�(a+1)^o)|�-(a*�(i(c)+1)+1<=�(a+1)*�(a+1)^c).����>44�?�[binary,41,7,demod,beta,25,28,30,beta]����X?�-(1<=�?�(a+1)^o)|a*i(c)+1<=�(a+1)^c.����>85�?�[para_into,43,22,unit_del,2,3]����X?�-(a*�?�(i(c)+1)+1<=�(a+1)*�(a+1)^c).����>117�?�[para_into,44,22,unit_del,2,3]����X?�a*i(c)+1<=�?�(a+1)^c.����>119�?�[hyper,117,17,13]����X?�(a+1)*�?�(a*i(c)+1)<=�(a+1)^c*�(a+1).����>160�?�[para_into,43,22,unit_del,2,3,simplify,85,demod,33,34]����R��(a+1)^c*�?�(a+1)<a*i(c)+a+1.����>298�?�[hyper,119,10,160]����R��(a+1)*�?�(a*i(c)+1)<a*i(c)+a+1.����>299�?�[binary,298,19]����R��(a+1)*�?�(a*i(c)+1)+�-(a*i(c)+a+1)<0.��������25����Up�y�����?������>�398�?�[binary,298,19,simplify,299]����X?�and(a!=0,i(c)<0).����>404�?�[split�and,398]����X?�i(c)<0.����>412�?�[binary,404,12]����X?�-(0<=i(c)).����>413�?�[binary,412,23]�$F.����M�src:1101induction.tex�Let�d�us�go�o���v�er�d�this�pro�Gof.���First�(at�36),�hcthe�negated�goal�is�simplied�to�an����>inequalit���y��*�.��OThe�m�next�t�w�o�steps,�s�43�and�44,�represen���t�the�\decision"�to�attempt����>to�Y�pro���v�e�this�inequalit�y�b�y�induction.�The�next�t�w�o�steps�tak�e�care�of�the�base����>case,���so���that�85�and�117�are�recognizable�as�the�induction�step�and�the�induction����>h���yp�Gothesis,�?mresp�ectiv�ely��*�.�h�Hyp�othesis�9�17�sa�ys�that�w�e�can�m�ultiply�b�Goth�sides�of����>an�;&inequalit���y�b�y�the�same�p�Gositiv�e�quan�tit�y;��line�119�is�deduced�b�y�applying����>that,�tAusing�nthe�p�Gositiv���e�quan�tit�y��a�I^�+�1.���Line�n160�is�deduced�from�line�43�m�uc�h����>as�ɺ117�w���as,���but�going�further:�Z�the�la�w�33,���that�is,��x���^��y�@L�+�z�����=���x���^��y��T����x�x���^��z�����,�is�applied.����>Simplication�<�uses�this�la���w�in�the�righ�t-to-left�direction,�A�so�160�w�ould�nev�er�b�Ge����>deduced�t�b���y�simplication�alone;���here�it�is�deduced�b�y�using�33�as�a�demo�Gdulator.����>This�4�is�an�imp�Gortan���t�in�terpla�y�b�Get�w�een�simplication�(whic�h�has�a�tendency�to����>b�Ge�g�unidirectional,�lPlik���e�demo�dulation)�and�the�clausal-searc���h�mec�hanism,�lPwhic�h����>can�=�accum���ulate�v��q�arious�equiv�alen���t�forms�of�an�expression.�i�Once�160�is�deriv�ed,����>tric���hotom�y�3�(10)�and�119�giv���e�us�298,�:�and�subtracting�the�same�term�from�b�Goth����>sides�UUw���e�get�299,�whic�h�is������(�a�8�+�1)����(�a�����i�(�c�)����+�1)����(�a����i�(�c�)�+��a��+�1)���<��0�:����>�src:1114induction.tex�This���simplies�to�a�conjunction:���a��׸6�=�0���and��i�(�c�)��׵<��0.�Z$Inciden���tally��*�,��&I��sthink����>one�B�migh���t�w�ait�a�long�time�for�this�conclusion�to�come�out�without�external����>simplication,�N�using�M.only�paramo�Gdulation�and�demo�dulation!�oThis�conjunction����>is�^Uat�rst�represen���ted�at�the�ob��8ject�lev�el�in�Otter-���as�a�term�with�functor��and����>�(line�R�398).�p�But�Otter-���has�an�inference�rule�called��split�?�and�,�Swhic���h�con�v�erts����>a���clause��and(P,Q)�?�|�R��{�to���t���w�o�clauses��P�?�|�R��~�and��Q�|�R����.�This�rule�giv���es�sp�Gecial����>meaning��Gto�the�functor��and�.�(�It�is�necessary�b�Gecause�the�mec���hanism�for�calling����>external�rYsimplication�returns�a�single�clause,���not�sev���eral�clauses.���After�the����>use��of�\split�and",�%�the�pro�Gof�completes�immediately��*�,�since�the�h���yp�Gothesis�that��i����>�maps�UUin���tegers�to�nonnegativ�e�reals�has�b�Geen�con�tradicted.��!č�>�Pro���ving�ffrst-order�form�ulas�b�y�induction�����>�src:1126induction.tex�In��[order�to�use�the�clausal�form�of�induction,��the�theorem�to�b�Ge�pro���v�ed��[m�ust�b�Ge����>a�Eliteral.�lZHo���w�ev�er,�HPin�mathematical�practice,�w���e�often�need�to�pro�v�e�a�theorem����>b���y���induction�that�is�not�directly�expressed�in�that�form.��kHere�w�e�tak�e�a�w�ell-����>kno���wn�y�example�(discussed�in�[�9��]):����Every��_natur��}'al�numb�er�is�either�even�or�o�dd.����>�Since��lam���b�Gda�logic�is�capable�of�dening�the�logical�op�erators,��w���e�can�represen�t����>�and�V.�and��or��as�constan���ts.�tQThe�meaning�of�these�constan�ts�cannot�b�Ge�dened�b�y�������26����^P�y�����?������>�axioms��in�an�input�le,�2since�these�\axioms"�w���ould�ha�v�e�to�ha�v�e�v��q�ariables�in����>the�UUplace�of�a�literal:����>�src:1138induction.tex�-or(x,y)�?�|�x�|�y.����>-x�?�|�or(x,y).����>-y�?�|�or(x,y).����>�src:1140induction.tex�This��[is�not�legal,�either�in�Otter-���or�in�lam���b�Gda�logic.�N�Instead,�to�dene�dis-����>junction�-and�conjunction�w���e�ha�v�e�sp�Gecial�inference�rules,�c�for�example:�"\from����>�or�G�(�a;���b�)�
�j��c�_ڲinfer��a�
�j��b��j��c�."��VF��*�our�_�suc���h�rules�for��and��and��or����are�built����>in���to�N�Otter-��.����^��7�����The�follo�wing�is�Otter-��'s�pro�Gof�of�the�theorem�that�ev�ery�n�um-����>b�Ger��is�ev���en�or�o�dd.�+�The�predicates��even��and��o��}'dd��are�dened�in�lines�1,2,�
dand����>10;�2the��.induction�sc���hema�is�giv�en�in�lines�6�and�7,��and�the�negated�goal�in����>line��13.�Z�F��*�or�readabilit���y�,��the�Sk���olem�term��g�[ٲ(�l�2`ambda�(�x;���or�G�(�ev�en�(�x�)�;�odd�(�x�))))��has����>b�Geen�UUreplaced�b���y�a�constan�t��c�.����>�src:1170induction.tex�1�?�[]�even(s(x))=odd(x).����>2�?�[]�odd(s(x))=even(x).����>6�?�[]�-Ap(y,0)|Ap(y,g(y))|Ap(y,z).����>7�?�[]�-Ap(y,0)|�-Ap(y,s(g(y)))|Ap(y,z).����>10�?�[]�even(0).����>13�?�[]�-or(even(n),odd(n)).����>16�?�[binary,13.1,7.3,demod,beta,beta,1,2]����M��-or(even(0),odd(0))|�?�-or(odd(c),even(c)).����>17�?�[binary,13.1,6.3,demod,beta,beta]����R��-or(even(0),odd(0))|or(even(c),odd(c)).����>22�?�[split�-or,16,unit_del,10]�-or(odd(c),even(c)).����>23�?�[split�-or,22]�-odd(c).����>24�?�[split�-or,22]�-even(c).����>27�?�[split�or,17,unit_del,24,23]�-or(even(0),odd(0)).����>29�?�[split�-or,27]�-even(0).����>30�?�[binary,29.1,10.1]�$F.����M�src:1173induction.tex�Another�|�approac���h�to�this�example,��Mmore�in�the�spirit�of�rst-order�logic,����>w���ould�'�b�Ge�to�in�tro�Gduce�a�predicate��R�Dz(�x�)�for�b�eing�ev���en�or�o�dd.��If�w���e�replace����>the�fuse�of��or��4�b���y�axioms�for��R�Dz,�jGthen�the�formalization�of�rst-order�logic�at�the����>clause�a�lev���el�can�b�Ge�a�v�oided.���This�pro�Gof�is�as�follo�ws,�d�again�with�a�Sk�olem�term����>replaced�UUb���y�a�constan�t:��>�X-�ff��v�	J=�����"5��-:�7����LܻIt���is�not�necessary�to�supply�built-in�rules�for�the�quan�Îtiers,��as�these�can�b�<re�dened��	��b�Îy�daxioms�in�an�input�le�when�needed.�s$This�w�as�illustrated�ab�<ro�v�e�in�the�examples�ab�<rout���order���in�P�Îeano�Arithmetic.���Lam�b�<rda�logic�with�the�new�prop�ositional�constan�Îts�and�rules�is�a���conserv��ativ�Îe���extension�of�lam�b�<rda�logic,���so�b�y�adding�these�rules�w�e�ha�v�e�not�gone�b�<rey�ond�the���theoretical��Xbasis�of�Otter-���in�lam�Îb�<rda�logic.��������27����l��y�����?������>�src:1199induction.tex�1�?�[]�even(s(x))=odd(x).����>2�?�[]�odd(s(x))=even(x).����>6�?�[]�-Ap(y,0)|Ap(y,g(y))|Ap(y,z).����>7�?�[]�-Ap(y,0)|�-Ap(y,s(g(y)))|Ap(y,z).����>10�?�[]�even(0).����>12�?�[]�-R(x)|even(x)|odd(x).����>13�?�[]�-even(x)|R(x).����>14�?�[]�-odd(x)|R(x).����>15�?�[]�-R(n).����>18�?�[binary,15.1,7.3,demod,beta,beta]�-R(0)|�-R(s(c)).����>19�?�[binary,15.1,6.3,demod,beta,beta]�-R(0)|R(c).����>26�?�[binary,19.1,13.2,unit_del,10]�R(c).����>28�?�[binary,26.1,12.1]�even(c)|odd(c).����>31�?�[binary,18.1,13.2,unit_del,10]�-R(s(c)).����>36�?�[binary,31.1,14.2,demod,2]�-even(c).����>37�?�[binary,31.1,13.2,demod,1]�-odd(c).����>40�?�[binary,36.1,28.1]�odd(c).����>41�?�[binary,40.1,37.1]�$F.����M�src:1202induction.tex�In���general,�0�b�Goth�approac���hes�can�b�e�used�when�formalizing�a�theorem�in����>lam���b�Gda�B_logic.�kuIn�other�w�ords,�F*one�can�use�the�clause�language�as�usual�in�rst-����>order���logic,���or�one�can�em���b�Ged�rst�order�(and�v��q�arious�higher-order)�logics�in�the����>ob��8ject�UUlev���el.����M�src:1206induction.texIn���order�to�giv���e�a�go�Go�d���example�of�pro�ving�a�quan�tied�form�ula�b�y�induction,����>consider��Vthe�problem�of�pro���ving�the�principle�of�course-of-v��q�alues�induction�from����>ordinary���induction.�GCourse�of�v��q�alues�induction�can�b�Ge�expressed�as�an�axiom����>sc���hema�UUin�P�eano�Arithmetic�as�follo�ws:�����1}�8�z�p��(�8�x��<�z��(�A�(�x�)��!��A�(�z��))��!�8�y�[�A�(�y��)�:����>�src:1211induction.tex�Replacing�4͵A�(�x�)�b���y��Ap�(�a;���x�),�;Nand�replacing��8�xA�(�x�)�b�y��al�2`l��(�l�ambda�(�x;���Ap�(�a;�x�))),����>w���e�fobtain�a�formalization�in�lam�b�Gda�logic.��T��*�o�pro�v�e�course�of�v��q�alues�induction����>from�UUordinary�induction,�w���e�tak�e�the�follo�wing�negated�goal:����>�src:1220induction.tex�-implies(all(lambda(z,all(lambda(x,����C?�implies(and(x<z,Ap(a,x)),Ap(a,z)))))),�?�Ap(a,c)).����>�src:1223induction.tex�Note���that�if�w���e�instead�tak�e�a�clausied�form�of�this�goal,���there�will�b�Ge�no����>hop�Ge���of�nding�the�\righ���t"�instance�of�induction�b�y�lam�b�Gda�unication,��since����>there�Z�are�no�rules�of�inference�that�p�Germit�\re
ecting"�the�clause�lev���el�in�to�the����>ob��8ject�A�lev���el.�kSBut�with�this�form,�E�as�usual�lam�b�Gda�unication�will�nd�the�righ�t����>induction�WOpredicate,�W�taking��c��for�the�masking�term.����^��8����)�Once�the�correct�instance��>�X-�ff��v�	J=�����"5��-:�8����LܻIf�Ww�Îe�had�left��Ap�(�a;�j�c�)�in�the�form��al�Kl��(�l�ambda�(�w�7;�Ap�(�a;�w��))�Winstead�of�using�the�Sk�Îolem��	��constan�Ît�R�c�,�rLthen�after�a�few�steps�essen�tially�the�same�form�will�b�<re�reac�hed,�rLwith�a�Sk�olem���term��X�e�(�l�Kambda�(�w�7;�j�not�(�Ap�(�a;�w��))))��Xinstead�of��c�.��������28����w��y�����?������>�of���induction�is�found,��rit�only�remains�to�un���wind�the�quan�tiers�and�rst-order����>connectiv���es,�'using��dtheir�denitions.�6�This�is�just�rst-order�reasoning�(mo�Gdulo����>alpha-equiv��q�alence)|no�UUmore�lam���b�Gda�unication�is�required.��!č�>�The�fftheory�of�lists�����>�src:1238induction.tex�W��*�e�-�no���w�tak�e�up�list�induction,�5�to�sho�w�that�Otter-�l�2`ambda�'s�inductiv�e�capabili-����>ties��Care�not�limited�to�n���um�b�Ger��Ctheory��*�.�PCon�v�enien�tly�,�zOtter��Calready�supp�Gorts�list����>notation,�'�with����[]��for�the�empt���y�list�and��[a|b]��for�the�list-making�op�Geration,����>usually�UUread��a���c��}'ons�b�.�q�One�UUform�of�list�induction�is�����~�P�c��([])�8�^�8�x;���z�p��(�P��(�x�)���!��P��([�z�p��j�x�])��!�8�w�D�P��(�w��)�:����>�src:1243induction.tex�T��*�o�UUexpress�this�in�lam���b�Gda�logic,�w�e�replace��P�c��(�x�)�b�y��Ap�(�y�[�;���x�).�q�That�yields����r6<�Ap�(�y�[�;����[])�8�^�8�x;�z�p��(�Ap�(�y�[�;�x�)���!��Ap�(�y�[�;��[�z�p��j�x�])��!�8�w�D�Ap�(�y�[�;�w��)�:����>�src:1245induction.tex�W��*�e�UUbring�this�to�the�follo���wing�clausal�form:����>�src:1250induction.tex�-Ap(y,[])�?�|�Ap(y,g(y))�|�Ap(y,w).����>-Ap(y,[])�?�|�-Ap(y,[h(y)|g(y)])�|�Ap(y,w).����M�src:1253induction.tex�Tw���o��Sk�olem�functions��h��and��g�\��are�required,��instead�of�just�one�as�in�n�umer-����>ical�UUinduction.�q�The�recursiv���e�denition�of��append��is����>�src:1259induction.tex�append([x|y],z)�?�=�[x|append(y,z)].����>append([],z)�?�=�z.����M�src:1262induction.tex�These�bequations�should�b�Ge�used�as�demo�dulators.���W��*�e�can�no���w�try�to�pro�v�e����>the�UUasso�Gciativit���y�of��append��using�the�negated�goal����>�src:1267induction.tex�append(n,append(b,c))�?�!=�append(append(n,b),c).����M�src:1270induction.tex�Again,�q�the�8�use�of�a�constan���t�named��n�,�together�with�the�command��set(induction)�,����>giv���e�gOtter-���a�hin�t�to�c�ho�Gose��n��as�the�induction�v��q�ariable;�,this�tec�hnique�w�as�in-����>tro�Gduced��/b�efore�bac���ktrac�king�o�v�er�p�Gossible�c�hoices�of�the�induction�v��q�ariable�w�as����>implemen���ted.�q�The�UUpro�Gof�is�found�instan�tly;�the�presence�of�the�lam�b�Gda�term����c���l�2`ambda�(�x;���append�(�x;�append�(�b;�c�))��=��append�(�append�(�x;���b�)�;�c�)))����>�src:1275induction.texsho���ws�)]that�the�correct�instance�of�induction�w�as�found.�cHere�is�the�pro�Gof,�2(after����>replacing�UUSk���olem�terms�with�constan�ts�as�follo�ws:������>�h�(�l�2`ambda�(�x;���append�(�x;�append�(�b;�c�))��=��append�(�append�(�x;���b�)�;�c�)))�����b��b�Gecomes������[�p��������>�g�[ٲ(�l�2`ambda�(�x;���append�(�x;�append�(�b;�c�))��=��append�(�append�(�x;���b�)�;�c�)))�����b��b�Gecomes�����[�q���������29�������y�����?������>�src:1296induction.tex�1�?�[]�append([],z)=z.����>2�?�[]�append([x|y],z)=[x|append(y,z)].����>3�?�[]�x=x.����>6�?�[]�-Ap(y,[])|Ap(y,g(y))|Ap(y,z).����>7�?�[]�-Ap(y,[])|�-Ap(y,[h(y)|g(y)])|Ap(y,z).����>8�?�[]�append(n,append(b,c))!=append(append(n,b),c).����>9�?�[binary,8.1,7.3,demod,beta,1,1,beta,2,2,2,unit_del,3]����M��[p|append(q,append(b,c))]!=[p|append(append(q,b),c)].����>10�?�[binary,8.1,6.3,demod,beta,1,1,beta,unit_del,3]����M��append(q,append(b,c))=append(append(q,b),c).����>13�?�[para_into,9.1.1.2,10.1.1]����M��[p|append(append(q,b),c)]!=[p|append(append(q,b),c)].����>14�?�[binary,13.1,3.1]�$F.��!č�Cff�Generalizing�ffthe�theorem�to�b�s3e�pro���v�ed�����>�src:1301induction.tex�W��*�e���will�examine�the�details�of�t���w�o���problems�from�[�9��].�9�The�rst�problem�in���v�olv�es����>the�UUfunction��rev��that�rev���erses�a�list.�q�It�is�dened�b�y:����>�src:1309induction.tex�rev([])�?�=�[].����>rev(x|y)�?�=�append(rev(y),[x]).����M�src:1312induction.tex�The�u�theorem�to�b�Ge�pro���v�ed�u�is��r�ev�[ٲ(�r�ev��(�x�))��4=��x�.��-This�u�example�is�giv���en�under����>the�ryheading��Gener��}'alising��2a�Sub-T��;�erm�ry�on�p.�&)873�of�[�9��].�If�w���e�put�in�the�additional����>h���yp�Gothesis���r�ev�[ٲ(�append�(�x;���y��))�=��append�(�r�Gev�[ٲ(�y��)�;�r�Gev��(�x�)),��then��Otter-���nds�a����>pro�Gof�z�instan���tly��*�.��UThe�in�teresting�question�is�whether�Otter-���can�come�up�with����>this��wlemma�b���y�itself.�J.And�the�answ�er�is,���it�comes�up�b�y�itself�with�the�sp�Gecial����>case�UUin�whic���h��y��.�is�a�one-elemen�t�list:�����*�r�Gev�[ٲ(�append�(�x;����[�z�p��]))��=��append�([�z��]�;���r�Gev�[ٲ(�x�)�:����>�src:1319induction.tex�This���lemma�is�enough�to�nish�the�pro�Gof,��#and�indeed,�Otter-���is�able�to�pro���v�e����>�r�Gev�[ٲ(�r�ev��(�x�))��=��x�UU�unaided.�q�Here�is�ho���w�it�do�Ges�it:����M�src:1322induction.texSp�Gecically��*�,�UUthe�rst�attempt�at�induction�deriv���es�the�base�case�������r�Gev�[ٲ(�r�ev��(�c�))��=��c����>�src:1325induction.tex�and�UUthe�negated�induction�step��������r�Gev�[ٲ(�append�(�r�ev��(�c�)�;����[�b�]))���6�=�[�b�
�j��c�]�:����>�src:1327induction.tex�No���w,�a�paramo�Gdulating�,in�to�the��c��on�the�righ�t,�a�from�the�induction�h�yp�Gothesis,����>Otter-��UU�gets�����N�r�Gev�[ٲ(�append�(�r�ev��(�c�)�;����[�b�]))���6�=�[�b�
�j��r�Gev��(�r�ev��(�c�))]�:��������30�����?�y�����?������>�src:1329induction.tex�Then��Otter-���attempts�to�pro���v�e��this�b���y�induction,���and�it�selects�as�the�masking����>term,�UU�r�Gev�[ٲ(�c�),�generating�the�conjecture���#���X��r�Gev�[ٲ(�append�(�x;����[�b�]))��=�[�b�
�j��r�ev�[ٲ(�x�)]�:����>�src:1332induction.tex�This���form���ula�is�readily�pro�v�ed�b�y�a�straigh�tforw�ard�induction.�\hThis�w�orks�b�Ge-����>cause�GOtter-��'s�deterministic�algorithm�for�selecting�a�masking�subterm�lo�Goks�for����>a��term�(of�w���eigh�t��1�or�2)�that�o�Gccurs�on�b�oth�sides�of�the�equation�(when�pro���ving����>equalities��b���y�induction);�Eand��r�Gev�[ٲ(�c�)�is�suc�h�a�term.�ɨThis�algorithm�for�select-����>ing�/a�masking�subterm�can�b�Ge�view���ed�as�\generalization".�eIf�this�seems��ad�p�ho��}'c�,����>b�Gear���in�mind�that�bac���ktrac�king���selection�of�m���ultiple�uniers�with��max���E�ff&f��ǫunifiers����>�set��{to�a�small�n���um�b�Ger��{w�ould�certainly�retriev�e�this�masking�subterm.�9Here�is����>Otter-��'s�=�pro�Gof,�Brwith�the�complicated�Sk���olem�terms�replaced�b�y�constan�ts��c�,�Br�d�,����>�p�,��and��q�Lвfor�readabilit���y��*�.�D�Notice�the�main�induction�h�yp�Gothesis�at�line�14,��the����>main��induction�step�at�line�13;��ythe�paramo�Gdulation�at�line�17�that�enables�the����>generalization�Xto�b�Ge�found;��_the�secondary�(clev���er)�induction�is�form�ulated�at����>lines�j�22�and�23;�u�the�induction�h���yp�Gothesis�can�b�e�used�directly�in�the�induction����>step,�/�and�only�the�denition�of��append��is�needed�to�nish�o�the�pro�Gof.�~The����>asso�Gciativit���y��uof��append�,���whic�h�w�as�originally�in�the�input�le,���do�Ges�not�app�ear����>in�UUthe�pro�Gof.����>�src:1369induction.tex�1�?�[]�append([],z)=z.����>2�?�[]�append([x|y],z)=[x|append(y,z)].����>3�?�[]�rev([])=[].����>4�?�[]�rev([x|y])=append(rev(y),[x]).����>7�?�[]�x=x.����>10�?�[]�-Ap(y,[])|Ap(y,g(y))|Ap(y,z).����>11�?�[]�-Ap(y,[])|�-Ap(y,[a(y)|g(y)])|Ap(y,z).����>12�?�[]�rev(rev(b))!=b.����>13�?�[binary,12.1,11.3,demod,beta,3,3,beta,4,unit_del,7]����M��rev(append(rev(d),[c]))!=[c|d].����>14�?�[binary,12.1,10.3,demod,beta,3,3,beta,unit_del,7]����R��rev(rev(d))=d.����>17�?�[para_into,13.1.2.2,14.1.2]����R��rev(append(rev(d),[c]))!=[c|rev(rev(d))].����>22�?�[binary,17.1,11.3,demod,beta,1,4,3,1,3,beta,2,4,4,unit_del,7]����R��append(rev(append(p,[c])),[q])!=[c|append(rev(p)),[q])].����>23�?�[binary,17.1,10.3,demod,beta,1,4,3,1,3,beta,unit_del,7]����R��rev(append(p,[c]))=[c|rev(p)].����>27�?�[para_into,22.1.1.1,23.1.1,demod,2]����R��[c|append(rev(p),[q])]!=[c|append(rev(p)),[q])].����>28�?�[binary,27.1,7.1]�$F.�� ]{��>�Bac���ktrac�king�ffand�non-determinism�����>�src:1373induction.tex�All��the�example�pro�Gofs�in�this�pap�er�ha���v�e��b�een�obtained�with�a�deterministic����>implemen���tation���of�lam�b�Gda�unication.��Recen�tly��*�,���the�abilit�y�to�bac�ktrac�k�o�v�er�������31���� �j�y�����?������>�dieren���t��5lam�b�Gda�uniers�w�as�added,��mso�that�the�user�can�put�the�command����>�assign(max���E�ff&f��ǫunifiers,8)��`�in�the�input�le,��and�a�single�lam���b�Gda�unication�of����>�Ap�(�X�:�;���w�D�)��,with��t��will�return�up�to�8�uniers�(or�whatev���er�n�um�b�Ger�is�sp�ecied).����>Then�x�w���e�set�out�to�test�this�impro�v�emen�t.�(/W��*�e�c�hose�as�our�rst�example�the�the-����>orem����x��#�+�(�x��+��x�)��=�(�x��#�+��x�)�+��x��in�P���eano�Arithmetic.�;�This�example�w�as�suggested����>b���y���Bob�Bo�y�er,�
�as�one�that�w�ould�b�Ge�to�o�dicult�for�A���CL2�(if�asso�ciativit���y�w�ere����>not��	built�in���to�A�CL2,��uas�it�is).�6�The�negated�goal�is��n�d��+�(�n��+��n�)�4��6�=�(�n�d��+��n�)�+��n�,����>and�]�it�seems�that�what�one�m���ust�do�is�select�the�t�w�o�o�Gccurrences�of��n��that�are����>righ���tmost�lSon�the�left�and�righ�t,�rth�us�trying�to�pro�v�e��n�H4�+�(�n��+��z�p��)��i=�(�n�H4�+��n�)�+��z����>�b���y�UUinduction�on��z�p��.����M�src:1384induction.texSurprisingly��*�,��Otter-��Ǯ�pro���v�ed�this�theorem��without��bac�ktrac�king!�B�Ho�w�is�that����>p�Gossible?��Indeed�2[Otter-���rst�(fruitlessly)�attempts�to�pro���v�e�2[the�theorem�b���y����>induction�o�on��x�.���But�ev���en�tually�o�(clause�182�b�Gelo���w),��&paramo�dulation�o�and�the����>P���eano��axioms�for�successor�and�the�denition�of�addition�generate�the�clause����>�n���+�(�n��+��s�(�n�))�Յ�6�=�(�n���+��n�)�+��s�(�n�).�X�Once���this�clause�app�Gears,� (the�deterministic����>implemen���tation��of�lam�b�Gda�unication�prefers�the�w�eigh�t�t�w�o�term�that�app�Gears����>on�ZIb�Goth�sides:�{�so�it�replaces��s�(�n�)�b���y�a�new�v��q�ariable�and�pro�v�es�the�theorem�b�y����>induction�܎on�that�v��q�ariable.�sHere�is�the�resulting�pro�Gof,��]with�the�Sk���olem�term����>�g�[ٲ(�l�2`ambda�(�x;����(�n�8�+��n�)�+��x���=��n�8�+��n��+��x�))�UUreplaced�b���y�a�constan�t��c�:����>�src:1415induction.tex�1�?�[]�x+0=x.����>3�?�[]�x=x.����>4�?�[]�s(x)!=s(y)|x=y.����>6�?�[]�-ap(y,0)|ap(y,g(y))|ap(y,z).����>7�?�[]�-ap(y,0)|�-ap(y,s(g(y)))|ap(y,z).����>8�?�[]�x+s(y)=s(x+y).����>10�?�[]�(n+n)+n!=n+n+n.����>13�?�[binary,10.1,4.2]�s((n+n)+n)!=s(n+n+n).����>19�?�[para_into,13.1.1,8.1.2]�(n+n)+s(n)!=s(n+n+n).����>91�?�[para_into,19.1.2,8.1.2]�(n+n)+s(n)!=n+s(n+n).����>182�?�[para_into,91.1.2.2,8.1.2]�(n+n)+s(n)!=n+n+s(n).����>237�?�[binary,182.1,7.3,demod,beta,1,1,beta,unit_del,3]����R��(n+n)+s(c)!=n+n+s(c).����>238�?�[binary,182.1,6.3,demod,beta,1,1,beta,unit_del,3]����R��(n+n)+c=n+n+c.����>240�?�[para_from,238.1.1,8.1.2.1]����R��(n+n)+s(c)=s(n+n+g(lambda(x,(n+n)+x=n+n+x))).����>316�?�[para_into,237.1.2.2,8.1.1]�(n+n)+s(c)!=n+s(n+c).����>318�?�[para_into,240.1.2,8.1.2]�(n+n)+s(c)=n+s(n+c).����>319�?�[binary,318.1,316.1]�$F.����M�src:1417induction.tex�On��Ipage�872�of�[�9��]�is�another�example,��Fthe�sp�Gecial�case�of�the�asso�ciativit���y����>of�UU�append��when�all�the�v��q�ariables�are�iden���tied:����{�ŵappend�(�x;���append�(�x;�x�))��=��append�(�append�(�x;���x�)�;�x�)�������32����!���y�����?������>�src:1420induction.tex�Otter-���*�cannot�pro���v�e��*this�theorem�without�bac���ktrac�king��*for�m���ultiple�mask-����>ing��subterms,�y�ev���en�though,�as�w���e�ha�v�e�seen�ab�Go�v�e,�y�it�can�easily�pro�v�e�the����>asso�Gciativit���y���of��append�;���at�least,�>�not�in�fteen�min�utes�and�5000�generated����>clauses.���Exactly�Mwh���y�this�is�harder�than�the�one-v��q�ariable�asso�Gciativit�y�of�ad-����>dition�X�is�not�clear.�|�Ho���w�ev�er,���if�X��max���E�ff&f��ǫunifiers��is�set�to�9,�Otter-���will�bac���k-����>trac���k��through�dieren�t�c�hoices�of�masking�subterms�in�unication,�l�generat-����>ing��the�follo���wing�p�Gossible�c�hoices�of�induction�v��q�ariable.��UThe�output�w�as�gen-����>erated��Xb���y�a�debugging�trace,�(�sho�wing�p�Gossible�unications�of��Ap�(�X�:�;���z�p��)�with����>�append�(�a;���append�(�a;�a�))��=��append�(�append�(�a;���a�)�;�a�).������>�src:1437induction.tex�?��append(z,append(a,a))=append(append(a,a),a).����C?�appead(a,append(z,a))=append(append(a,a),a).����C?�append(z,append(z,a))=append(append(a,a),a).����C?�append(a,append(a,z))=append(append(a,a),a).����C?�append(z,append(a,z))=append(append(a,a),a).����C?�append(a,append(z,z))=append(append(a,a),a).����C?�append(z,append(z,z))=append(append(a,a),a).����C?�append(a,append(a,a))=appead(appead(z,a),a).����C?�append(z,append(a,a))=append(append(z,a),a).����M�src:1439induction.tex�The�5�last�result�in�this�list�is�the�one�that�mak���es�the�pro�Gof�w�ork.�gCHere�is�the����>pro�Gof,�UUwith�Sk���olem�terms�replaced�b�y�constan�ts�as�follo�ws:������>�h�(�l�2`ambda�(�x;���append�(�x;�append�(�a;�a�))��=��append�(�append�(�x;���a�)�;�a�)))��UUb�Gecomes�������]��c��������>�g�[ٲ(�l�2`ambda�(�x;���append�(�x;�append�(�a;�a�))��=��append�(�append�(�x;���a�)�;�a�)))��UUb�Gecomes�������g�d�����>�src:1461induction.tex�1�?�[]�append([],z)=z.����>2�?�[]�append([x|y],z)=[x|append(y,z)].����>3�?�[]�x=x.����>7�?�[]�-Ap(y,[])|Ap(y,g(y))|Ap(y,z).����>8�?�[]�-Ap(y,[])|�-Ap(y,[h(y)|g(y)])|Ap(y,z).����>9�?�[]�append(a,append(a,a))!=append(append(a,a),a).����>10�?�[binary,9.1,8.3,demod,beta,1,1,beta,2,2,2,unit_del,3]����M��[c|append(d,append(a,a))]!=[c|append(append(d,a),a)].����>11�?�[binary,9.1,7.3,demod,beta,1,1,beta,unit_del,3]����R��append(d,append(a,a))=append(append(d,a),a).����>18�?�[para_into,10.1.1.2,11.1.1]����M��[c|append(append(d,a),a)]!=����M��[c|append(append(d,a),a)].����>19�?�[binary,18.1,3.1]�$F.�� �퍑>�Comparisons�ffand�Conclusions�����>�src:1464induction.tex�Lam���b�Gda��/logic�and�lam�b�Gda�unication�ha�v�e�b�Geen�implemen�ted�in�the�source����>co�Gde�}�of�Otter�to�pro�duce�Otter-��.��The�theorems�pro���v�ed�}�include�some�that�are����>considered��dicult�for�an�inductiv���e�theorem�pro�v�er.�*�The�conclusion�to�b�Ge�dra�wn�������33����"�^�y�����?������>�from�h�this�w���ork�is�not�simply�that�Otter-���is�go�Go�d�h�at�induction.�"�The�reason�for�its����>success���is�the�underlying�theory�(lam���b�Gda�logic),��.the�new�unication�algorithm����>(lam���b�Gda��Nunication),�؃and�the�already�existing�strengths�of�the�rst-order�pro�v�er����>Otter.�<fLam���b�Gda�C�logic�and�lam�b�Gda�unication�are�not�extremely�complex�and����>can�Ngb�Ge�used�in�other�pro���v�ers�Ngb�y�an�y�one�who�wishes�to�implemen�t�them.�oxOtter-����>���ڲserv���es�to�demonstrate�the�viabilit�y�of�this�approac�h.�*VMoreo�v�er,��;induction����>itself��wis�only�one�example�of�an�area�in�whic���h�reasoning�ab�Gout�predicates�and����>functions,�UUin�com���bination�with�strong�rst-order�tec�hniques,�could�b�Ge�useful.����M�src:1474induction.texTherefore,�(�the��Cissue�of�an�exact�comparison�b�Get���w�een��Cthe�p�erformance�of����>Otter-��[�on�induction�problems�and�the�p�Gerformance�of�existing�inductiv���e�pro�v�ers����>is�8Gnot�vitally�imp�Gortan���t�for�the�ev��q�aluation�and�further�application�of�this�w�ork.����>Before���turning�to�that�issue,�c�I��:w���an�t���to�remark�on�the�in���terpla�y���in�Otter-�����>�b�Get���w�een�k*brute�force�searc���h�and�heuristics.��FIt�is�imp�ortan���t�to�notice�that�an����>implemen���tation�Gof�the�full�non-deterministic�lam�b�Gda�unication�algorithm�w�ould����>generate��has�man���y�uniers�as�the�induction�h�yp�Gothesis�has�subterms,��mand�then����>p�Gerhaps��<try�to�pro���v�e��<man�y�of�those�b�y�induction�again.�4Whether�the�pro�Gofs�that����>are��found�with�the�presen���t�implemen�tation�w�ould�still�b�Ge�found,�!�I��do�not�kno�w,����>but��p�Gerhaps�not,�(if�the�searc���h�space�b�ecame�lled�with�man���y�useless�attempted����>inductions.���The�-presen���t�mix�of�heuristics�and�bac�ktrac�king�in�Otter-���seems����>to�ldra���w�the�line�usefully�b�Get�w�een�to�Go�man�y�uniers�and�to�Go�few.��F��*�or�example:����>the��[only�reason�(in�induction�problems)�for�c���ho�Gosing�an�y�masking�term�but�a����>constan���t���is�to�generalize�the�problem,���as�in�the��r�Gev�[ٲ(�r�ev��(�x�))��=��x����example.�0�In�this����>case,���it���seems�unlik���ely�that�selecting�a�large�masking�term�w�ould�b�Ge�useful.�I�The����>heuristic���of�selecting�only�a�constan���t�or�term�of�w�eigh�t�2�migh�t�b�Ge�resp�onsible�for����>the��{fact�that�Otter-���do�Ges�not�dro���wn�in�a�sea�of�h�undreds�of�useless�conclusions����>generated�9�b���y�m�ultiple�uniers�formed�from�arbitrary�masking�subterms.�h�In�the����>spirit���of�Otter,��w���e�ha�v�e�giv�en�the�user�as�m�uc�h�con�trol�as�p�Gossible�o�v�er�the�pro�Gof����>searc���h,��Vb�y���allo�wing�a�command�of�the�form��assign(max���E�ff&f��ǫunifiers,9)�;���also�b�y����>using��AOtter's�w���eigh�t��Atemplates,���the�user�can�in
uence�the�pro�Gcess�of�generalizing����>an�UUinduction�h���yp�Gothesis,�if�desired.����M�src:1488induction.texIn�
�spite�of�the�ab�Go���v�e�
�disclaimer�ab�out�the�(in)signicance�of�the�question,��it����>is��still�in���teresting�to�ask:�7�Just�ho�w�go�Go�d��is�Otter-���at�induction,���compared�with����>existing���inductiv���e�theorem-pro�v�ers?���Ev�en�without�bac�ktrac�king�for�m�ultiple����>uniers,���Otter-����is�able�to�pro���v�e��all�the�examples�in�Bundy's��Handb��}'o�ok���surv���ey����>[�9��].�1�It��Rma���y�app�Gear�to�some�readers�that�the�\Otter-���pro�ofs�rely�on�n���umerous����>hin���ts�7�and�ha�v�e�b�Geen�`coaxed�out'�of�the�system."�g�This�criticism�ma�y�ha�v�e�b�Geen����>v��q�alid��9b�Gefore�the�implemen���tation�of�bac�ktrac�king�unication,��rwhen�w�e�did�rely�on����>heuristics���in�the�pro���v�er���to�help�it�c���ho�Gose�the�righ�t�induction�v��q�ariable,�ђe.g.�:�telling����>it��Dto�prefer�the�letter��n��or��m��o���v�er��D�a��or��b�.�f�But�the�curren���t�v�ersion�of�Otter-�����>�do�Ges�;�not�dep�end�on�suc���h�hin�ts,�ucand�they�ma�y�ha�v�e�b�Geen�mostly�unnecessary����>an���yw�a�y��*�,�z�since�sXup�Gon�remo���ving�them�from�input�les,�the�pro�Gofs�seem�to�still�b�e����>found�UUwithout�bac���ktrac�king.����M�src:1499induction.texOtter-���can�also�pro���v�e�at�least�some�problems�that�are�not�pro���v��q�able�with����>A���CL2.�2bW��*�e���ha�v�e�men�tioned��x�c��+�(�x��+��x�)�2=�(�x�c��+��x�)�+��x��(with�addition�renamed����>so���that�built-in�asso�Gciativy�will�not�b�e�a���v��q�ailable)�and�the�corresp�onding�exam-����>ple��with��app��}'end��instead�of�addition.�Y�All�this�is�accomplished�without�the�use�of�������34����#��y�����?������>�sp�Gecial�h�heuristics�suc���h�as�those�describ�ed�in�[�9��];���rst-order�searc���h�and�paramo�du-����>lation�Étogether�with�lam���b�Gda�unication�form�a�p�o���w�erful�Écom�bination�that�needs����>no��help.��Bundy's�\w���a�v�e-fron�t"��heuristics�are�designed�to�con���trol�equations�so����>that�F�they�are�used�in�the�direction�required�to�con���v�ert�F�the�induction�step�to����>the�5-induction�h���yp�Gothesis;��his�pro�v�er�requires�that�equations�b�Ge�orien�ted.����^��9����òIn����>Otter-��,���paramo�Gdulation���simply�uses�the�equations�in�b�oth�directions;��+the�ex-����>tra��conclusions�do�no�harm,��@so�there�is�no�need�to�w���ork�hard�to�prev�en�t�them����>from��(b�Geing�generated.�cAA���CL2�do�es�not�searc���h�for�pro�ofs,�$�but�constructs�them����>b���y�2�reducing�goals,�9�so�it�has�to�rely�on�heuristics�for�selecting�an�induction�v��q�ari-����>able���and�for�manipulating�the�induction�goal�b���y�applying�equations�in�the�righ�t����>direction.��TPS��6[�1��],���whic���h��Eis�sometimes�men�tioned�as�an�inductiv�e�pro�v�er,���uses����>higher-order�5unication�and�generates�man���y�uniers,�l�y�et�it�cannot�automati-����>cally��pro���v�e�an�y�theorem�that�requires�a�nested�induction,���i.e.��
one�whose�base����>case�UUor�induction�step�needs�another�induction.����M�src:1517induction.texHo���w�ev�er,�JLthe�Nproblems�in�the��Handb��}'o�ok�N�article�form�a�small�set�of�simple����>problems,�şand�{�they�are�insucien���t�to�decide�the�issue.��P�erhaps�those�other����>pro���v�ers�̗are�more�robust�than�Otter-��,��gin�that�(i)�they�ma���y�b�Ge�b�etter�at�pic���k-����>ing���the�correct�induction�principle�automatically��*�,�#�including�the�correct�induc-����>tion��mv��q�ariable�or�term,��staking�in���to�accoun�t�an�y�existing�denitions�of�recursiv�e����>functions;�dTor�	�(ii)�they�ma���y�con�tin�ue�to�w�ork�ev�en�if�axioms�are�c�hanged�(e.g.����>so�V�that�addition�is�recursiv���e�in�its�rst�argumen�t�rather�than�its�second);�װor����>(iii)�a�they�ma���y�p�Gerform�b�etter�at�industrial�scale;��Gor�(iv)�they�ma���y�b�e�b�etter����>at��?theorems�that�ha���v�e��?a�lot�of�v��q�ariables�and�require�man���y�inductions,��9suc�h�as����>�a�0�+��b��+��c��+��d���=��c�0�+��b��+��a��+��d�;�Rcor�P�(v)�they�ma���y�b�Ge�b�etter�on�theorems�that�need����>generalization�UUbut�don't�men���tion�the�function�needed�in�the�generalization.����M�src:1522induction.texW��*�e�`Caddress�these�p�Gossibilities�one�at�a�time.���(i)�Bac���ktrac�king�`Co�v�er�m�ultiple����>uniers���no���w�allo�ws�Otter-���to�try�ev�ery�p�Gossible�instance�of�induction�formed����>b���y���replacing�(some�set�of�o�Gccurrences�of�a)�constan�t�or�term�of�w�eigh�t�2�b�y����>an���induction�v��q�ariable.��(ii)�W��*�e�tried�pro���ving�the�asso�Gciativit�y�of�addition�with����>addition���dened�recursiv���ely�on�the�rst�v��q�ariable�instead�of�the�second�(and����>all��:hin���ts�in�the�form�of�v��q�ariable�names�remo�v�ed).�uOtter-���do�Ges�that�almost����>immediately��*�,��with���v���ery�little�searc�hing�required�(see�le�P��*�A-asso�Gcplus3.in�at�the����>w���ebsite){it���do�Ges�not�ev�en�need�m�ultiple�uniers,���in�spite�of�the�fact�that�its�rst����>attempt��w���ould�b�Ge�to�use�induction�on�the�righ�tmost�v��q�ariable.���The�short�and����>in���teresting��@pro�Gof�is�probably�not�one�that�a�h�uman�w�ould�think�of.�,It�also�pro�v�es����>the�pxcomm���utativit�y�of�addition�easily�when�addition�is�dened�b�y�left�recursion����>instead�of�righ���t�recursion,�)again�without�needing�m�ultiple�uniers.�_X(iii)�Otter-�����>�has��onot�b�Geen�tested�at�\industrial�scale".�M�It�is�in���tended�for�researc�h.�M�(iv)�Otter-����>��$�fails�to�pro���v�e�$that�example;�#�it�generates�half�a�million�clauses�and�runs�out�of����>memory��*�.�Q�Of���course,���it�can�b�Ge�pro���v�ed���easily�if�comm���utativit�y���and�asso�ciativit���y����>are��giv���en,��Pso�the�real�problem�is�appropriate�lemma�generation,�not�the�selection��>�X-�ff��v�	J=�����"5��-:�9����LܻOne�C@should�not�conclude�that�b�<recause�I�C$ha�Îv�e�C@tried�a�dieren�Ît�approac�h�with�Otter-��,�^�I��	��ha�Îv�e��5less�admiration�for�Bundy's�deep�and�b�<reautiful�w�Îork�with�these�w�a�v�e-fron�t�rules.�Z�In���principle���these�rules�could�b�<re�used�in�com�Îbination�with�lam�b�<rda�unication�and�searc�h{there���is�~no�reason�wh�Îy�they�cannot�b�<re�com�bined�in�a�single�pro�v�er.��nF��J�or�example,��Nthey�could�b�<re���used��Xto�guide�the�c�Îhoice�of�the�\righ�t"�lam�b�<rda�unier.��������35����$к�y�����?������>�of��wan�appropriate�instance�of�induction.�	..(v)�Otter-���certainly�cannot�solv���e����>problems�nKin�that�category��*�,�t�since�its�metho�Gd�for�nding�generalizations�in���v�olv�es����>replacing�UUsubterms�b���y�v��q�ariables.����M�src:1527induction.texLouise�~�Dennis�is�curren���tly�dev�eloping�a�suite�of�test�problems�for�inductiv�e����>pro���v�ers,�[Pwith��the�aid�of�whic���h,�in�the�future,�the�p�Gerformance�of�inductiv���e����>theorem�UUpro���v�ers�can�b�Ge�more�quan�titativ�ely�in�v�estigated.�� �O��>�References�������C�[1]���R�<�src:1533induction.texP���eter��-B.�Andrews,���Matthew�Bishop,�Sunil�Issar,�Dan�Nesmith,�F��*�rank�Pfen-����R�<ning,��&Hongw���ei���Xi,�TPS:�A��zTheorem�Pro���ving�System�for�Classical�T�yp�Ge����R�<Theory��*�,�UU�Journal���of�A���utomate��}'d�R�e�asoning�UU�!�"V

cmbx10�16�,�1996,�321{353.���:����C[2]���R�<�src:1537induction.texAubin,���R.,�Mec���hanizing�XLStructural�Induction�P�art�I:�F��*�ormal�System.��The��}'or.����R�<Comput.���Sci.�UU�9��329{345�(1979).������C[3]���R�<�src:1540induction.texAubin,��3R.,�Mec���hanizing��Structural�Induction�P�art�I�GI:�Strategies.��The��}'or.����R�<Comput.���Sci.�UU�9��347{362�(1979).������C[4]���R�<�src:1543induction.texBeeson,��WM.,�Lam���b�Gda���Logic,�in�Basin,�Da���vid;��Rusino�witc�h,��WMic�hael�(eds.)����R�<Automated��xReasoning:��Second�In���ternational�Join�t�Conference,�@IJCAR����R�<2004,�~gCork,�Ireland,�July�B�4-8,�2004,�Pro�Gceedings.�Lecture�Notes�in�Arti-����R�<cial�UUIn���telligence�3097,�pp.�460{474,�Springer�(2004).������C[5]���R�<�src:1546induction.texBeeson,�nsM.,�Implicit�6:T���yping�in�Lam�b�Gda�Logic,�nspresen�ted�at�the�ESHOL����R�<w���orkshop�UUat�LP��*�AR-12,�Dec.�2005.������C[6]���R�<�src:1549induction.texBeeson,�>�M.,�MathXp�Gert�<Calculus�Assistan���t,�>�soft�w�are�<a�v��q�ailable�from�(and����R�<describ�Ged�UUat)�www.HelpWithMath.com.������C[7]���R�<�src:1552induction.texBeeson,�UUM.�The�Otter-���w���ebsite:�����R�<�src:1553induction.tex�http://www.MichaelBeeson.com/research/Otter-lambda/index.php������C�[8]���R�<�src:1555induction.texBo���y�er,���R.�hnS.,�and�Mo�Gore,�J.�S.,��A���Computational���L��}'o�gic�Handb�o�ok�,���Academic����R�<Press,�UUBoston�(1988).������C[9]���R�<�src:1559induction.texBundy��*�,���Alan,�The�j�automation�of�pro�Gof�b���y�mathematical�induction,���Chapter����R�<13�UUof�[�13��
].������>[10]���R�<�src:1563induction.texBundy��*�,�@�Alan,��et.�|Kal.�,�The�;�Oyster-Clam�system,�@�in�Stic���k�el,�M.�;�E.�(ed.)��10th����R�<International��5Confer��}'enc�e�on�A���utomate�d�De�duction���647-648,���Springer�Lec-����R�<ture�UUNotes�in�Articial�In���telligence��449��(1990).������>[11]���R�<�src:1567induction.texKapur,��D,���and�Zhang,�H.,�An�o���v�erview���of�Rewrite�Rule�Lab�Goratory�(RRL),����R�<�J.���of�Computer�and�Mathematics�with�Applic��}'ations�UU�29��2,�91{114,�1995.������>[12]���R�<�src:1572induction.texMcCune,��mW.:�Otter���2.0,�in:�Stic���k�el,��mM.���E.�(ed.),��10th���International�Confer-����R�<enc��}'e�on�A���utomate�d�De�duction��1�663{664,��Springer-V��*�erlag,�Berlin/Heidelb�Gerg����R�<(1990).�������36����%゠y�����?��������>�[13]���R�<�src:1576induction.texRobinson,�n7Alan,�and�i=V��*�oronk���o�v,�n7A.�(eds.)��Handb��}'o�ok��7of�A���utomate��}'d�R�e�ason-����R�<ing,��V��;�olume���II�,��MElsevier�Science�B.�V.�Amsterdam,��2001.�Co-published�in����R�<the�UUU.�S.�and�Canada�b���y�MIT�Press,�Cam�bridge,�MA.������>[14]���R�<�src:1580induction.texWic���k,��zC.,�and���McCune,�W.,�Automated�reasoning�ab�Gout�elemen���tary�p�oin���t-����R�<set�UUtop�Gology��*�,��J.���A���utomate��}'d�R�e�asoning�UU�5(2)��239{255,�1989.������>[15]���R�<�src:1582induction.texW��*�os,�(Larry�,�and���Piep�Ger,�Gail,��A�CF��;�ascinating�C3Country�in�the�world�of�Com-����R�<puting�,�UUW��*�orld�Scien���tic,�Singap�Gore�(1999).�������37��������;�y�	%�!�"V

cmbx10� #�f�cmti8���N�cmbx12��C�scmtt8���<x

cmtt10��':

cmti10���N�ffcmbx12�t�:		cmbx9�o���		cmr9�q�%cmsy6��K�cmsy8��2cmmi8��Aa�cmr6�|{Ycmr8�X�Qcmr12�D��tG�G�cmr17�
!",�

cmsy10�
�b>

cmmi10�	0e�rcmmi7�K�`y

cmr10�ٓ�Rcmr7���u

cmex10�������

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists