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/SolvingForFunctions.dvi

����;� TeX output 2002.10.11:0821����������R������fb���X����N�G�cmbx12�Solving�z�F��aGor�F�unctions��#�������@cmti12�Michael�35Be��ffeson���������-�
cmcsc10�San���Jose�St��32a�te���University�����42Ma��32th���&�Computer�Science������fSan���Jose,�CA�95192����"����3��)��N�cmbx12�Abstract�����4�*K�`y
�3
cmr10�Buc��!h�b�M�erger�5has�emphasized�that�automated�deduction�in��!v�olv�es�5computa-��
����4tion,��1pro��!ving,�and�solving.�When�the�ob���ject�to�b�M�e�\solv�ed�for"�is�a�func-����4tion,�#�second-order�unication�can�b�M�e�a�v��!ery�p�o��!w�erful�#�and�general�solution����4to�M�ol.��AAn�algorithm�for�second-order�unication�w��!as�giv�en�in�(�8��y�).�This�algo-����4rithm�|�is�no��!w�b�M�eing�implemen�ted�in�the�source�co�M�de�of�Otter;�this�algorithm����4diers���from�the�earlier�algorithm�giv��!en�b�y�Pietrzyk�olski�(�22��
�4).�Sev�eral�ex-����4amples��are�giv��!en�to�illustrate�the�wide�range�of�p�M�oten�tial�applications����4of�zCthis�algorithm�and�its�implemen��!tation�in�a�p�M�o�w�erful�clausal�theorem����4pro��!v�er,�
�including�the�abilit��!y�to�manipulate�quan�tiers�at�the�clausal�lev�el,����4so��'that�denitions�in��!v�olving��'quan�tiers�can�b�M�e�con�v�enien�tly�used�in�pro�M�ofs.����4Since�W�predicates�are�considered�as�Bo�M�olean-v��dDalued�functions,�solving�for����4functions��\includes�solving�for�predicates,�and�second-order�unication�can����4help��:rst-order�pro��!v�ers��:with�pro�M�ofs�b��!y�induction.�Other�examples�sho�w����4pro�M�ofs�N�in�whic��!h�the�function�to�b�e�solv��!ed�for�is�a�one-to-one�corresp�on-����4dence��d(in�set�theory)�or�a�group�isomorphism.�There�is�also�a�detailed����4comparison���of�the�new�second-order�unication�algorithm�with�the�older����4one.�������K�cmsy8���������4�KEYW��!ORDS:�n�automated�deduction,�computer�pro�M�ofs,�unication,�second-����4order,��fOtter����$���=��N�ffcmbx12�In���tro�s3duction������X�Qcmr12�In��previous�w��rork�(�4���;��7��
��),�the�author�has�fo�S�cused�atten�tion�on�the�relation�b�S�e-�����t��rw�een�A�computation�and�logic�in�automated�deduction.�In�the�dev��relopmen�t�A�of�����The��ffor�ema�,�ߦBuc��rh�b�S�erger�(�13����)�w�as�guided�b�y�his�vision�that�mathematics�in�v�olv�es�����thr��ffe�e��_�essen��rtial�comp�S�onen�ts:�logic�(pro�ving),�computation,�and��solving�.�Solving�������#g��^��O!�cmsy7�����(�K�`y

cmr10�Researc���h�UUsupp�Gorted�b�y�NSF�gran�t�n�um�b�Ger�CCR-0204362.������*�����R�����=�Solving��fF��eor�F�unctions�����������means�&�nding�an����g�cmmi12�x��with�certain�desired�prop�S�erties.�Often�the�\solving"�step�of�����a�=�pro�S�of�is�the�\k��rey"�step,�the�one�that�seems�to�demand�\creativit�y".�Buc�h-����b�S�erger���emphasizes�the�imp�ortance�of�adding�(man��ry)�sp�ecial-purp�ose�\solv��rers"����to��a�computerized�mathematical�system.�In�this�pap�S�er,�b��ry�con�trast,�w�e�wish�to����fo�S�cus�+�on��gener��ffal��solution�tec��rhniques,�as�opp�osed�to�sp�ecial�algorithms�that�apply����to��a�sp�S�ecic�mathematical�theory��V.����!��Solving��prefers�to�tec��rhniques�for�instan�tiating�a�v��X�ariable.�The�traditional�metho�S�d����of�<yinstan��rtiating�v��X�ariables�used�in�automated�deduction�is�unication.�It�is�kno�wn����that,��with�resp�S�ect�to�rst-order�logic,�this�metho�d�is�\univ��rersal",�in�the�sense����that�J�there�are�completeness�theorems�for�v��X�arious�systems�of�inference�in�whic��rh����unication�ȗis�used�to�instan��rtiate�the�v��X�ariables.�F��Vor�example,�binary�resolution����with�wmunication�is�complete,�and�bac��rkw�ards�wmapplication�of�the�Gen��rtzen�sequen�t-����calculus�trules,�guided�b��ry�unication,�is�complete.�But�when�w�e�go�to�mathemat-����ics,�unication�do�S�es�not�seem�to�do�the�job.�F��Vor�example,�if�w��re�w�an�t�an��x��suc�h����that��i�x����2�|{Ycmr8�2�����+���ax��+��b�UR�=�0,�w��re�need�the�quadratic�theorem,�not�unication.�Therefore,����as��Buc��rh�b�S�erger�has�emphasized,�sp�ecial-purp�ose�solv��rers�are�required�to�deal�with����the��dieren��rt�sp�S�ecialized�branc�hes�of�mathematics.����!��Our���fo�S�cus�in�this�pap�er�is�on�situations�where�w��re�need�to�\solv�e�for"�a�function,����rather�#�than�an�elemen��rt�or�ob��ject.�W��Ve�will�exhibit�a�n�um�b�S�er�of�examples�of�pro�ofs����of���this�kind,�to�illustrate�the�claim�that�\solving�for�a�function"�is�a�theme�that����p�S�ermeates�A�dieren��rt�branc�hes�of�mathematics.�Just�as�this�is�a�general�theme����in�FQmathematics,�there�is�a�general�to�S�ol�in�logic�to�help�with�this�kind�of�pro�of.����There�is�a�w��rell-kno�wn�\unication�algorithm"�whic��rh�can�b�S�e�though�t�of�as�solving����equations�!b�S�et��rw�een�terms�denoting�ob��jects.�There�is�also���-calculus,�whic�h�lets�us����dene���terms�for�denoting�functions.�There�is�a�w��ra�y���(in�fact,�more�than�one�w��ra�y)����to���generalize�the�unication�algorithm�so�that�it�can�b�S�e�though��rt�of�as�solving����equations��@b�S�et��rw�een�terms�denoting�functions,�rather�than�ob��jects.�This�is�kno�wn����as�꨽se��ffc�ond-or�der�35unic�ation�.����!��Our�9Lmotiv��X�ation�in�this�pap�S�er�is�to�sho��rw�that,�ev�en�though�sp�S�ecial-purp�ose����solv��rers��are�useful�for�sp�S�ecialized�mathematics,�w�e�can�get�some�surprising�(and����in� �some�cases�unexp�S�ected)�results�from�general�metho�ds�based�on�second-order����unication.����!��The�|<problems�addressed�here�are:�Ho��rw�are�the�existing�notions�of�second-����order�8unication�related?�Can�second-order�unication�b�S�e�fruitfully�used�in�a����rst-order���theorem-pro��rv�er?�Whic�h�is�the�b�S�est�notion�of�unication�to�use�in����automated��deduction?�Is�it�feasible�to�add�second-order�unication�to�an�existing����pro��rv�er��y(Otter),�whic��rh�already�has�a�large�group�of�users?�Ho�w�can�w�e�exp�S�ect����this��capabilit��ry�to�b�S�e�useful�in�automated�deduction?����!��These�|questions�ha��rv�e�|not�b�S�een�answ��rered�un�til�no�w.�One�reason�for�this�is����that�the�ma��jorit��ry�of�w�ork�in�automated�deduction�has�b�S�een�done�(so�far)�b�y����rst-order��theorem�pro��rv�ers,��but�second-order�unication�has�so�far�b�S�een�(incor-����rectly)���view��red�as�incompatible�with�rst-order�pro�v�ers.�Another�reason�is�that����serious�{.automated�deduction�has�so�far�b�S�een�done�in�theories�with�a�single�short����list�m
of�axioms,�referring�to�only�one�kind�of�mathematical�ob��jects,�rather�than�in����more���complex�mathematical�en��rvironmen�ts,���where�second-order�unication�migh��rt�����
������R�������M.��fJ.�Beeson�����������pro��rv�e���helpful.�A��|third�reason�is�that�second-order�unication�is�considered�in-�����ecien��rt�(it�pro�S�duces�innitely�man�y�uniers,�it�necessarily�pro�S�duces�redundan�t����uniers,��it�in��rv�olv�es��an�exp�S�onen��rtial�searc�h,�etc.)����!��The��main�p�S�oin��rts�of�the�pap�er�are����!��(i)�A&Second-order�unication�can�b�S�e�though��rt�of�as�\solving�for�a�function",�that����is,�?�nding�a�term�that�denes�a�function�with�desired�prop�S�erties�to�complete�a����pro�S�of.����!��(ii)��PSome�mathematical�problems�that�ma��ry�not�app�S�ear�to�ha�v�e�the�form�of����\solving�_�for�a�function"�can�b�S�e�recast�in�that�form,�so�that�second-order�uni-����cation�H,can�b�S�e�used�on�them.�Others�are�naturally�of�that�form.�A�Hv��rery�general����\solv��rer"�Xcan�b�S�e�useful,�b�ecause�solving�for�functions�o�ccurs�generally�in�mathe-����matics.����!��(iii)�a�Second-order�unication�can�b�S�e�implemen��rted�and�used�in�Otter,�a�rst-����order�edtheorem-pro��rv�er�already�widely�used�(�19����).�There�is�nothing�strange�or�di-����cult��kab�S�out�using���-calculus�and�\second-order"�unication�in�a�rst-order�pro��rv�er.����Sample��pro�S�ofs�pro�duced�b��ry�the�new�implemen�tation�in�Otter�are�exhibited.����!��(iv)�.FT��Vec��rhnical�diculties�concerning�eciency�,�non-termination,�redundancy�,����etc.,�p�are�minimized�if�w��re�use�the�notion�of�unication�in�tro�S�duced�in�(�8���)�rather����than��the�one�in�(�22����;��18����).�These�notions�are�compared�here.����!��(v)��Quan��rtication�can�b�S�e�dened�in�terms�of���-calculus,�and�second-order����unication�Dgmak��res�it�p�S�ossible�to�use�quan�tiers�in�Otter�pro�S�ofs�at�the�clausal����lev��rel.�T:This�is�v�ery�imp�S�ortan�t�as�it�will�enable�Otter�to�w�ork�with�denitions����in��rv�olving���quan�tiers,�suc�h�as�the�relation�\�u��divides��v�n9�"�on�the�natural�n�um�b�S�ers.����!��(vi)��Set�theory�to�S�o�is�naturally�treated�as�a�branc��rh�of���-calculus.�This�is�not����an��original�idea�but�go�S�es�bac��rk�to�Ch�urc�h.����!��W��Ve��
shall�giv��re�a�motiv��X�ating�example.�In�undergraduate�courses�in�algebra,�what����is��Ftaugh��rt�as�\group�theory"�usually�in�v�olv�es�the�study�of�groups�and�subgroups.����See���e.g.�the�rst�45�pages�of�(�15����)�for�the�mathematics�in�question.�The�notation�����a����2��2cmmi8�n��	�Ϲis��in��rtro�S�duced,�where��n��is�a�natural�n�um�b�S�er,�and�one�of�the�early�theorems�is����Lagrange's��theorem,�according�to�whic��rh�the�order�of�a�subgroup��H��i�of�a�nite����group�au�G��divides�the�order�of��G�.�This�theorem�in��rv�olv�es�augroups,�subgroups,�and����natural��n��rum�b�S�ers.�Its�pro�of�b�egins�b��ry�sho�wing�that�eac�h�coset��H��Va��is�in�one-to-one����corresp�S�ondence��bwith��H��V�.�That�is,�there�exists�a�function��f��a�mapping��H����one-to-����one��on��rto��H��Va�.�That�function,�of�course,�is��x:xa�.�The�pro�S�of�therefore�in�v�olv�es�a����small��amoun��rt�of�set�theory�to�deal�with�cosets�and�one-to-one�corresp�S�ondences,����as�Ow��rell�as�enough�n�um�b�S�er�theory�to�deal�with�\divides".�W��Ve�will�sho�w�in�the�last����section��\of�this�pap�S�er�that�second-order�unication�can�instan��rtiate�the�v��X�ariable��f�����prop�S�erly��to�do�the�k��rey�step�of�this�pro�of�automatically��V.����!��Buc��rh�b�S�erger's�oaim�in�dev��reloping��The��ffor�ema�o�has�b�een�to�dev��relop�an�in�teractiv�e����en��rvironmen�t��in�whic��rh�h�umans�can�dev�elop�computer-c�hec�k�ed�pro�S�ofs�in�a�math-����ematical��0con��rtext�lik�e�this,�in�whic�h�(elemen�ts�of��8)�sev�eral�dieren�t�branc�hes�of����mathematics���are�a��rv��X�ailable�at�the�same�time.�One�dicult�y�in�suc�h�an�en�terprise����is��]that�the�pro�S�of-c��rhec�k�er��]ma�y�require�an�unacceptably�large�lev�el�of�detail.�P�eo-����ple�,refer�to�the�\expansion�factor",�b��ry�whic�h�a�page�of�pro�S�of�written�b�y�and����for�w�h��rumans�expands�to�ten�or�more�pages�of�computer-c�hec�k��X�able�pro�S�ofs.�If�the�����G�����R�����=�Solving��fF��eor�F�unctions�����������details�Hcould�b�S�e�tak��ren�care�of�automatically��V,�that�w�ould�adv��X�ance�the�sub��ject.�On�����the��other�hand,�some�researc��rhers�in�automated�deduction�ha�v�e�fo�S�cused�on�the����attempt�m�to�ha��rv�e�m�the�computer�pro��rv�e�m�results�not�previously�pro��rv�ed�m�b�y�h�umans.����So��far,�these�eorts�ha��rv�e��b�S�een�successful�only�in�areas�that�can�b�e�axiomatized����b��ry�0ma�few�simple�axioms,�and�studied�in�isolation�from�the�rest�of�mathematics.����W��Ve��view�our�w��rork�as�directed�to�w�ards�op�S�ening�up�wider�horizons�to�automated����deduction��in�the�future,�not�necessarily�just�as�supp�S�ort�for�pro�of-c��rhec�king.��$���Solving�fffor�functions�in�mathematics������In�`this�section,�w��re�will�illustrate�the�theme�that�\solving�for�functions"�o�S�ccurs����across���the�b�S�oard�in�dieren��rt�branc�hes�of�mathematics.�W��Ve�ha�v�e�already�giv�en�the����example�]�of�Lagrange's�theorem�in�algebra.�The�con��rtext�of�Lagrange's�theorem�is����t��rypical��%of�a�great�deal�of�mathematics:�a�little�set�theory��V,�a�little�n�um�b�S�er�theory��V,����sometimes��a�little�calculus.�Tw��ro�kinds�of�ob��jects�are�considered�(n�um�b�S�ers�and����elemen��rts���of�the�group),�along�with�sets�of�ob��jects�(subgroups),�functions�from����ob��jects�1Nto�ob�jects�(isomorphisms,�etc.),�and�functions�from�ob�jects�to�n��rum�b�S�ers����(the�̄order�of�an�elemen��rt),�and�ev�en�functions�from�sets�of�ob��jects�to�n�um�b�S�ers�(the����order�5�of�a�group,�the�index�of�a�subgroup).�Ob��jects�of�greater�complexit��ry�than����that��iare�not�required.�The�recen��rtly�announced�p�S�olynomial-time�primalit�y�test����(�1���),��for�example,�whic��rh�w�as�hailed�in�the��New���Y���ork�Times���(Aug.�8,�2002)�as�the����b�S�est��,result�in�computer�science�in�the�past�ten�y��rears,�is�actually�mathematics�of����the��sort�just�describ�S�ed.�One�needs�in��rtegers,�in�tegers�mo�S�d��p�,�and�p�olynomials�o��rv�er�����Z����p���]�,���groups�and�their�orders,�but�nothing�more�complicated.�F��Vermat's�conjecture����and�"Dits�long�and�complex�pro�S�of�not��rwithstanding,�if�automated�deduction�could����deal��successfully�with�the�simple�kinds�of�con��rtexts�just�describ�S�ed,�the�sub��ject����w��rould��adv��X�ance�rapidly��V.����!��W��Ve�R�b�S�egin�with�set�theory�.�Consider��S�)�=�UR�!",�
cmsy10�f�n��:��P��ƹ(�n�)�g�,�R�where��P��b�is�some�prop�S�ert��ry����of��_in��rtegers.�F��Vor�simplicit�y�let�us�just�consider�sets�of�in�tegers.�The�c�haracteristic����function�f�����S��
��is�dened�b��ry������S���(�n�)�'R=�1�fif��n�'R�2��S��׹,�f0�if��n�'R�62��S��.�fWhat�is�the�relation����b�S�et��rw�een�������S��	���and��S��׹?�The�logician�Alonzo�Ch��rurc�h��suggested�that�in�fact�the�set��is�����just���its�c��rharacteristic�function.�(See�the�App�S�endix�of�(�2���).)�According�to�Ch�urc�h,����an��ry��#set�is�a�b�S�o�olean-v��X�alued��#function,�and��n�3��2��S�L��is��#just�an�abbreviation�for���������S���(�n�)���=���true��'5�.���If�w��re�tak�e�this�view,�sets�are�functions,�and�can�b�S�e�dened�b�y������-terms.���Finding�a�set�with�certain�desired�prop�S�erties�b�ecomes�a�sp�ecial�case�of����solving�g"for�functions.�The�\list�notation"��f�a;���b;�c�g�g"�for�a�nite�set�can�b�S�e�regarded����as�B�an�abbreviation�for�a�function�dened�b��ry�cases:�if��x��is��a�,�b�,�or��c�,�the�v��X�alue�is�����true�,��else�it�is��false�.����!��One��gcan�also�use�tuple�notation��h�x;���y�n9�i��and�dene�Cartesian�pro�S�ducts.�Since�our����in��rterest��Kis�not�foundational,�w�e�ignore�the�issue�of�whether�and�ho�w�tuples�can�b�S�e����dened���in�terms�of�sets.�W��Ve�assume�that���p�����>2�@�cmbx8�0���&3�and���p�����1����are�pairing�functions�suc��rh�that�����h��p�����0����i�z���;�����p�����1����g�z��i�UR�=��z���.�,�W��Ve�sa��ry��A�����P���UR����԰���n9�=��������B�ǭ�if�there�is�a�one-to-one�corresp�S�ondence�b�et��rw�een�,��A�����and��a�B���.�A��Ksimple�theorem�in�this�sub��ject�(just�ab�S�out�the�simplest�set-theoretical����theorem��I���can�think�of��8)�is�that��A�,����B�����P���6����԰���O�=�����&��B�����A�.��(\�����P������԰����=�����	UW"�is�read�\equip�S�ollen��rt").����Ho��rw�d]do�w�e�pro�v�e�that�theorem?�By�solving�for�a�function��f��\�that�maps��A������B�����+ˠ����R�������M.��fJ.�Beeson�����������one-to-one�2�on��rto��B��p��3j�A�.�W��Ve�migh�t�lik�e�to�write�that�function�as���h�x;���y�n9�i�:�h�y�;�x�i�,�2�but�����according�w�to�the�usual�notation�for���-terms,�that�is�not�a�syn��rtactically�correct����term.��jWhat�w��re�w�an�t�w�ould�b�S�e�formally�written�as��z���:�h��p�����1����i�(�z��)�;�����p�����0����g�(�z��)�i�.��jThis�term����arises�4naturally�as�the�solution�to�a�certain�second-order�unication�problem,����but��there�is�no�space�here�for�the�details.����!��T��Vurning�A�to�n��rum�b�S�er�A�theory�,�let�us�consider�the�relation��n�j�m�.�T�o�dene�this����set�å(or�its�c��rharacteristic�function),�w�e�need�an�existen�tial�quan�tier:��n�j�m��means�����9�k�g�(�n������k��o�=�UR�m�).��<W��Ve�shall�tak��re�up�this�example�in�a�subsequen�t�section,�and�sho�w����that��]when�the�existen��rtial�quan�tier�is�dened�using���-calculus,�second-order����unication��can�use�this�denition�to�v��rerify�that�2�j�6�automatically��V.����!��Consider��a�related�but�more�dicult�example,�the�theorem�that�t��rw�o��p�S�ositiv�e����in��rtegers�H�n��and��m��ha�v�e�a�greatest�common�divisor.�That�is,�there�exists�a�n�um�b�S�er�����k��/�suc��rh�that��k��divides�b�S�oth��n��and��m�,�and�an��ry�other�in�teger��j�+�that�divides�b�S�oth��n�����and����m��also�divides��k�g�.�W��Ve�kno��rw,�from�our�mathematical�education,�t�w�o�dieren�t����w��ra�ys��to�instan��rtiate��k�g�:�as�the�least�n�um�b�S�er�of�the�form��n���+��m�,��where����and��������are�(p�S�ositiv��re�or�negativ�e)�in�tegers;�or�as�the�result�of�the�Euclidean�algorithm�����E���(�n;���m�).��9It�seems�that�neither�denition�of��k�V�will�b�S�e�pro�duced�b��ry�unication,����ev��ren�{�though�the�existence�of�gcd's�follo�ws�in�rst-order�logic�from�the�rst-order����v��rersion���of�P�eano's�axioms.�Is�that�a�sligh�t�m�ystery��V,�since�unication�is�complete����for��rst-order�logic?�It�should�not�b�S�e:�Let�us�abbreviate�b��ry��Q�(�n;���m;�e�)��the�form�ula����that�Ҙsa��rys��e��is�the�gcd�of��n��and��m�.�Then�there�are�certain�instances�of�induction����(sa��ry��for�simplicit�y�there�is�just�one)�����}��I�Fչ:=�UR�8�n�(�P��ƹ(�n�)��!��P��(�n����+�1))�UR�!�8�mP��(�m�)����suc��rh�z�that�in�rst�order�logic,��I��G�^��Z�ܞ��J��>��8�m;���n�9�eQ�(�n;�m;�e�).�z�Here��Z�W`�is�the�con-�����junction���of�the�non-induction�axioms�of�arithmetic.�Once�the�prop�S�er�form��rula�or����form��rulas��0�P����is�disco�v�ered,�then�resolution�driv�en�b�y�unication�can,�of�course,����nd��(the�pro�S�of.�Our�p�oin��rt�here�is�that�nding�this�pro�of�in��rv�olv�es��(as�its�main�task����the��disco��rv�ery�of�the�appropriate�instance�of�induction�to�use.�No�w�the�prop�S�ert�y�����P��p�is�H�just�a�b�S�o�olean-v��X�alued�H�function,�and�therefore�second-order�unication�can����(p�S�oten��rtially)��nd�it.�W��Ve�w�ould�try�to�unify�the�conclusion�of�the�instance�of�in-����duction,�ː�P��ƹ(�m�),�with�the�theorem�to�b�S�e�pro��rv�ed,�ːin�order�to�nd�an�instan��rtiation����of��P��ƹ.�Here��P��n�w��rould�b�S�e�regarded�as�a�v��X�ariable�(for�a�function).����!��W��Ve��seem�to�need�t��rw�o��sorts�or�t��ryp�S�es:�n�um�b�S�ers�and�functions.�But�sev�eral�sorts����(or�Eev��ren�innitely�man�y)�can�b�S�e�reduced�to�rst-order,�using�in�this�case�a�unary����predicate����N�@�(�x�)�for�the�n��rum�b�S�ers.���W��Ve�could,�if�w��re�lik�ed,�use�another�predicate�for����functions��from�n��rum�b�S�ers��to�b�o�oleans,�etc.�����2�y����UT�����#�X��^��y����(�The���distinction�b�Get���w�een���rst-order�and�higher-order�logics�is�not�as�imp�ortan���t�as�man�y����p�Geople��assume.�Syn���tactically�the�t�w�o�are�in�tertranslatable,�using�unary�predicates�to�distin-����guish��Ethe�t���yp�Ges.�The�dierence�arises�in�the��(�':

cmti10�semantics�.�The�second-order�P�eano�axioms,�for����example,��ha���v�e�an�instance�of�induction�for�eac�h�subset�of�the�in�tegers,�of�whic�h�there�are����uncoun���tably��man�y��*�.�The�rst-order�v�ersion�of�the�P�eano�axioms�has�induction�only�for�those����subsets��that�can�b�Ge�dened�b���y�rst-order�form�ulas�in�a�xed�language.�Man�y�instances�of����induction�j�are�th���us�omitted{hence�there�are�non-standard�mo�Gdels.�There�are�no�non-standard����mo�Gdels�+?of�the�second-order�P���eano�axioms,�as�P�eano�himself�pro�v�ed:�these�axioms�c�haracterize�����=�����R�����=�Solving��fF��eor�F�unctions����������!���P��reople���sa�y�that�Otter�\can't�do�induction".�But�induction,�with�resp�S�ect�to�����rst-order�QKform��rulae,�just�in�v�olv�es�deduction�from�rst-order�axioms,�and�Otter����is� as�go�S�o�d� at�that�as�at�an��ry�other�kind�of�rst-order�logic.�If�the�user�is�willing����to��5sp�S�ecify�what�instances�of�induction�are�required,�those�instances�can�b�e�giv��ren����as�2�axioms�to�Otter,�suitably�Sk��rolemized,�and�Otter�can�nd�the�pro�S�of,�at�least����in�K5some�examples�I�Kha��rv�e�K5tried.�What�Otter�cannot�do�is�nd�the�correct�instance����of�6�induction.�This�is�a�problem�in�\solving�for�functions",�since�the�instance�of����induction��to�b�S�e�found�is�a�b�o�olean-v��X�alued�function.�In�some�cases,�second-order����unication��can�nd�the�required�instance.����!��One�Jproblem�here�is�that�w��re�often�w�an�t�to�pro�v�e�a�quan�tied�statemen�t����b��ry��9induction.�F��Vor�example�in�the�case�of�the�existence�of�gcds,�the�conclusion�����Q�(�n;���m;�e�)��in��rv�olv�es�a�quan�tier.�The�general�plan�in�automated�deduction�has����b�S�een��to�replace�quan��rtiers�b�y�functions.�Usually�this�is�done�b�y�using�sym�b�S�ols�for����Sk��rolem�Vkfunctions.�But�if���-terms�are�in�use,�it�is�p�S�ossible�to�deal�with�quan�tiers����more�mdirectly��V,�using�second-order�unication�to�guide�the�pro�S�of.�W�e�amplify�this����p�S�oin��rt��in�detail�in�a�subsequen�t�section.��#V���Second-order�ffunication��1ȍ��W��Ve���fo�S�cus�on�the�attempt�to�extend�unication�to�instan��rtiate�v��X�ariables�for�func-����tions�b��ry�means�of���-terms.�This�is�lo�S�osely�kno�wn�as��higher-or��ffder�P�unic�ation�.�It����has�w�b�S�een�pursued�in�the�past�in�the�con��rtext�of�formal�systems�based�on�t�yp�S�ed������-calculus,��(so�that�functions�and�functionals�of�an��ry�\nite�t�yp�S�e"�can�b�e�consid-����ered.�CIW��Ve�call�our�unication�\second-order"�since,�formally�,�w��re�prefer�a�frame-����w��rork���without�t�yp�S�es.�This�is�not�essen�tial;�our�w�ork�can�b�S�e�em�b�S�edded�in�sev�eral����dieren��rt��formalisms.�In�(�22����),�Pietrzyk�olski�ga�v�e�an�algorithm�for�second-order����unication,�iwhic��rh�w�e�here�call���-unication.�This�w�as�extended�to�t�yp�S�e�theory�in����(�23����).���Huet�sho��rw�ed���in�(�18��)�that���-uniabilit��ry�is�more�ecien�t�than���-unication,����and�Vsubsequen��rtly���-uniabilit�y�w�as�used�in�the�implemen�tation�of�Co�S�q.�Huet����pro��rv�ed��a�completeness�theorem�for���-unication�relativ��re�to�t�yp�S�ed���-calculus.����!����-unication,�� and�the�completeness�theorem�for�it,�are�for�t��ryp�S�ed���-calculus����without��denition�b��ry�cases.�If�w�e�try�to�use���-unication�to�nd�an��f���suc�h�that�����f�G��(0)�UR=�0,��sit�will�giv��re�us�t�w�o�answ�ers:��f��Q�=�UR�x:�0�and��f��=�UR�x:x�.�If�w��re�then�ask�for����an����f�鱹suc��rh�that��f�G��(0)���=�0���and��f��(1)���=�2,���neither�of�these�solutions�will�do,�and����indeed�K�no�solution�is�giv��ren�b�y�a�pure���-term.�Ho�w�ev�er,�if�w�e�lo�S�ok�for�solutions����in��rv�olving�6�if-then-else,�it�is�easy�to�dene�suc��rh�a�function.�This�example�is�a�fairly����represen��rtativ�e���one,�illustrating�the�t��rw�o���metho�S�ds�\pro��jection"�and�\imitation"����used��in�the�denition�of���-unication.����!��In��(�8���),�a�notion�of�second-order�unication�is�giv��ren�that�allo�ws�the�construction����of��functions�using�denition�b��ry�cases.�Here�w�e�call�this�notion�D-unication,�to����distinguish��Tit�from���-unication.�W��Ve�use���cases�����(�n;���m;�x;�y�n9�)��Tto�mean�\if��n�UR�=��m��T�then�����x�,��else��y�n9�".�This�unication�in��rv�olv�es��making�the�\minimal�commitmen��rt"�needed����to��smeet�the�conditions.�Th��rus,�if�w�e�use�it�to�solv�e�the�problem�of�nding��f�r�suc�h���㍑�the���in���tegers�up�to�isomorphism.�But�seman�tics�are�not�imp�Gortan�t�for�automated�deduction,����whic���h�UUis�an�inheren�tly�syn�tactic�en�terprise.�����P�����R�������M.��fJ.�Beeson�����������that��1�f�G��(0)���=�0,�the�answ��rer�w�e�get�is��f��=����x:��cases��_K�(�x;����0�;��0�;�Y��p�(�x�)),�where��Y�O��is�a�����fresh�l�v��X�ariable.�In��rtuitiv�ely�l�this�means,�\if��x�UR�=�0�l�then�0,�else�undetermined".�Here����\undetermined"�b�is�dieren��rt�from�\undened",�but�the�idea�is�similar�to�\not�y�et����dened".���It�means�that�further�v��X�alues�of��f�ʹcan�b�S�e�sp�ecied�b��ry�instan�tiating�the����new�O�v��X�ariable��Y��p�.�This�answ��rer�is�\more�general"�than�the�t�w�o�answ�ers��x:�0�and�����x:x��7�giv��ren�b�y�Huet's�algorithm,�in�the�sense�that�they�can�b�S�e�obtained�from�it�b�y����instan��rtiating����Y�J��in�dieren�t�w�a�ys.�In�(�8���),�a�most-general-unier�theorem�is�pro�v�ed,����according�O[to�whic��rh,�if�terms��t��and��s��(sa�y�in�t�yp�S�ed���-calculus�with�denition����b��ry�t�cases)�unify�at�all,�then�they�ha�v�e�a�unique�most�general�unier.�This�is����a���satisfying�generalization�of�the�most-general-unier�prop�S�ert��ry�of�Robinson's����\ordinary"��unication.����!��An�hgimp�S�ortan��rt�idea�in�D-unication�is�that�of��r��ffestrictions��on�a�v��X�ariable.�A����restriction�k�is�a�pair�consisting�of�a�v��X�ariable�and�a�(p�S�ossibly�empt��ry)�list�of�con-����stan��rts.�z�Note�that�if�a�problem�expressed�in�rst-order�logic�using�quan�tiers����is��^con��rv�erted�to�clausal�form,�some�of�the�originally-b�S�ound�v��X�ariables�are�con-����v��rerted�-�to�constan�ts,�so�the�concept�\constan�t"�here�includes�what�sometimes����are�v�called�\ob��ject�v��X�ariables",�and�the�concept�\v�ariable"�here�includes�what�is����sometimes��called�\meta��rv��X�ariable".�The�idea�is�that�the�list�of�constan�ts�paired����with�ǒ�x��are��forbidden��Cto��x�.�����2�z���	��Unication�ǒis�not�allo��rw�ed�ǒto�assign�a�v��X�ariable��x��a����v��X�alue�(Xthat�con��rtains�a�constan�t�forbidden�to��x�.�T��Vo�mak�e�this�sensible,�the�input����to��mthe�unication�algorithm�has�to�include�an��envir��ffonment�,�whic��rh�is�a�nite�list����of�u�restrictions.�Since�D-unication�can�in��rtro�S�duce�new�v��X�ariables,�not�men�tioned����in�0mthe�input�en��rvironmen�t,�0mthe�output�of�the�unication�algorithm�is�not�only�a����substitution��but�also�an��output�6�envir��ffonment�.�The�substitution���\�unies��t��and��s�����relativ��re���to�en�vironmen�t��E�]��if�for�some�substitution����whose�restriction�to��E��is����the�57iden��rtit�y��V,�w�e�ha�v�e��t�n9��;�=��s��.�57That�is,�it�is�p�S�ossible�to�extend����p�to�giv��re�the����new�nv��X�ariables�v�alues�suc��rh�that,�under�the�extended�substitution,��t��and��s��b�S�ecome����equal.����!��W��Ve��\will�state�the�most-general-unier�theorem,�whic��rh�is�the�nicest�prop�S�ert�y����of��OD-unication.�Before�the�theorem�can�b�S�e�stated,�the�notion�of�\most�general����substitution"���m��rust�b�S�e�dened.�Here�are�the�denition�and�the�theorem,�tak�en����from��(�8���).��������Denition:���R���Giv��ren��an�en�vironmen�t��E���,���C<�is�more�general�than���,�relativ�e�to��E���,�if����there�jis�a�substitution������suc��rh�that���S��F��=��f���on��E���.�That�is,�for�all�v��X�ariables��X��in����the�մen��rvironmen�t��E���,�w�e�ha�v�e��X���S������P���������԰�����=������J�X��.�Here��p�����P���UR����԰���n9�=��������q�C�means��px�UR�=��q�n9x�,�where��x��is����a��v��X�ariable�not�in��p��or��q�n9�.�����R��ffemark�.�VIn�this�denition,�the�phrase�\�px�UR�=��q�n9x�"�Vmeans�that��px�UR�=��q�x�V�is�pro��rv��X�able����in��the���-calculus�with�denition�b��ry�cases�(b�S�e�it�a�t�yp�S�ed�v�ersion�or�the�un�t�yp�S�ed����theory���-D�considered�in�(�8���)).�������#�X��^��z����(�T��*�ec���hnically�,�F�one�has�to�decide�whether��
�b>

cmmi10�x��in��x:t��is�a�v��q�ariable�or�a�constan�t.�Conceptually����it��5is�constan���t,�since�unication�cannot�assign�it�a�v��q�alue.�But�if�one�tak�es�that�seriously��*�,�one����m���ust�2�constan�tly�b�Ge�replacing�v��q�ariables�b�y�constan�ts�and�vice-v�ersa�when�����-reduction�remo�v�es������.�UUIn�the�Otter�implemen���tation�w�e�do�not�do�this.�����`������R�����=�Solving��fF��eor�F�unctions�������������Theorem���0.1:���kU��[Most�`�general�unier]���L��ffet��E�?6�b�e�an�envir�onment�and��p��and��q������normal�Ňterms.�Supp��ffose�that�for�some�substitution����le�gal�for��E���,��p��and��q�n9��ar��ffe����identic��ffal.�SThen�D-unic�ation�terminates�suc�c�essful���ly�on�inputs��E���,�p�,�and��q�n9�,�and����the�35answer�substitution�is�le��ffgal�for��E���,�and�mor�e�gener�al�than���S��.��$���Comparison�ffof�D-unication�and��C��g�ffcmmi12�C�-unication������The�|uniqueness�of�the�result�of�D-unication,�and�the�most-general-unier�theo-����rem,���ma��ry�seem�puzzling�in�view�of�the�man�y-v��X�aluedness�of���-unication.�As�the����author��Sof�(�8���),�I��Rreceiv��red�a�n�um�b�S�er�of�inquiries�ab�out�this�p�oin��rt.�Is���-unication����man��ry-v��X�alued�1�only�b�S�ecause�of�examples�lik�e�the�one�ab�S�o�v�e�(in�whic�h�it�seems�that����the���reason�is�o��rv�er-sp�S�ecication���of�the�unier),�or�also�for�other,�p�ossibly�more����fundamen��rtal��{reasons?�Ho�w�do�the�t�w�o�theorems�(completeness�of�Huet's�algo-����rithm�LAand�most-general-unier�theorem)�a��rv�oid�LAcon�tradicting�eac�h�other?�The����purp�S�ose��of�this�section�is�to�answ��rer�these�questions.����!��Let�h�us�consider�the�statemen��rt�of�the�theorems�carefully��V.�The�h�yp�S�othesis�of�the����most-general-unier��theorem�of�(�8���)�is�that��t��and��s��are�giv��ren�normal�terms,�and����there���is�a�substitution���m�suc��rh�that��t��and��s��are�iden��rtical.�In�that�case,�sa�ys�the����theorem,�9�there�is�a�most�general�unier.�The�terms��t��and��s�,�as�w��rell�as�the�unier,����can�k�in��rv�olv�e�denition�b�y�cases.�What�if�w�e�replace�the�h�yp�S�othesis�that��t��o�and��s�����are��iden��rtical�b�y�the�w�eak�er�requiremen�t�that��t�[l�and��s��are�pro��rv��X�ably�equal�(i.e.,����in�gaview�of�Ch��rurc�h-Rosser,�gathey�ha��rv�e�gathe�same�normal�form)?�Is�the�theorem�still����true?�z�Also,�if��t��and��s��are�pro��rv��X�ably�equiv�alen��rt�in��d�-calculus,�are�they�necessarily����uniable?��These�questions�are�not�answ��rered�in�(�8���).����!��The���completeness�theorem�for���-unication�has�the�w��reak�er���h�yp�S�othesis,�that�����t��޹and�;P�s��ha��rv�e�the�same�normal�form,�but�neither�the�terms��t��and��s��nor����޹can����in��rv�olv�e��n�cases�.�The�conclusion�is�that�there�is�a�complete�set�of�uniers�(a�CSU)����for��D�t��and��s�,�i.e.�ev��rery�unier�is�more�general�than�some�substitution�in�the�CSU.����The��CSU�can�b�S�e�innite.����!��It��5will�b�S�e�instructiv��re�to�consider�an�example�from�(�22����),�whic�h�w�as�also�con-����sidered��.in�(�18����),�and�compare�ho��rw�the�example�is�treated�b�y���-unication�and����D-unication.��The�example�is�the�unication�of��F��ƹ(�F��(�X��))��with��a�(�a�(�b�)).�Here��F�����and��N�X��ѹare�v��X�ariables�and��a��and��b��are�constan��rts.���cases��"M��-unication�nds�(only)����the�"�solution��f�F�
0�:=�hj�a;���X�Y�:=��b�g�.�"���-unication�nds�this�solution,�and�also�the����solution�O?�f�F��P�:=���u:a�(�a�(�b�))�;���X��
�:=��b�g��(here��F���is�a�constan��rt�function)�and�the�so-����lution�^��f�F����:=��u:u;���X�h�:=��a�(�b�)�g��(here��F���is�the�iden��rtit�y�function).�The�details�of����the���calculation�for���-unication�are�on�p.�42�of�(�18����).�����2�x����ӹThe�example�brings�to�the����fore���the�fact�that�D-unication�has�no�clause�in�its�denition�that�applies�to�the����case�]\of��F��ƹ(�t�),�where��t��is�a�comp�S�ound�term�con��rtaining�v��X�ariables�forbidden�to��F��,����suc��rh��#as�(in�this�case)��F�*�itself.�Therefore�only�the�\Robinson�clause"�(whic�h�is����the��Psame�as�rst-order�unication)�applies�to�this�example,�whic��rh�is�wh�y�w�e�get����only��the�rst�solution.��UT�����#�W��^��x����(�There��`is�a�tec���hnicalit�y��`ab�Gout�whether���[ٲ-reduction�is�used�in���-unication�or�not.�It�is�used����in�|>(�22��
).�If�it�is�not�used,�as�in�(�18��),�w���e�get�one�more�solution,��
!",�

cmsy10�f�F�k��:=��u:a�(�u�)�;���X��Ӳ:=��b�g�,�|>whic�h����is�UU��[ٲ-equiv��q�alen���t�to��f�F�*��:=���a;���X����:=��b�g�.�����	q������R�������M.��fJ.�Beeson����������!���This���example�sho��rws�that�the�most�general�unier�theorem�for�D-unication�����dep�S�ends��critically�on�the�h��ryp�othesis�that��t�i;�and��s��are�iden��rtical,�not�just����O�-����con��rv�ertible.���T��Vo�see�this,�tak��re��t��to�b�S�e��F��ƹ(�F��(�X��))���and��s��to�b�e��a�(�a�(�b�)).�T��Vak��re���$�to�b�e����the�#)second�solution�substitution�ab�S�o��rv�e.�#)Then��t��b�and��s��are�b�S�eta-con��rv�ertible,�#)but����it���is�not�the�case�that����is�more�general�than��f�F���:=�UR�a;���X�Fչ:=��b�g�;���indeed�since�this����substitution���has�constan��rts�on�the�righ�t,�it�is�not�more�general�than�an�y�other����substitution.����!��An�4]ev��ren�simpler�example�can�b�S�e�giv�en�to�sho�w�that�the�most�general�unier����theorem���fails�if�w��re�c�hange�the�h�yp�S�othesis�to�\�t�-5�and��s��are����O�-con��rv�ertible"���instead����of�|\iden��rtical".�Consider�the�unication�problem��X��(�t�)�UR=��t�,�|where��t��is�a�comp�S�ound����term.�TThen�D-unication�do�S�es�not�succeed,�as�there�is�no�clause�in�the�denition����that�m�applies.�But�if�w��re�tak�e����r�to�b�S�e�the�substitution��f�X�&6�:=�4��x:x�g�,�then��X��(�t�)������is�ڳ���O�-con��rv�ertible�to��t�S��.�This�w�ould�b�S�e�a�coun�terexample�to�the�theorem�with�the����c��rhanged��h�yp�S�othesis.��!D퍑�Implemen���tation�ffin�Otter�������D-unication���has�earlier�b�S�een�implemen��rted�in�a�bac�kw�ards-Genzten�theorem����pro��rv�er��(�9���).�Ho��rw�ev�er,��that�pro��rv�er��is�not�as�strong�or�robust�as�Otter,�and�the����w��rell-kno�wn�n�p�S�o�w�ers�of�Otter�should�w�ork�w�ell�in�com�bination�with�D-unication.����Implemen��rtation�Aof�this�algorithm�in�the�source�co�S�de�of�the�theorem-pro�v�er�Otter����is���w��rell�under�w�a�y�at�the�time�of�writing�(August�2002).�There�are�some�additional����factors:�f!Otter�already�has�a�large�user�comm��runit�y��V,�f!so�implemen��rtation�in�Otter����will�Ћmak��re�D-unication�readily�a�v��X�ailable,�without�an�y�one�ha�ving�to�learn�a�new����system.�HAlso,�Fitelson�and�Harris�ha��rv�e�Hwritten�a�Mathematica�in��rterface�to�Otter����(priv��X�ate��comm��runication),�whic�h�can�b�S�e�used�to�connect��The��ffor�ema�꨹to�Otter.����!��The�?�implemen��rtation�had�to�b�S�egin�with�adding���-calculus�to�Otter.�Reserv�ed����w��rords����I߆�Tcmtt12�Ilambda��and��Iap��(or�synon�ymously��IAp�)�are�used�for�this�purp�S�ose.�One�uses�����Ilambda(x,ap(f,x))��-�to�en��rter�the�term��x:f�G��(�x�).�Beta-reduction�has�b�S�een�imple-����men��rted�Nin�the�framew�ork�Otter�uses�for�demo�S�dulation.�T��Vec�hnicalities�necessary����to��ka��rv�oid�clash�of�b�S�ound�v��X�ariables�ha�v�e�b�S�een�successfully�dealt�with.�The�follo�wing����Otter��kpro�S�of�sho��rws�a�b�eta-reduction�com��rbined�with�an�ordinary�demo�dulation,����giv��ren��the�demo�S�dulator��x������x�UR�=��x�.��The�theorem�pro�v�ed�is�� Ӎ��(�x:x������x�)�c�UR�=��c:�����Of�P^course�the�pro�S�of�is�trivial:�it�is�only�mean��rt�to�demonstrate�the�successful�����implemen��rtation�z+of����O�-reduction�w�orking�more�or�less�the�same�w�a�y�as�ordinary����demo�S�dulation�ʘin�a�rst-order�theorem-pro��rv�er.�ʘLine�3�of�the�pro�of�is�the�nega-����tion��2of�the�goal.�The�rst�t��rw�o��2lines�are�axioms.�The�pro�S�of�completes�with�the����deriv��X�ation��of�a�con��rtradiction.��7̍��I1�,�[]�x=x.����2�,�[]�x*x=x.����3�,�[]�ap(ap(lambda(x,lambda(y,x)),c*c),y)!=c.����4�,�[3,demod,2,beta,beta]�c!=c.����5�,�[binary,4.1,1.1]�.�����
������R�����=�Solving��fF��eor�F�unctions�����������Quan���tication�ffin�a�clausal�theorem-pro�v�er��jT���In��kthis�section�w��re�sho�w�ho�w�to�treat�quan�tication�in�Otter,�at�the�clause�lev�el,�����based�Ձon�the�mac��rhinery�of���-calculus�and�second-order�unication.�An�example����pro�S�of��will�b�e�w��rork�ed��through�in�detail.����!��One��ocan�regard��9��as�a�b�S�o�olean-v��X�alued��ofunctional,�whose�argumen��rts�are�b�S�o�olean����functions�3'(dened,�for�simplicit��ry��V,�on�the�in�tegers,�let's�sa�y).�Then��9�n:P��ƹ(�n�)�is����an��abbreviation�for��9�(�n:P��ƹ(�n�)),�or�more�explicitly��V,��Ap�(�9�;���n:P��(�n�)).�It�is�then����p�S�ossible���to�w��rork�with�quan�tied�statemen�ts�directly�in�Otter{that�is,�in�the����v��rersion��of�Otter�that�is�enhanced�with���-calculus.����!��W��Ve�qNwill�sho��rw�exactly�ho�w�this�is�done.�In�the�presence�of���-calculus,��9��is����treated��as�a�constan��rt.�The�rule�for�dealing�with��9��in�Otter�is��Ҡ���I-Ap(Z,w)�,�|�exists(lambda(x,�Ap(Z,x))����!���This�-�w��rorks�in�Otter�as�follo�ws:�if��Z�ܞ�(�t�)�can�b�S�e�pro�v�ed�for�an�y�term��t�,�then�����the�literal���Ap�(�Z�5�;���x�)�will�b�S�e�resolv��red�a�w�a�y��V,�using�the�substitution��x�{b�:=��t�.�Then�����9�(�x:Z�ܞ�(�x�))�P�is�deduced,�whic��rh�can�b�S�e�abbreviated�to��9�x:Z��(�x�).�No�mac��rhinery�is����added��to�Otter�to�accomplish�this,�other�than�what�has�already�b�S�een�added�for������-calculus.����!��This���will�p�S�ermit�the�use�of�denitions�that�explicitly�in��rv�olv�e���a�quan��rtied�for-����m��rula��in�the�denition.�F��Vor�example,�w�e�could�dene��Ҡ���Idivides(u,v)�,�=�exists(lambda(x,u*x�=�v)).����!���No��rw,�Lzgiv�en�the�clause�2��A���3���=�6,�Otter�can�deduce��Idivides(2,6)��as�follo��rws:�����First,��the�negated�goal��I-divides(2,6)��will�rewrite�to����!���I-exists(lambda(x,2*x�,�=�6))�.����!��This���will�unify�with��Iexists(lambda(x,Ap(Z,x))��if��I2*x=6��will�unify�with�unify����with���IAp(Z,x)�.�Second-order�unication�(with��x��forbidden�to��Z�ܞ�)�will�nd���L����
�Z�1�=�UR�w�R�:�(2������w����=�6��_��Y��p�(�w�R��))����where����Y�\i�is�a�new�v��X�ariable.�Resolution�of�the�t��rw�o���clauses�con��rtaining��Iexists��will�����then�k�generate�a�new�clause�con��rtaining�the�single�literal���Ap�(�Z�5�;���w�R��)�with�this����v��X�alue��of��Z�ܞ�.�Sp�S�ecically��V,���L����(��Ap�(�w�R�:�(2������w����=�UR6��_��Y��p�(�w��))�;���w��)�:�����That�I�will�b�S�e����O�-reduced�to���(2��n���w�I�=��A6��_��Y��p�(�w�R��))�I�so�the�clause�nally�generated�����will��b�S�e��I-or(2*w�,�=�6,�Y(w))�.��Demo�dulation�can�apply�to�a�negated�literal�under����these��>circumstances�and�pro�S�duce�t��rw�o��>new�clauses,��I-(2*w�,�=�6)��>�and���Y��p�(�w�R��).�����2�{���i
�The����rst�U�of�these�resolv��res�with�2�����3�k=�6,�U�pro�S�ducing�a�con�tradiction�that�completes����the��pro�S�of.��)������"����^��{����(�Demo�Gdulation��tec���hnically�leads�from�term�to�term,�or�clause�to�clause.�W��*�e�refer�here�to����a��Mgeneralized�v���ersion�of�demo�Gdulation�whic�h�treats�certain�functors,�suc�h�as��J��<x

cmtt10�Jor�,�sp�Gecially��*�.�It����also�UUincorp�Gorates�����-reduction.������������R�������M.��fJ.�Beeson�����������Tw���o�ffsimple�examples������The�rst�example�is�the�follo��rwing�theorem:�If��a�M��6�=��b�,�there�exists�a�predicate�����whic��rh�|is�true�on��a��and�false�on��b�.�The�input�le�con�tains�some�equations�for������cases��8��as���w��rell�as�the�clauses��Ia�,�!=�b����and��I-Ap(X,a)�,�|�Ap(X,b)�,���whic�h�is�the����w��ra�y�RWw�e�write��:�X��(�z���)�M��_��X��(�b�)�RWin�Otter.�The�inference�rules�are�binary�reso-����lution���and�paramo�S�dulation.�The�binary�resolution�rule�has�b�een�mo�died�so����that��a�term��X��(�a�)�or�its�negation�can�alw��ra�ys��b�S�e�unied�with�the�constan��rt��I$F�,����whic��rh�fis�Otter's�name�for�falsit�y��V.�Unifying��I-Ap(X,a)��with��I$F��Otter�nds��IX�,�=����lambda(x,cases(x,a,$T,Ap(Y,x))�,͹,���where��IY��ιis�a�new�v��X�ariable.�The�result�of����the�-)binary�resolution�step�is��IAp(lambda(x,cases(x,a,$T,Ap(Y,x)),b)�.�This����b�S�eta-reduces�7to��Icases(b,a,$T,Ap(Y,b))�.�But�b�efore�this,�Otter�has�already�de-����duced�Ob�Icases(b,a,x,y)�,�=�y�.�Since�w��re�ha�v�e�set�the�option��Iknuth-bendix�,�whic�h����turns� �on�paramo�S�dulation,�this�previously-deduced�equation�is�used�as�a�demo�du-����lator,�\�and�our�new�clause�demo�S�dulates�to��IAp(Y,b)�.�This�clause�then�unies�with�����I$F�,�W,pro�S�ducing��IY�,�=�lambda(y,cases(y,b,$F,Ap(Z,y))�.�W,The�resolv��ren�t�W,is�the����empt��ry��clause,�completing�the�pro�S�of.�The�v��X�alue�of�the�function�found�is,�after�b�eta-����reduction,��p�IX�,�=�lambda(x,cases(x,a,$T,cases(x,b,$F,�Ap(Z,x))))�.�In��rtuitiv�ely��V,����this��function�is�true�on��a�,�false�on��b�,�and�elsewhere�undetermined.����!��Our�Nsecond�example�is�to�pro��rv�e�Nthe�existence�of�the�iden��rtit�y�Nfunction.�The����goal�i�is��9�F����8�x�(�x�-�=��Ap�(�F�S�;���x�)).�i�T��Vraditionally�,�to�form��rulate�a�problem�of�the�form�����9�x�8�y�n9P��ƹ(�x;���y��)�for�Otter,�one�w��rould�in�tro�S�duce�a�Sk�olem�function��g�n9�,�and�write�the����negated�e�goal�as��:�P��ƹ(�x;���g�n9�(�x�)).�By�comparison,�in�a�bac��rkw�ards�e�Gen�tzen�pro�v�er����(suc��rh�7Xas�w�as�used�in�(�9���)),�one�w�ould�c�hange��y����to�a�constan�t�forbidden�to��x�,����and�&the�negated�goal�(whic��rh�one�do�S�es�not�ha�v�e�to�negate�in�suc�h�a�pro�v�er,�but����w��re���negate�it�for�comparison�to�Otter)�w�ould�b�S�e��:�P��ƹ(�x;���c�),�with��c��forbidden�to�����x�.�E�In��rtuitiv�ely��V,�these�t�w�o�goals�are�similar,�since��g�n9�(�x�)�functions�more�or�less�the����same�dxas�a�constan��rt�forbidden�to��x�.�It�is�lik�e�an�arbitrary�constan�t�b�S�ecause�the����Sk��rolem�C�function�is�not�further�sp�S�ecied{�g�n9�(�x�)�could�b�e�an��ry�arbitrary�v��X�alue{and����it��is�\forbidden�to��x�"�b��ry�the�o�S�ccurs�c�hec�k�in�unication.����!��W��Ve��tak��re�the�negated�goal�in�the�form��:�P��ƹ(�x;���c�),�with��c��forbidden�to��x�.�In�our����example��athis�is��c����6�=��Ap�(�F�S�;���c�).��aW��Ve�resolv��re�this�with�the�equalit�y�axiom��x��ٹ=��x�.����First�e��x��is�giv��ren�the�v��X�alue��c�.�Then�w�e�ha�v�e�to�unify��Ap�(�F�S�;���c�)�with��c�,�where��c��is����forbidden���to��F��ƹ.�The�denition�of�D-unication�tells�us��F���:=�UR�x:�(�x�%��_��Y��px�),���where�����Y����is��%a�new�v��X�ariable.�The�succesful�unication�deriv��res�a�con�tradiction�b�y�binary����resolution��and�completes�the�pro�S�of�of�the�theorem.����!��On���the�other�hand,�if�w��re�tak�e�the�Sk�olemized�v�ersion�of�the�negated�goal,�w�e����ha��rv�e���to�unify��Ap�(�F�S�;���g�n9�(�F��ƹ))�with��g��(�F��ƹ),�where��g�m�is�a�Sk��rolem�function.�W��Ve�ha�v�e����discussed��wthis�shortcoming�(b�S�eing�unable�to�unify��X��(�t�)�with��t�)�in�an�earlier����section.���Un��rtil�this�dicult�y�is�o�v�ercome,�w�e�use�constan�ts�forbidden�to��F��H�when����con��rv�erting��a�theorem�to�clausal�form.�����������R�����=�Solving��fF��eor�F�unctions�����������A�ffmore�mathematical�example:�Lagrange's�theorem��x?���In��\this�section�w��re�use�D-unication�to�w�ork�out�the�most�imp�S�ortan�t�details�of�the�����pro�S�of��of�the�algebraic�part�of�Lagrange's�theorem:�the�existence�of�a�one-to-one����corresp�S�ondence��b�et��rw�een��H���and�the�coset��H��Va�,�where��a�UR�2��G�.����!��T��Vo�K�prepare�this�for�Otter,�w��re�use�a�unary�predicate��G�(�x�)�for�the�group��G�,�a����unary���predicate��H��V�(�x�)�for�the�subgroup��H��,�and�include�the�axioms�that�assert����that��9�G��is�a�group�under����with�iden��rtit�y��9�e��and�in��rv�erse��9�i�(�x�),�and�that��H����is�closed����under�����and�in��rv�erse,��and��H��V�(�x�)�implies��G�(�x�).�W��Ve�also�include�the�follo��rwing:��A�,��I-Ap(Z,w)�,�|�exists(lambda(x,Ap(Z,x))).����G(a).����!���No��rw��consider�ho�w�to�formalize�the�coset��H��Va�.�W��Ve�ha�v�e��I�����z�{�H��Va��������=���������f�ha�j�h�UR�2��H��V�g������������=���������f�w����:�UR�9�h:�(�h��2��H����^����h����a�UR�=��w�R��g�����������=���������w�R�:�(�9�h:�(�h�UR�2��H����^����h����a�UR�=��w��)����������=���������w�R�:�(�9�(��(�h;���H��V�(�h�)����^��h����a�UR�=��w��)))������!��W��Ve��put�this�in��rto�Otter�using�a�function�sym�b�S�ol��Iha�,�as�follo�ws:��A��Iha(w)�,�=�exists(lambda(h,�and(H(h),�h*a�=�w))).����!���W��Ve��kuse�this�as�a�demo�S�dulator,�so�that�it�will�b�e�used�to�rewrite�an��ry�literal�����-ha(t)�_�that�arises.�Suc��rh�a�literal�w�ould�then�resolv�e�with�existen�tial�axiom,�using����D-unication,��and�the�resulting�substitution�w��rould�yield��A��IZ:=�,�lambda(h,�or(and(H(h),h*a�=�t),�Ap(Y,h)))����!���where��Y���is�a�new�v��X�ariable.�����!��No��rw,���for�simplicit�y��V,�w�e�b�S�egin�b�y�pro�ving�that�there�is�a�function��F�BS�from��H���to�����H��Va�,���without�w��rorrying�ab�S�out�the�one-to-one�and�on�to�part�y�et.�The�goal�is�then�����������9�F����8�x�(�x�UR�2��H�B��!��Ap�(�F�S�;���x�)��2��H��Va�)������!��Instead��of�Sk��rolemizing��x�UR�=��g�n9�(�F��ƹ),��w�e�replace��x��b�y�a�constan�t�that�is�forbidden����to��F��ƹ.�The�negated�goal�b�S�ecomes�the�t��rw�o��clauses��A��IH(c).����-ha(Ap(F,c)).�����As�̎sho��rwn�ab�S�o�v�e,�the�literal��I-ha(Ap(F,c))��demo�S�dulates�and�resolv�es�with�the����existen��rtial��axiom;�the�unication�pro�S�duces�the�substitution��Qu���IZ:=�,�lambda(h,�or(and(H(h),h*a�=�Ap(F,c)),�Ap(Y,h)))�����
�ޠ����R�������M.��fJ.�Beeson�����������and��the�resolution�pro�S�duces�the�unit�clause��RӍ��I-Ap(lambda(h,or(and(H(h),h*a�,�=�Ap(F,c)),�Ap(Y,h))),w).����!���This��clause�ho��rw�ev�er��is�not�stored�y��ret,�b�S�ecause�it����O�-reduces�to�����I-or(and(H(w),w*a�,�=�Ap(F,c)),Ap(Y,w))).����!���Demo�S�dulators��zare�used�to�implemen��rt�de�Morgan's�la�ws,�so�this�will�demo�S�dulate�����to��0the�t��rw�o��0clauses��I-H(w)�,�|�w*a�!=�Ap(F,c)��0�and��I-Ap(Y,w)�.�No��rw�w�e're�getting����somewhere!���The�literal��I-H(w)��resolv��res�with��IH(c)�.�The�inferred�clause�is��c�k����a�!�UR=�����Ap�(�F�S�;���c�).���The�single�literal�in�this�clause�can�b�e�unied�with�the�equalit��ry�axiom�����x����=��x�.��eThis�results�in�unifying��c�:����a��e�with��Ap�(�F�S�;���c�).�Since��c��is�forbidden�to��F��ƹ,����the��^answ��rer�substitution�is��F��2�:=��l�x:x�I���a��_��Y��p�(�x�).��^If�w�e�tak�e��Y�}ܹ=��l�x:��false���u�w�e����ha��rv�e����F���=�UR�x:x�A���a��(since��u��_���false���y�=�UR�u�,�ev��ren�if��u��is�not�Bo�S�olean).��x:x����a��is�the����desired�?qmap�from��H�,ǹto�the�coset��H��Va�.�The�pro�S�of�that�it�is�one-to-one�and�on��rto����is��relativ��rely�straigh�tforw�ard.��"ij���Related�ffw���ork���y���The�9�pioneer�of�the�actual�use�of�second-order�unication�w��ras�Huet�(�18����).�It�has����b�S�een�D�implemen��rted�in�Co�q,�whic��rh�is�describ�ed�in�(�3���)�as�w��rell�as�n�umerous�do�S�cu-����men��rts�i+a�v��X�ailable�from�the�Co�S�q�w�eb�page.�There�are�man�y�existing�implemen�ta-����tions��&of�higher-order�logic,�including:���-prolog�(�20����);�PVS,�whic��rh�is�b�S�eing�used����at���SRI��{under�the�direction�of�N.�Shank��X�ar�(�21����);�HOL-Ligh��rt,�whic�h�w�as�written����b��ry��KJohn�Harrison�(�16����;��17��}C)�and�is�curren�tly�b�S�eing�used�b�y�him�at�In�tel's�P�ort-����land���facilit��ry;�NuPrl,�dev�elop�S�ed�at�Cornell�under�the�direction�of�Constable�(�14����);����and��the�F��Vrenc��rh�system�Co�S�q�dev�elop�S�ed�at�INRIA,�whic�h�is�also�b�S�eing�used�in����Nijmegen.��*These�systems�(if�they�implemen��rt�higher-order�unication�at�all)�use������-unication,�Lorather�than�D-unication,�and�they�are�primarily�pro�S�of-c��rhec�k�ers,����not�1�pro�S�of-nders.�W��Ve�b�eliev��re�that�D-unication�oers�greater�p�o��rw�er�1�and�e-����ciency��V,�D�as�do�S�es�the�use�of�the�industrial-strength�clausal�theorem�pro��rv�er�D�Otter.����A��pro�S�of�of�Lagrange's�theorem�has�b�een�c��rhec�k�ed��b�y�the�use�of�Nqthm�(�25����).����!��Some�sEy��rears�ago,�Quaife�used�Otter�to�formalize�set�theory�using�a�nite�ax-����iomatization�>�due�in�essence�to�G�� odel-Berna��rys.�He�then�used�set�theory�to�form�u-����late��<P��reano�arithmetic,�and�he�succeeded�in�pro�ving�the�fundamen�tal�theorem�of����arithmetic��((�24����).�Belinfan��rte,�building�on�Quaife's�b�S�eginning,�has�carried�forw�ard����the��formal�dev��relopmen�t��of�set�theory�from�rst�principles,�pro��rving�thousands�of����theorems��in�Otter�(�10����;��11����);�see�also�Belinfan��rte's�w�eb�site.��"ij���References���y������[1]���.'Agra��rw�al,�F�M.,�Saxena,�N.,�and�Ka��ry�al,�F�N.,�PRIME�FFis�in�P��V,�a��rv��X�ailable�from����.'�Ihttp://www.cse.iitk.ac.in/news/primality.html��p񍍍���[2]���.'Barendregt,���H.,��The��L��ffamb�da�Calculus:�Its�Syntax�and�Semantics�,���Studies����.'in���Logic�and�the�F��Voundations�of�Mathematics��103�,�Elsevier�Science�Ltd.����.'Revised��edition�(Octob�S�er�1984).�����������R�����=�Solving��fF��eor�F�unctions��������������[3]���.'Barendregt,�J�H.,�and�Geuv��rers,�H.,�Pro�S�of-Assistan�ts�Using�Dep�S�enden�t�T�yp�S�e�����.'Systems,��in:�Robinson,�A.,�and�V��Voronk��ro�v,��A.�(eds.),��Handb��ffo�ok�lof�A��2utomate��ffd����.'R��ffe�asoning,�35vol.�II�,��pp.�1151-1238.�Elsevier�Science�(2001).��������[4]���.'Beeson,�׬M.,�Some�applications�of�Gen��rtzen's�pro�S�of�theory�to�automated�de-����.'duction,��in�P��V.�Sc��rhro�S�eder-Heister�(ed.),��Extensions�I�of�L��ffo�gic�I�Pr�o�gr�amming�,����.'Lecture��Notes�in�Computer�Science��475��101-156,�Springer-V��Verlag�(1991).�������[5]���.'Beeson,��0M.,��K}h!�cmsl12�KMathp�S�ert�F�:�Computer�supp�ort�for�learning�algebra,�trigonom-����.'etry��V,�and�calculus,�in:�A.�V�oronk��ro�v�(ed.),�Logic�Programming�and�Auto-����.'mated��]Reasoning,�Lecture�Notes�in�Articial�In��rtelligence�624,�Springer-����.'V��Verlag��(1992).�������[6]���.'Beeson,��M.,��Mathp��ffert���Calculus�Assistant�.��This�soft��rw�are��pro�S�duct�w��ras����.'published�O�in�July��V,�1997�b��ry�Mathp�S�ert�Systems,�San�ta�Clara,�CA.�See����.'www.mathxp�S�ert.com��to�do��rwnload�a�trial�cop�y��V.�������[7]���.'Beeson,�+�M.,�Automatic�generation�of�epsilon-delta�pro�S�ofs�of�con��rtin�uit�y��V,�+�in:����.'Calmet,��SJacques,�and�Plaza,�Jan�(eds.)��A��2rticial�)�Intel���ligenc��ffe�and�Symb�olic����.'Computation:�T!International�Confer��ffenc�e�T!AISC-98,�Plattsbur��ffgh,�New�Y���ork,����.'USA,�35Septemb��ffer�1998�Pr�o�c�e�e�dings�,��pp.�67-83.�Springer-V��Verlag�(1998).�������[8]���.'Beeson,�YmM.,�Unication�in�Lam��rb�S�da�Calculus�with�if-then-else,�in:�Kirc�h-����.'ner,��XC.,�and�Kirc��rhner,�H.�(eds.),��A��2utomate��ffd�B�De�duction-CADE-15.�15th�In-����.'ternational�P�Confer��ffenc�e�on�A��2utomate�d�De�duction,�Lindau,�Germany,�July����.'1998�.Pr��ffo�c�e�e�dings�,���pp.�96-111,�Lecture�Notes�in�Articial�In��rtelligence��1421�,����.'Springer-V��Verlag��(1998).�������[9]���.'Beeson,�=�M.,�A�=Tsecond-order�theorem�pro��rv�er�=�applied�to�circumscription,����.'in:�FzGor,�R.,�Leitsc��rh,�A.,�and�Nipk�o�w,�T.�(eds.),��A��2utomate��ffd�^8R�e�asoning,����.'First�n�International�Joint�Confer��ffenc�e,�n�IJCAR�n�2001,�Siena,�Italy,�June�2001,����.'Pr��ffo�c�e�e�dings�,�r�Lecture�Notes�in�Articial�In��rtelligence��2083�,�Springer-V��Verlag����.'(2001).������[10]���.'Belinfan��rte,�TpJ.,�Computer�pro�S�ofs�in�G�� odel's�class�theory�with�equational�def-����.'initions���for�comp�S�osite�and�cross,��J.��)A��2utomate��ffd�R�e�asoning����22�,�No.�3�(1988),����.'pp.��311-339.������[11]���.'Belinfan��rte,�N�J.,�On�computer-assisted�pro�S�ofs�in�ordinal�n�um�b�S�er�theory��V,��J.����.'A��2utomate��ffd�35R�e�asoning���22�,�No.�3,�pp.�341-378.������[12]���.'Bo��ry�er,�2�R.�S.,�and�Mo�S�ore,�J.�S.,��A���Computational���L��ffo�gic�Handb�o�ok�,�2�Academic����.'Press,��Boston�(1988).������[13]���.'Buc��rh�b�S�erger,�l�B.,��et.���al.��Theorema:�An�In��rtegrated�System�for�Computation����.'and�f�Deduction�in�Natural�St��ryle,�in:��Pr��ffo�c�e�e�dings��nof�the�Workshop�on�Inte-����.'gr��ffation�35of�De�ductive�Systems�at�CADE-15,�Lindau,�Germany,�July�1998������v�����R�������M.��fJ.�Beeson�������������[14]���.'Constable,��R.�L.��et.�&.al.�,��Implementing�Mathematics�with�the�Nuprl�Pr��ffo�of�����.'Development�35System�,��Pren��rtice-Hall,�Englew�o�S�o�d��Clis,�New�Jersey�(1986).�������[15]���.'Hall,��Marshall,�Jr.,��The�35The��ffory�of�Gr�oups�,��Macmillan,�New�Y��Vork�(1959).������[16]���.'Harrison,��)J.,�and�Th��r��s�ery��V,�L.:�Extending�the�HOL���theorem�pro�v�er�with�a����.'computer�=�algebra�system�to�reason�ab�S�out�the�reals,�in��Higher�\Or��ffder�L�o�gic����.'The��ffor�em�ϹPr�oving�and�its�Applic�ations:�6th�International�Workshop,�HUG����.''93�,��-pp.�174{184,�Lecture�Notes�in�Computer�Science��780�,�Springer-V��Verlag����.'(1993).������[17]���.'Harrison,�O�J.,��The��ffor�em�f�Pr�oving�with�the�R�e�al�Numb�ers�,�O�Springer-V��Verlag,����.'Berlin/Heidelb�S�erg/New��Y��Vork�(1998).������[18]���.'G.���Huet.�AyA���unication�algorithm�for�t��ryp�S�ed���-calculus.��The��ffor�etic�al�;Computer����.'Scienc��ffe���1��27{52,�1975.������[19]���.'McCune,�
��W.:�Otter�2.0,�in:�Stic��rk�el,�
��M.�E.�(ed.),��10th�
a�Interna-����.'tional�+�Confer��ffenc�e�on�A��2utomate�d�De�duction��:�pp.�663{664,�Springer-V��Verlag,����.'Berlin/Heidelb�S�erg��(1990).������[20]���.'D.��qMiller�and�G.�Nadath��rur.�_tAn�Ov�erview�of���-Prolog�_tIn��Pr��ffo�c�e�e�dings�-of����.'the�x�Fifth�International�Symp��ffosium�on�L�o�gic�Pr�o�gr�amming,�Se�attle,�A��2ugust����.'1988�.������[21]���.'Owre,�-S.,�Rush��rb�y��V,�-J.�M.,�Shank��X�ar,�N.,�PVS:�A�-Protot��ryp�S�e�V�erication�Sys-����.'tem,�4�in:�Kapur,�D.�(ed.),��A��2utomate��ffd�b�De�duction{CADE-11,�11th�Interna-����.'tional��Confer��ffenc�e�on�A��2utomate�d�De�duction�,���748{752,�LNCS��m�607�,�Springer-����.'V��Verlag��(1992).������[22]���.'Pietrzyk��ro�wski,��T.,�and�Jensen,�D.,�A��
complete�mec��rhanization�of�second����.'order��logic,��J.�35Asso��ffc.�Comp.�Mach.���20��(2)�pp.�333-364,�1971.������[23]���.'Pietrzyk��ro�wski,�3�T.,�and�Jensen,�D.,�A�3|complete�mec��rhanization�of��!�n9�-order����.'t��ryp�S�e��theory��V,��ASso��ffc.�35Comp.�Math.�Nat.�Conf.�꨹1972,�V�ol.�1,�82{92.������[24]���.'Quaife,�1�A.,��A��2utomate��ffd�_�Development�of�F���undamental�Mathematic�al�The�o-����.'ries,�cA��2utomate��ffd�R�e�asoning,�V���ol.2�,�™Klu��rw�er�Academic�Publishers,�Dordrec�h�t����.'(1992).������[25]���.'Y��Vuan��Y�u,�Computer�pro�S�ofs�in�group�theory�,���J.�8A��2utomate��ffd�R�e�asoning���6�(3)����.'pp.��251{286,�1990.�����Ԡ���;����K}h!�cmsl12�J��<x

cmtt10�I߆�Tcmtt12�C��g�ffcmmi12�>2�@�cmbx8�=��N�ffcmbx12�*K�`y
�3
cmr10�)��N�cmbx12�(�':

cmti10��K�cmsy8�!",�
cmsy10��2cmmi8���g�cmmi12�|{Ycmr8����@cmti12��-�
cmcsc10���N�G�cmbx12�X�Qcmr12�
!",�

cmsy10�O!�cmsy7�
�b>

cmmi10�K�`y

cmr10�������

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