toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi - PDF document

toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi
toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi

toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi - Description


2 4 6CONTENTS 53steps 25 54steps 26 55contradictionsteps 28 56 ID: 512757 Download Pdf

Tags

2 4 6CONTENTS 5.3_steps.............................................. 25 5.4:steps.............................................. 26 5.5?(contradiction)steps..................................... 28 5.6

Embed / Share - toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi


Presentation on theme: "toreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsi"— Presentation transcript


NaturalDeductionProofandDisproofinJapeRichardBornat(richard@bornat.me.uk)February21,2017 2 PrefaceThismanualisahow-toforJapeandmyNaturalDeductionencoding.Earlierversionscontainedagooddealoflogicteaching.That'sbeendropped,sincenowthere'sabook(LogicforProgrammers,OUP)whichsaysitallagooddealbetter.YouwilllearnaboutlogicbyplayingwithJape,soIsupposethere'sstillteachinginthere.ThisdocumentwaswrittenonaMac,andtheillustrationsarealltakenfromtheMacOSXversionofJape.AllJapes,onLinux,Solaris,Windows,MacOSXorwhereever,runexactlythesamecodebuttheinterfacescanlookslightlydifferent.Ihaven'tproduceddifferentversionsofthemanualbecauseIthink—rather,Ihope—thatthosedifferencesinfonts,inwindowcontrols,intheplacingofmenusandsoon,don'treallymatter.IfI'mwrongthenIhopesomebodywilltellme.JapeorNDJape?ThismanualisreallyabouthowJape,whichiscapableofworkingwithmanydifferentlogics,hasbeenmadetodealwithNaturalDeductionasdescribedinmybook.Insteadoftalkingaboutwhat`Jape'doeswhendealingwith!formulae,Ishouldreallytalkaboutwhat`JapeloadedwiththeI2Lencoding'does.Butthat'ssuchamouthfulthatIjusttalkasifthereisonlyoneJape,andallitdoesisNaturalDeduction.Ifyou'reinterestedthere'samanualonthewebsite(http://www.japeforall.org.uk)whichtellsyouhowtorollyourownlogicencodings.Bestofluck.DifferencesfromthebookJapewritesitspremisesonasingleline,separatedbycommas,insteadofusingaseparatelineforeachpremise;Japewritesquanticationsas8x:P(x)and9y:Q(y)—withadotbetweenboundvariableandpredi-cate—insteadof8x(P(x))and9y(Q(y))SofarasIknow,thesearetheonlysignicantdifferences.Anycomments?IfJapedoesn'tworkforyou,itisn'tworking,andifitisn'tworkingI'dliketohearaboutit.Pleasesendanycomments,thoughts,complaintsorwhatevertome(seetitlepageforemailaddress).I'lldomybesttoreplyquicklyandifyourmessageisofgeneralinterestI'llputituponthewebsite(withyourpermission,andhidingyouremailaddressfromthespambotsatleast).3 4AcknowledgementsIdesignedandbuiltJapebetween1991and2002whilstIwasatQueenMaryCollege,UniversityofLondon,workingwithBernardSufrinoftheBernardSufrinoftheComputerLaboratory,OxfordUniversity.I'vecontinuedtodevelopitatMiddlesexUniversitysince.Bernardworkedontheimplementationwithmefortherstfouryearsorso.Thatdoesn'tdescribeallhedid:hisdesigninsightswerecrucialandwithouthimJapewouldn'texistorbehalfasgoodasitis.Hisprogramarchitecture,whichheworkedoutintherstfewmonthsofourcollaboration,isstillinplaceeventhoughJapehasbeenrebuiltfromthegroundupmorethanonce.HestillproducestheJapedistributionsandrunningthewww.japeforall.org.ukwebsite.FortherestofitI'vebeenstronglyinuencedbycolleaguesatQueenMary,manyofwhomhavemadeseminalsuggestionswhichhaveimprovedJape.InalphabeticalorderIsingleoutJulesBean,JohnBell,PeterBurton,KeithClarke,AdamEppendahl,DavidPym,GraemRingwood,MikeSamuels,PaulTaylorandGrahamWhite.JapebeganasanexperimenttowardstheendofanEPSRCresearchprojectontheuseofsymboliccalcula-torstoteachformalreasoning,jointwithSteveReevesandDougGoldsonatQueenMary,andTimO'SheaandPatFungattheOpenUniversity.Alaterproject,withPatFungandJamesAczelfromtheOU,lookedatstudentsusingJape;James'sinsightfulsummaryoftheirdifcultiesledtoaredesignofthetreatmentofnaturaldeduction,anddirectlytothisversionoftheprogram.Jape'sproofenginewasoriginallywritteninSMLandcompiledbySMLNJ,withinterfacesfordifferentoperatingsystemswritteninC,tcl/tk,PythonandIcan'trememberwhatelse.In2002IportedtheenginetoOCamlandwroteasystem-independentinterfacemoduleinJava.I'mgratefultotheimplementersofallthoselanguages,especiallyfortheirdecisiontoprovidetheirsoftwareforfree.Japeisfreetoo,athttp:www.japeforall.org.uk. Contents1Basics71.1Gettingstarted..........................................71.2Finishingaproof........................................91.3Savingandrestoringyourwork.................................91.4PrintingandExporting.....................................91.5MakingJapeworkforyou...................................91.5.1Onlyreect.......................................91.5.2Bebrave........................................101.5.3Neverguessanassumption...............................102Gestures:mouseclicks,pressesanddrags112.1Formulaselection........................................112.1.1Ambiguousformulaeclickbothways.........................112.1.2Greying-out.......................................122.2Subformulaselection......................................122.3Dragging............................................133Backwardandforwardsteps153.1Makingaforwardstep.....................................153.1.1Selectingatargetconclusion..............................173.1.2Whatcangowrongwithaforwardstep?.......................173.2Makingabackwardstep....................................183.2.1Whatcangowrongwithabackwardstep?......................183.3Stepswhichdon'tneedaselection...............................194Rulesofthumbforproofsearch214.1Lookattheshapeoftheformula................................225Thestepssummarised235.1^steps..............................................235.2!steps.............................................235 6CONTENTS5.3_steps..............................................255.4:steps..............................................265.5?(contradiction)steps.....................................285.6�(truth)step..........................................285.78steps..............................................285.89steps..............................................306Unknowns,hypandUnify316.1Introducinganunknown....................................316.2Avoidingunknownsbysubformulaselection..........................326.3EliminatinganunknownwithUnify..............................336.4Eliminatinganunknownwithhyp...............................336.5Provisosandtheprivacycondition...............................347Disproof357.1Gettingstarted..........................................357.2Alternativesequents.......................................367.2.1Selectingasituation..................................367.2.2What'sforced?—colouring,greying,underlining..................377.3Makingdiagrams........................................377.3.1Draggingworlds....................................387.3.2Dragginglines.....................................387.3.3Draggingformulae...................................387.4Makingindividualsandpredicateinstances..........................397.5Exploringreasons........................................397.6Completingadisproof.....................................407.7Printingdisproofs........................................408Usingtheoremsandstatingconjectures418.1Usingtheorems.........................................418.2Statingyourownconjectures..................................439Troubleshooting459.1Problemsgettingstarted....................................459.2Whatifaproofstepgoeswrong?................................45 Chapter1Basics1.1GettingstartedIfyoudon'talreadyhaveJape,downloaditfromhttp://www.japeforall.org.uk.Installit,followingtheinstructionscarefully.YoushouldhaveadirectorycontainingtheJapeapplicationandasubdirectorycalledexamples.Double-clickJape,andyouwillseeawindowlikegure1.1.1UsingtheOpenNewTheorycommandintheFilemenu,openexamples/natural deduction/I2L.jt.Youshouldseeseveralwindowscontaininglogicalconjectures(claimstobeproved),calledpanelsinJape.TheConjecturespanelshouldlooksomethinglikegure1.2(youwillprobablyhavetoresizethewindowtomakeitlooklikethis).Double-clickanylinetobegin,orselectalineandpresstheProvebuttonatthebottomofthepanel.Youwillseeaproofwindowlikegure1.3,andoffyougo! 1Youmayseeminordifferences.TheillustrationsinthismanualaretakenfromMacOSX.OnWindowsandLinuxyouwillseeamenubarinthewindowandthewindowtitlewillbeJape.Butthosedifferencesdon'tmattermuch,soIwon'trefertothemagain. Figure1.1:TheJapesplashscreen7 8CHAPTER1.BASICS Figure1.2:TheConjecturespanel Figure1.3:Aproofwindow Figure1.4:Aconjecturepanelwithaprovedconjecture Figure1.5:Aconjecturepanelwithprovedanddisprovedconjectures 1.2.FINISHINGAPROOF91.2FinishingaproofWhenyouhavemadeaproofofaconjecture—nomorelinesofdotsintheproofwindow—youcansaveit:pulldowntheEditmenuandselectDone.Theproofwindowcloses,andJaperecordsthefactthattheconjectureisproved,markingitsentryintheconjecturespanelwithatickinthemargin,asillustratedingure1.4.Ifyoudisproveaconjecture(seechapter7)thenyoucanrecordthattoo,andyougetacrossinthemargin.Becauseclassicalproofandconstructivedisproofoverlap,youcanevengetbothmarksagainstthesameconjecture,asillustratedingure1.5.Proofofaconjecturemakesitatheorem.YoucanusetheoremsinyourproofsasiftheywereadditionalNaturalDeductionrules(selectthetheoreminthepanel,presstheApplybutton),andyoucanreviewtheirproofsusingtheShowProofbutton.Seechapter8formoreinformation.1.3SavingandrestoringyourworkJapeofferstorecordyourproofs—savedandunsaved—whenyouquitorwhenyouchoose“SaveProofs”or“SaveProofsAs...”fromtheFilemenu.Itwillreloadsavedproofsusing“Open...”,alsofromtheFilemenu.1.4PrintingandExportingYoucanprintaproofusingthePrintProofcommandontheEditmenu.Ifyouhaveadisproofonthego(seechapter7)youcanprintitusingthePrintDisproofcommand,orproofanddisprooftogetherusingPrint.Tomakeapdforpscopyofaproofinale,useExportProof,ExportDisprooforExport,allontheEditmenu.1.5MakingJapeworkforyou1.5.1OnlyreectJapeisdesignedtobeeasytouse,whichmeansthatthemouseandmenuandwindowstuffdon'tgetinthewayofthelogic.It'ssoeasytousethatyoucanhavegreatfunclickingaway,`solving'lotsofproblemswithoutalwaysknowingexactlywhatyou'redoing.That'sok,becauseyoucanlearnwhileyou'rehavingfun,andyoucandothingsforyourselfwithoutaskingforhelp.Butit'sobviouslynotthewholestory.BecauseJapeiseasytouseitbringsyouquicklytoapointwhereyoucanaskinterestingandimportantquestions.Thekindofquestionyouaresupposedtoaskis“isthelogicreallysupposedtoworklikethat?”Ifthereareexpertsaroundyoucanaskthem,butifyouareonyourownyoucanstillaskyourself.Thatisn'tadaftthingtodo:educationalistscallitreection,andit'soneofthebestwaystolearn.Somelogicalproofsarehardtobelieveatrst.Somesinglelogicalstepsareprettysurprising.IhopethatyouwillalwaysreadthroughnishedJapeproofstoseeifyoucanbelievethem.Ifthereisasurprise,askyourself:wheredoesthesurprisecomefrom?Byundoingandredoingstepsyoucanwatchthesurpriseemergeandexplaintoyourselfwhyit'snecessary.Jape'samachine,andthathasdisadvantagesaswellasadvantages.Thebigadvantageisthatamachinecandoformalcalculation—proofanddisproof—perfectly,withoutmistake.Thebigdisadvantageisthatitcan'tunderstandanythingaboutwhatit'sdoing.Japedoesn'tknowthedifferencebetweenaniceproof 10CHAPTER1.BASICSandanastyone.Sometimesreectionwillshowyouthatthereisashorterorprettierproofthantheoneyouhavemade.Youcanalwaysundoyourworkandtryagain!1.5.2BebraveWereadproofstop-to-bottommostofthetime.Novices,reasonablybutmistakenly,imaginethatproofsareconstructedtop-to-bottomtoo:startatline1andworkforwards.Well,sometimesitisdonethatway,butatleastasoftenit'sdonetheotherwayround,bottom-to-top,startingwiththelastlineandworkingbackwards.Bebraveandtryit!Ifyousticktoforwardproofyoumakelifeverydifcultforyourself,sobraverypaysdividends.Braveryisneeded,too,whenlearninghowproofstepswork.It'sreasonablewhenplayingwithaninteractiveprogramtorsttryonlystepsthatmakesmallchanges,buteventuallyyouhavetotryeverything.It'sjustlikeridingabike:onceyou'vepluckedupcourageyoucan'trememberwhatitfeltliketobescaredof_elimor^introorwhatever.Justdoit!1.5.3NeverguessanassumptionAproofisreallyastructureofdeductions,notasequenceoflines,anditsassumptionboxesshowthatstructure.Readingaprooffromtoptobottom,everyassumptionthatisintroducedmustalsobedischargedbytheuseofarulewhichmakesuseofthebox.Japeguaranteescorrectuseofassumptionsbycombiningintroductionanddischargeintoasinglestep.Assumptionsareintroduced(anddischarged)byusingrules,andtherulesthatdoit—someforward,somebackward—arelabelledinthemenus.Japehelpsyou,ineverycase,bycalculatingtheassumptionthatyouneed:thereisneveraneedtoguessanassumption. Chapter2Gestures:mouseclicks,pressesanddragsLikeeveryotherinteractiveprogram,Japeacceptsinstructionsthroughthemouseandthekeyboard.Mostlyyouwillusethemousetoselectaformulaorasubformulaintheproofwindowandthentocommandwhattodowithyourselectionbychoosingacommandfromamenu.ThewaysthatJapeusesthemouseareprettystandard.2.1FormulaselectionFormulaselectionismadewithasingleclick(left-clickonamulti-buttonmouse).Youclickonaformula—ahypothesisabovethelineofdotsoraconclusionbelowthedots—andJapehighlightsyourselectionwithanenclosingredbox.Ifyouclickonahypothesisyougetadownward-facingboxasingure2.1(a);ifyouclickonaconclusionyougetanupward-facingboxasingure2.1(b).Youcanselectbothahypothesisandaconclusion,asingure2.1(c).Clickingonthebackground—awhitepartoftheproofwindow—cancelsallyourselections.Simpleclickswillletyouselectoneconclusionandonehypothesisatatime.Normallyasecondhypothesisclickcancelstherst,butifyouholddowntheShiftkeywhileyouclickyoucanselectmorethanonehypothesis,asshowningure2.1(d).Andthen,alsousingtheShiftkeywhilstclicking,youcancancelindividualformulaselections.Thereisnowayofselectingmorethanoneconclusionatatime.2.1.1AmbiguousformulaeclickbothwaysIngure2.2(a)thereareopenconclusionsonlines3and4,eachprecededbyalineofdotstoshowthatthere'sworktobedone.Lines1and2aren'tconclusions,andcanonlybeusedashypothesestoprovelines (a)hypothesisselection (b)conclusionselection (c)hypothesisandconclusion (d)multi-hypothesisselectionFigure2.1:Formulaselectionbymouseclick11 12CHAPTER2.GESTURES:MOUSECLICKS,PRESSESANDDRAGS (a)Proofattemptwithintermediatehypothesis/conclusionformula (b)top-halfclickselectsasconclusion (c)bottom-halfclickselectsashypothesisFigure2.2:Ambiguousconclusion/hypothesisselection (a)subformulaselection (b)multiple-subformulaselectionFigure2.3:Subformulaselectionbyoption/alt/middle-press-and-drag3and4.Line5can'tbeusedatall:it'saprovedconclusion.Line4canonlybeaconclusionandnotahypothesis,becausethere'snothingbelowitinthebox.Butline3isambiguous:ithastobeprovedasaconclusion,perhapsusinglines1and2,anditcanbeusedasahypothesistoproveline4.AmbiguousformulaelikeF!Gonline3ofgure2.2(a)canbeselectedintwoways.Ifyouclickonthetophalfoftheformulayougetaboxopenatthetop—i.e.aconclusionselection—withadottedlineacrossthebottom,asshowningure2.2(b).Ifyouclickonthebottomhalfyougetaboxopenatthebottom—i.e.ahypothesisselection—withadottedlineacrossthetop,asshowningure2.2(c).2.1.2Greying-outWhenyouselectahypothesisyoucanonlymakeasteptowardsconclusionsbelowyouandinthesameboxasthehypothesisyouclicked.Whenyouselectaconclusionyoucanonlymakeabackwardsteptowardshypothesesaboveyouandinthesameboxorenclosingboxes.Japegreysoutalltheformulaeyoucan'tuse,tohelpyouseewhat'sgoingon,asshownbyline5ingures2.2(b)and2.2(c).Ifyouclickonagreyed-outformulaJapecancelsyourcurrentselection(s).Ifyouclickonaconclusionthat'salreadybeenusedup(onewhichisn'timmediatelybelowalineofdots)thenJapegreysitoutandcancelsallyourselections.12.2SubformulaselectionOccasionallyyouneedtotellJapetofocusonpartofaformula.Youdothisbyapress-and-draggesture:withathree-buttonmouse,middle-press-and-drag;otherwisebyholdingtheAltshift(sometimeslabelled'option')duringapress-and-drag. 1Thiswasonceabug.Nowit'sbecomeafeature,becauseIratherlikeit. 2.3.DRAGGING13Japehighlightsthesubformulayou'veselectedbychangingthebackgroundcolourtoyellow,asshowningure2.3(a).Ifyouholddowntheadd-a-selectionkey(ctrlonWindowsandLinux,commandonMacOSX)youcanmakemorethanonesubformulaselection,asshowningure2.3(b).Usingthesamekeycombination,youcancanceland/ormodifysubformulaselectionsyou'vealreadymade.Japerestrictssubformulaselectionstowell-formedsubformulae,asyoucandiscoverbyexperiment.Thatmeansthatifyouoption/alt/middle-clickonaconnectiveoraquantier,awholesubformulaishighlighted.Ifyouoption/alt/middle-clickonaname,onlythatnameishighlighted.Option/alt/middle-clickingorpressingonanewsubformulacancelsallothersubformulaselections,unlessyouholddowntheadd-a-selectionkey(CommandonMacOS,Ctrlonothersystems).Option/alt/middle-clickingonthebackground—awhitepartoftheproofwindow—cancelsallyoursubformulaselections.Formulaandsubformulaselectionsareindependent:youcanhaveonewithouttheother,orboth,orneither.Cancellingonekindofselectiondoesn'tcanceltheother.2.3DraggingInthedisproofpane—seechapter7—youcandragformulae,tiles,worldsandlinesaroundtomakeadiagram.Youdoitbypress-and-drag.Seechapter7fordetails. 14CHAPTER2.GESTURES:MOUSECLICKS,PRESSESANDDRAGS Chapter3BackwardandforwardstepsBecausewereadproofsforward,top-to-bottom,forwardstepsareeasiesttounderstandandmostproofnovicespreferworkingforwards.Butlotsofproofsaredifcultworkingforwards,andsomearealmostimpossiblydifcult.TomakeproofsinJapeyouneedtobeabletomakebackwardstepsaswell,andI'vegonetosometroubletoforceyoutorecognisethefact.IntheBackwardmenu,showningure3.1,therstgroupofstepsabovethelineworkbestbackwardsandthegroupbelowthatlinecanbemadetoworkbackwardifyoutryhard.TheForwardmenu,ingure3.2,similarlyshowsstepsthatworkwellforwardbeforeonesthatworkforwardonlywithdifculty.`hyp'ishardtoclassify,soitappearsinbothmenus.TomakeastepyouselectoneormoreformulaeandchooseastepfromtheBackwardorForwardmenu.Theselectionsyouneedtomakedependonthestepyouchoose,andaredetailedinthedescriptionsofthestepsinlaterchapters,butingeneralforaforwardstepyoumustchooseahypothesisandforabackwardstepanopen(unproved)conclusion.3.1MakingaforwardstepBeforeyoumakeaforwardstepyoumustalwaysselectahypothesisformula.Dependingonthekindofstep,youmayhavetoselectmorethanonehypothesis:fordetails,seethedescriptionofthesteplaterinthismanual—orjusttryitandseewhathappens! Figure3.1:Backwardmenu Figure3.2:Forwardmenu15 16CHAPTER3.BACKWARDANDFORWARDSTEPS (a)before (b)afterFigure3.3:Asampleforwardstep (a)hypothesisonlyselected (b)consequentbelowhypothesisFigure3.4:AforwardstepwithoutatargetconclusionYoucanalsoselectaconclusionaswell,ifyouwantto.Somestepsrequireaconclusionselection:youcanlookupthestepinthismanualoryoucantryitoutandseewhathappens.Onceyouhavemadeyourselection(s),chooseyourstepfromtheForwardmenu.Japewritestheresultofthestep—theconsequentdeducedfromtheantecedent(s)youselected—justbelowyourselection(s).Forexample,gure3.3showsan!elimstepwithtwohypothesisselections.Theconsequentisline4inthe`after'picture.Noticethatthejusticationofthestepiswrittenagainsttheconsequent. (a)hypothesisandconclusionselected (b)consequentaboveconclusionFigure3.5:Aforwardstepwithatargetconclusion 3.1.MAKINGAFORWARDSTEP17 (a)before:hypothesisandconclusionselected (b)after:argumentbycasesoutlinedFigure3.6:_elimneedsatargetconclusion3.1.1SelectingatargetconclusionNormallyJapewritestheresultofaforwardstepjustafterthehypothesisselection.Sometimesthatmaynotbeconvenient,anditmaybetidiertowriteitlowerdowntheproof,justaboveaconclusionyouareworkingtowards.Ingure3.4(a)onlythehypothesisonline1isselected.Aforwardstep—inthiscase“^elim(ignoringright)”—putsitsconsequentjustbelowtheselectedhypothesis,asshowningure3.4(b).Ifyouselectatargetconclusionaswell,asingure3.5(a),thesamestepwillputitsconsequentbeforethelineofdotsabovetheselectedconclusion,asshowningure3.5(b).3.1.2Whatcangowrongwithaforwardstep?WhenJapecan'tmakeaforwardstepit'sforoneofthefollowingreasons.Inallcasesyou'llgetanerrormessagewhichexplainstheproblem.1.Noselectedhypothesis.Ifyoudon'tselectahypothesisformula,youcan'tmakeaforwardstep.2.Notenoughselections.Somestepsneedmorethanasinglehypothesisselection.3.Wronghypothesisshape.Mostforwardstepsapplytoaparticularshapeofhypothesisformula.Ifyouselectthewrongshape,youcan'tmakethestep.4.Notargetconclusion.Twoforwardsteps—_elim,9elim—needaconclusionselectionaswellasahypothesis,because 18CHAPTER3.BACKWARDANDFORWARDSTEPS (a)conclusionselected (b)twonewconclusionantecedentsFigure3.7:Asamplebackwardstep (a)conclusionselected (b)onehypothesis,oneconclusionantecedentFigure3.8:Asamplebackwardstepwitharelevanthypothesistheconsequentcan'tbecalculatedfromtheantecedents.Japewritestheresultofthestepjustabovethetargetconclusion,andwritesthejusticationnexttotheselectedconsequent.Forexample,seethe_elimstepingure3.6.Theresultofthestep(there'squitealotofit!)iswrittenaboveline7ofthe`before'state,toformlines7to10ofthe`after'state.3.2MakingabackwardstepBackwardstepsworkonanopenconclusion—alinewithoutajustication,writtenjustbelowalineofthreedots.Theymayproveitcompletely,ifJapecanndhypothesestomatchtheantecedents,ortheantecedentsmaybecomeunprovedconclusions.Forexample,gure3.7(a)showsanopenconclusionselection,andgure3.7(b)showstheeffectofabackward^introstep,whereeachantecedenthasbecomeanewopenconclusion.Figure3.8(a)showsthesameconclusionselectedwhentherearemorehypothesisformulaeavailable,andingure3.8(b)onlyoneopenconclusionisgeneratedbecauseline3matchestheantecedentofthe^introstep.Ineverycasethejusticationofthestepiswrittennexttotheselectedconclusion,theconsequentofthestep.3.2.1Whatcangowrongwithabackwardstep?1.Wrongconclusionshape. 3.3.STEPSWHICHDON'TNEEDASELECTION19 (a)Eistheconsequent (b)F_GistheconsequentFigure3.9:ConclusionselectiontotellJapewheretoworkEachbackwardstep,exceptforcontra,appliestoaparticularshapeofconsequentformula.Ifyouselectthewrongshape,youcan'tmakethestep.2.Noselectedconsequent.Ifthereismorethanoneunprovedconclusion,Japedoesn'ttrytochoosebetweenthem.Ingure3.7(b),forexample,Japewouldn'tknowwheretoapplyabackwardstep.Selectinganunprovedcon-clusion,asingure3.9,resolvestheambiguity.(Noticeingure3.9(a)thatline2isanambiguoushypothesis/conclusionformula,selectedasaconclusionbyclickingonit'stophalf.)3.Hypothesisselected.Backwardsteps(exceptfor9intro)don'tneedandcan'tmakeuseofaselectedhypothesisformula.3.3Stepswhichdon'tneedaselectionIfthereisonlyoneformulaintheproofthatcanbeselectedasahypothesis,itwouldbeannoyingtobetoldtoselectitbeforeyoucanmakeaforwardstep.Ifthere'sonlyoneunprovedconclusionintheproof,itwouldbeannoyingtobetoldtoselectthattomakeabackwardstep.Iftheonlypossibletargetconclusionisonthenextlinetothehypothesis,itwouldbeannoyingtobetoldtoselectitwhenastepneedsatarget.SoinallthosecasesJapeletsyougetawaywithoutselection,anddoestheobviousthing. 20CHAPTER3.BACKWARDANDFORWARDSTEPS Chapter4RulesofthumbforproofsearchRulesofthumb1areguesswork,approximateguidesthatdon'talwayswork.Proofsearchismucheasierifyourecognisesomesimpleprinciples.1.Almostalltherulesworkontheshapeofahypothesisorconsequentformula.Usetheshapeasaguidetohelpyouchoosearule.2.Userulesthatintroduceassumptionsintotheproofasearlyaspossible.Thoserulesare:!introbackwards(fortheassumption);_elimforwards(fortheassumptions);:introbackwards(fortheassumption);8introbackwards(forthevariable);9elimforwards(forthevariableandtheassumption).3._introworksbackwardsbetterthanitdoesforwards;butsinceitthrowsawayhalftheconclusionyouapplyitto,useitverycarefullyandaslateaspossible.4.:elimworksbetterforwardsthanitdoesbackwards,oncethecontradictoryformulaehavebeenrevealed.5.Ifyouuse:elimbackwards,lookforahypothesistounifywiththeunprovedconclusion: B(anegatedunknown).6.Classicalcontra—`proofbycontradiction'—canbeusedasalastresortinanysituation.Itintro-ducesanassumption,anddoesn'tmindwhatshapetheconsequentis.(Constructivecontraisjustasapplicable,butsinceitdoesn'tintroduceanassumption,itisn'tusuallymuchhelp.) 1Aninchwasoriginallydenedasthewidthofanadultmalethumb,soa`ruleofthumb'isanapproximatemeasure,then(bypunning`rule'=measurer)anapproximateguide.ThereisaGreekword`heuristic'forrule-of-thumb,butIprefertheoldEnglish.SomepeopleobjecttotheEnglishphrasebecausetherewasonceafolktraditioninEnglandthatamancouldlegallybeathiswifewithasticknothickerthanhisthumb,anditwaspopularlycalledruleofthumb.(There'sareference,forexample,inE.P.Thompson'sCustomsinCommon.)Thetraditionwasrepulsiveandmistaken,but(a)it'sbeenforgotten,exceptbyhistorians,and(b)the`approximateguide'readingpredatesit.21 22CHAPTER4.RULESOFTHUMBFORPROOFSEARCH7.IfJapewon'tletyoumaketheproof,you'redoingitwrong.Therearen'tanybugsinJape'streatmentofNaturalDeduction,andalltheproofsintheConjecturesandClassicalconjecturespanelsarepossi-ble—I'vedonethemall.Similarly,alltheonesintheInvalidconjecturespanelareimpossible(theyareincludedsothatyoucandisprovethem—seechapter7).8.Don'tbeafraidtoUndoandRedotosearchalternativeroutestoproof.JapepermitsmultipleUndosandcorrespondingRedos.4.1LookattheshapeoftheformulaThereisageneralprinciple:logicalstepsinNaturalDeductionalmostalwayssimplifyaformula,removingaconnective(!,^,_or:)oraquantier(8or9)andbreakingtheformulaintoitsconstituentparts.Persuasion(intro)rulesdothatworkingbackwards,anduse(elim)rulesdoitforwards.Tochoosearule,lookforthemainconnective(orthequantier)inanunprovedconclusionorahypothesis,andusetherulewhichworksonthatconnective(orquantier).ThewaythatrulesmatchformulaeissonearlymechanicalthatIcouldhavesetJapeuptochoosetherelevantrulewhenyoumerelydouble-clickonaformula.BecauseIwantyoutolearnaboutNaturalDeductionandnotjusttheuseofthemouse,I'vebeengrandad-ishandsetitupsothatyouhavetochoosetherulesforyourself. Chapter5Thestepssummarised5.1^stepsYouuse^introbackwardsbyselectinganA^Bconclusionandchoosing“^intro”fromtheBackwardmenu.Itgeneratesnewconclusionlinesfromtheantecedentsoftherule,asshowningures3.7and3.8onpage18.Istronglyrecommendusing^introbackwardsratherthanforwards.Youuse^elimforwardsbyselectinganA!BhypothesisandchoosingoneofthetwoversionsofthestepfromtheForwardmenu:“^elim(preservingleft)”deducesA,and“^elim(preservingleft)”deducesB.Theeffectisillustratedingures3.4and3.5onpage16.^introforwardisalsopossible:selecttwohypothesisformulaetobetheantecedentsanduse“!intro”fromtheForwardmenu.Butit'seasierbackwards,reallyitis.Theproblemingure5.1,forexample,iseasyiftherststepis^introbackwards—youhavetwothingstoproveandyouhavetoprovethemseparately—andimpossiblealmostanyotherway.^elimbackwardsispossible,butforsomereasonorotherIdidn'tincludeit(andI'msureIhadagoodreason,soI'mnotgoingtoadditnow).5.2!stepsYouuse!introbackwardbyselectingaA!Bconclusionandthenchoosing“!intro”fromtheBack-wardmenu.Seegure5.2,forexample.Noticethatthestepintroducesanewassumptionandthereforeanewbox(andthat'swhyitshouldbeusedearly).Youcanuse!elimforwardbyselectingaAhypothesisandaA!Bhypothesis,asshownbythetrivialexampleingure5.3.(Shift-clicktoselectthesecondhypothesis:ifyouselectthewrongthingeithercancelitwithashift-clickorclickonthebackgroundtocancelallyourselections,andstartagain.)Youcanalsouse!elimhalf-forward,half-backwardifyouselectaA!Bhypothesisandatargetconclusionandapply“!elim”fromtheForwardmenu.JapewritesanewconclusionAfollowedbya Figure5.1:^introbackwardsneeded23 24CHAPTER5.THESTEPSSUMMARISED (a)E!(F!G)selected (b)hypotheticalargumentoutlinedFigure5.2:!introbackward (a)EandE!Fselected (b)consequentFdeducedFigure5.3:!elimforward (a)F!Gandtargetconclusionselected (b)consequentGdeducedfromnewopenconclusionFFigure5.4:!elimhalfbackward,halfforward 5.3._STEPS25 (a)before:conclusionselected (b)after:uncertaintyresolvedFigure5.5:_introbackwardsiseasy (a)before:hypothesisselected (b)after:`unknown'formulaintroducedFigure5.6:_introforwardsgeneratesanunknownconsequentB,asshowningure5.4.It'sahalf-backwardstepbecauseitintroducesanewconclusion.!introforwardisjustdaft,andJapewon'tattemptit.!elimbackwardispossible,butitintroducesunknownsandthere'snorealadvantage,soIdon'tletJapetry.5.3_stepsBecause_elimforwardsimplementsargumentbycases,andbecausetheconsequentCcan'tbededucedfromtheA_Bantecedent,itgeneratesbigproofchangesfromasmallgesture.Thatfrightensnovices,butbebrave,because_elimisoneoftherulesthatgeneratesassumptions,soyouhavetouseitasearlyaspossibleinaproof._introbackwardsisdestructive—itthrowsawayhalfaconclusion—soyouuseitaslateaspossible,eventhoughit'sveryeasytouse.Youuse_elimforwardsbyselectingahypothesiswhichtsA_B,anopenconclusionC(ifthere'sonlyoneavailableconclusion,andifitsonthelinebelowthehypothesis,Japewillletyouofftheconclusionselection)and“_elim”fromtheForwardmenu.Seegure3.6onpage17,forexample.NotethattheboxesrepresentingtheAleadstoCandBleadstoCarguments(lines7-8and9-10ingure3.6(a),forexample)arewrittenjustabovetheselectedconclusionC,andthejusticationis(ofcourse)writtenagainst 26CHAPTER5.THESTEPSSUMMARISED (a)before:hypothesis:(E_F)andtargetconclusionselected (b)after:conclusionE_FgeneratedFigure5.7::elimforwardsiseasy (a)before:conclusion:Fselected (b)after:contradictionargumentoutlinedFigure5.8::introbackwardsisveryeasytheselectedconclusion._introiseasytousebackwards:selectanopenconclusion,decidewhichhalftokeepandwhichtothrowaway,andapplythecorrespondingstep(“_intro(preservingleft)”or“_intro(preservingright)”)fromtheBackwardmenu.Seegure5.5,forexample.ForsomereasonthatI'veforgotten,Iwaspersuadedtoallow_introforward.Iratherregretit,becausethisisn'tastepfornovicestouse.But,ifyoumust:youselectahypothesis,decidewhichhalfoftheconsequentithastobe,andapplythecorrespondingstep(“_intro(inventingleft)”or“_intro(inventingright)”)fromtheForwardmenu.Thestepalwaysinventsanunknown,asillustratedingure5.6byan“inventingright”step,andyouhavetodealwiththeunknownsomehow(seechapter6forsuggestions).Ifunknownsfrightenyou,don'tuse_introforwards(theeasywaytosolvetheproofproblemingure5.6,forexample,is:elimforwardsfromline1withtargetconclusionline4,producinggure5.5(a);then_introbackwardspreservingleftproducesgure5.5(b))._elimbackwardswouldbepossible,butnotfornovices,soIdidn'tallowit.5.4:steps:elimworksbestforwards,:introbackwards. 5.4.:STEPS27 (a)before:conclusion?selected (b)after:unknown B1invented,andtwoconclusionsgeneratedFigure5.9::elimbackwardsisharder (a)before:conclusionE_:Eselected (b)after:contradictionargumentoutlinedFigure5.10:AsampleclassicalcontradictionstepTouse:elimforwards,selectahypothesis:A,ortwohypotheses:AandA,andchoose“:elim”fromtheForwardmenu.Youcanselectatargetconclusiontoo,ifyoulike.Thestepgeneratesaconsequent?,(plusaconclusionAifyouonlyselectonehypothesis).Seegure5.7,forexample.Touse:introbackwards,selectanopenconclusion:Band“:intro”fromtheBackwardmenu.Seegure5.8,forexample.It'spossibletouse:elimbackwards,ifyouselectanopenconclusion?.Itgeneratesanunknown Bandtwonewopenconclusions: Band: B,asillustratedingure5.9.It'susuallyeasiertodoitforwards,though.:introforwardsdoesn'tmakemuchsense,soIdidn'tallowit. (a)before:hypothesis?andtargetconclusionselected (b)after:conclusion`proved'Figure5.11:Asampleconstructivecontradictionstep 28CHAPTER5.THESTEPSSUMMARISED (a)before:8x::R(x)conclusionselected (b)after:generalisedproofoutlineintroduced,withprivatevariableiFigure5.12:A8introstepbackwards5.5?(contradiction)stepsClassicalcontraisahardruletouse(thereoughttobeabluessongaboutthat),butyouknowyouaregoingtohavetouseitforsomeproblems.Itonlyworksbackwards.Constructivecontraiseasierifyouuseitforwards.Touseclassicalcontra,selectanopenconclusionAandchoose“contra(classical)”fromtheBackwardmenu.Itcreatesahypotheticalcontradictionargumentwithassumption:A,asshowningure5.10.Touseconstructivecontraforwards,selecta?hypothesisandanopenconclusion,andchoose“contra(constructive)”fromtheForwardmenu.Seegure5.11,forexample.Constructivecontrabackwardsisdestructive:itthrowsawaywhateverconclusionitisappliedto.Butyoucandoitifyouwantto.Classicalcontraforwardswouldbeabsurd.5.6�(truth)stepYoucanalwaysprove�asanopenconclusion:selectitandapply“truth”fromtheBackwardmenu.Andthat'sallyoucandowith�:noforwardstepispossible.5.78steps8introworksbackwards,8elimforwards.8introisworthusingearly,becauseitintroducesavariable.Theprivacyconditiononthe8introstepwon'tusuallybotheryou,becauseJapealwaysinventsanewvariable(i,i1,i2,andsoon).Touse8introbackwards,selectanopenconclusion8x:P(x)andchoose“8intro”fromtheBackwardmenu.Japebuildstheoutlineofthegeneralisedproof,asillustratedingure5.12.Touse8elimforwards,youmustselectahypothesis8x:P(x)andalsoactualj,thenchoose“8elim”fromtheForwardmenu.Theeffectisillustratedingure5.13. 5.7.8STEPS29 (a)before:8x:(R(x)^S(x))andactualihypothesesselected (b)after:R(i)^S(i)consequentdeducedFigure5.13:A8elimstepforwards (a)before:9x::R(x)hypothesisandtargetconclusion?selected (b)after:generalisedproofoutlineintroduced,withprivatevariableiFigure5.14:An9elimstepforwards (a)before:9x::R(x)conclusionandactualihypothesisselected (b)after::R(i)antecedentdeducedFigure5.15:An9introstepbackwards 30CHAPTER5.THESTEPSSUMMARISED5.89steps9introworksbackwards,9elimforwards.9elimisworthusingearly,becauseitintroducesavariable.Theprivacyconditiononthe9elimstepwon'tusuallybotheryou,becauseJapealwaysinventsanewvariable(i,i1,i2,andsoon).Touse9elimforwards,youmustselectahypothesis9x:P(x)andalsoatargetconclusion,andthenchoose“9elim”fromtheForwardmenu.Thejusticationiswrittennexttothetargetconclusion,andageneralisedproofoutlineisintroduced,asillustratedingure5.14.Touse9introbackwards,youmustselectaconclusion9x:P(x)andalsoahypothesisactualj,andthenchoose“9intro”fromtheBackwardmenu.Theeffectisillustratedingure5.15. Chapter6Unknowns,hypandUnifyWhenJamesAczellookedatnoviceslearninglogicwithJape,hepointedoutthattheyfoundincompletestepsquitedisconcerting.Incompletestepsareonesthatletyouleaveoutimportantinformationsothatyoucanllitinlater,whenyou'vediscoveredwhatitoughttobe.Youmightbeallowedtoleaveoutthevariableinan9introstep,forexample,andllitinlater.Japeusesunknowns—namesstartingwithanunderscore,like B1—tostandforformulaewhichcanbelledinlater.EventhoughJamespersuadedmetoeliminatealmostallincompletestepsfrommytreatmentofnaturaldeduction,myuserspleadedwithmetoallowsome.SoitispossibletointroduceunknownsintoaJapeproof,andbecauseofthatit'snecessarytoknowhowtogetridofthemagain.Tounderstandwhatfollowsyouhavetorecognisethedistinctionbetweenformulaselection(redboxroundaconclusionorahypothesisformula)andsubformulaselection(yellowbackgroundbehindpartorallofaconclusionorhypothesisformula).Note,inparticular,thatasubformulaselectionthatencompassesacompleteformulaisnotthesamethingasaformulaselection.6.1Introducinganunknown_elimbackwardstakesaformulawithan_connectiveandthrowsawayhalfofit,becausefromAyoucanproveA_B,andfromByoucanproveA_B.Someobsessively-forwardreasonerswantedmetoallow_introforwards,andjusttospitethemIdid:it'sthereintheForwardmenu,undertheline.Figure6.1showshowyoucandeduceA_ BfromAbychoosing“_intro(inventingright)”fromtheForwardmenu.:elimbackwardsisanothergoodwaytogetanunknown,illustratedingure6.2.There'sonlyoneunknownintheproof,butitoccurstwice.Thesearebynomeanstheonlywaytointroduceunknownsintoaproof.Oneveryinterestingwayistoselectaconclusion,choose“Textcommand”fromtheFilemenu,type“applycut”andpressreturn.You (a)before:9x::R(x)hypothesisselected (b)after:unknown B1introducedinconsequentFigure6.1:An_introstepforwards31 32CHAPTER6.UNKNOWNS,HYPANDUNIFY (a)before:conclusionis? (b)after:unknown B1introducedinantecedentsFigure6.2:A:elimstepbackwards (a)before:conclusion?selected,subformula:R(x)selected (b)after::R(x)usedinantecedentsof:elimFigure6.3:A:elimstepbackwardswithsubformulaselectionwillgetanunknown,intermediatebetweenthehypothesesandyourconclusion.Ileaveyoutoworkouthowusefulthatcanbe.6.2AvoidingunknownsbysubformulaselectionIfyouknowbeforehandwhatshouldgoinplaceoftheunknown,youcantellJapewhattouseatthetimeyoumakean_introor:elimstep,bysubformulaselection(alt/option/middle-press-and-dragovertheformulaorsubformulayouwanttouse).Figure6.3showsanexample:notethatthehypothesisisnotselected,but:R(x)issubformula-selected. (a)before:subformulae9x::R(x)and B1selected (b)after:instancesof B1replacedby9x::R(x)Figure6.4:EffectofaUnifycommand 6.3.ELIMINATINGANUNKNOWNWITHUNIFY33 (a)before:hypothesis:9x::R(x)andconclusion: B1selected (b)after:instancesof B1replacedby9x::R(x)Figure6.5:Effectofhyponanunknown Figure6.6:Proofwithproviso Figure6.7:Preparationforproviso-violatingunication6.3EliminatinganunknownwithUnifyIfyouhaveanunknowninyourproof,andasubformulasomewhereintheproofwhichyouwanttousetoreplacetheunknown,thensubformulaselectionandthe“Unify”commandfromtheEditmenuwilldothejob.Yousubformula-selecttwoormoresubformulaewhichyouwanttomakethesamebyreplacingunknowns(command/control-alt/option/middle-press-and-dragisthegestureyouneedtomakemorethanonesubformulaselection).Figure6.4showsanexample.Notethattherearenoformulaselectionsingure6.4(a),onlysubformulaselections.6.4EliminatinganunknownwithhypThehypstepisreallyjustacloakfortheUnifycommand:makethisselectedconclusionthesameasthisselectedhypothesis(ortheseselectedhypotheses).Forexampleseegure6.5.Notethatmaking:9x::R(x)thesameas: B1meansmaking9x::R(x)thesameas B1. 34CHAPTER6.UNKNOWNS,HYPANDUNIFY Figure6.8:Jape'sreasonforrejectingunicationstep6.5ProvisosandtheprivacyconditionRecallthatthe8introand9elimstepsintroduceavariable—i,i1,i2,...—forprivateusewithinageneralisedproof.Ifaproofattemptdoesn'tincludeunknowns,Japecanenforcetheprivacyconditioneasily:simplyuseavariablethatisn'tinusealready,anywhereintheproof.Ifthereareunknownsabout,thingsaren'tsosimple:Japehastoensurethatyoudon'tunifythatunknownwithaformulathatusestheprivatevariable,becausethatcouldviolatetheprivacycondition.Figure6.6showswhathappenswhenJapehastoinventavariableandthereisanunknownintheproof.Itmustprohibitthepossibilitythattheformula B1includesthevariablei:itdoesthiswiththeproviso“iNOTIN B1”intheprovisopanebelowtheproof.Figure6.7showspreparationforanattempttoviolatetheprovisowithaUnifycommand(making B1,whichappearsoutsidethebox,thesameasR(i)insidethebox).Figure6.8showstheerrormessagethatJapegenerateswhenyoutrytheunication.Yougetthesamesituationifyoutrythestepsintheotherorder(8introbackwards,_introforwardsselectingonlythehypothesis). Chapter7DisproofMyencodingofnaturaldeductioninJapedealswithdisproofbyallowingyoutomakeKripkediagramswhichJapewillcheckagainstasequenttoseeiftheyareexamples,orcounter-examples,orneither.Youdoitbymanipulatingblobs,linesandatomicformulaeinadisproofpaneabovetheproof.Japeshowsyouwhatisgoingonbyunderliningandcolouringformulaeandsubformulaeinthesequentandbycolouringblobsonthescreen.Thischaptershould,therefore,bereadincolourratherthaninmonochrome.17.1GettingstartedAtanypointduringaproofattemptyoucaninvoke`Disprove'fromtheEditmenu.2JapesplitstheproofwindowandshowsyouaKripkediagramwithasingleemptyworldandtheproof-attemptsequent(youcanselecthypothesesandconclusionstoconstructanalternativesequent:seebelow)inadisproofpaneabovetheproofpane.Thesequentmayalreadybeunderlinedandcolouredasingure7.1.Themainthingstonoticeinthisillustrationaretheblobinthediagramisringedinred;someofthenamesandconnectivesinthesequentarecolouredmagenta,somearegrey,andsomeareblack;someoftheformulaeareunderlined andsomearenot;thesequentusesthesemanticturnstile;there'salittlegreenwastebinontheright;abovethewastebintherearesometiles,eachcontaininganatomicformula. 1Iamawarethatuseofcolourmeansthatsomepeoplecan'tuseJapeaseasilyasothers.Thisisonlythetipofanastyiceberg:Japeusesavisualpresentationtomakeiteasiertounderstandproofanddisproof,andthatexcludesmanypeoplewithreducedvisualacuityfromusingitatall.Contrarytosomepropaganda,theseproblemsaren'teasytoovercome.ButI'dlovetotry,andI'dlovetohearfromanybodywhohassuggestionstomake,advicetooffer,technicalinformationtoshare,guinea-piggerytovolunteer,whatever.Messagestomeatthetitlepageaddress,asusual.2Thereisn'taDisprovebuttonintheconjecturepanels.Perhapsthereshouldbe!YouhavetohitProvetostartaproofattemptandthenchooseEdit:Disprove.35 36CHAPTER7.DISPROOF Figure7.1:Proofattemptwithproofpanebelowanddisproofpaneabove Figure7.2:Amulti-worldsituation Figure7.3:Asingle-worldsituationIngeneralmagentameans`forced',blackmeans`unforced'andgreymeans`irrelevant'.Becauseofoperatingsystemvariations,yourwindowmaynotlookexactlyliketheillustration,butitwillhavethesameparts.InotherillustrationsIshowtheimportantbitsoftheproofand/ordisproofpanes,withoutthewastebinandthescrollbarsandstuff.7.2AlternativesequentsIfyouselectaconclusionintheproofpane(or,ifJapedoesn'twanttoletyoudothat,thereasonnexttotheconclusion)andthenhitEdit:Disprove,Japewillusethedisproofsequentconsistingoftheconclusionasconsequentandallthehypothesesaboveitasantecedentformulae.Ifyouselectsomeofthehypothesesaswellastheconclusion,theywillbeusedastheantecedents.Youcanchooseanewdisproofsequentatanytime,eveninthemiddleofadisproofattempt.Ifyouwanttosetupanentirelynewchallenge,enteritintooneoftheconjecturespanels(Newbutton),hitProveandthenEdit:Disproveintheproofwindow.7.2.1SelectingasituationThereisalwaysoneselectedworldinadiagram,ringedinred.TheselectedworldistherootworldofthesituationevaluatedbyJape.Forexample,ingure7.2thesituationisthewholediagram;ingure7.3it's 7.3.MAKINGDIAGRAMS37 Figure7.4:Asimplecounter-example Figure7.5:Anelaboratecounter-examplethesingleworldattopleft.7.2.2What'sforced?—colouring,greying,underliningJapeevaluatesalltheformulaeandsub-formulaeofthesequentinthesituationwiththeselectedworldasitsroot,andcoloursallthoseformulaeandsub-formulae.Thedefaultcolourisblack,anditmeansnotforced.Ifa(sub-)formula'svalueisnevercalledon—usuallythisistrueofquantiedpredicates,forexample—thenit'sgrey,meaningstrictlyirrrelevant.Anatomic(sub-)formulawhichisforcediscolouredmagenta(thiscoversatomslikeE,atomicpred-icateslikeS(j)andindividualslikeactualk).Whenanon-atomic(sub-)formulaisforced,itsconnectiveiscolouredmagenta.Whenanentiresequentpremiseorconclusionisforced,itisunderlined inmagenta.So:whenallthepremisesaremagenta-underlinedandtheconclusionisnot,youhaveacounter-example;wheneverythingisunderlinedyouhaveanexample;otherwiseyouhavenothinginparticular.Figure7.4showsasamplecounter-example,andthecolouringgivesahintofwhyit'sacounter-example:Eisn'tforcedanywhere,sothepremiseimplicationisforced(magentaarrow,underlining);andthen,becauseE!FisforcedbutGisn't,theconclusionisn'tforced(blackarrow,nounderlining).Figure7.5showsanelaboratecounter-example:thepremisesareobviouslyforced,buttherearenoindividualstoforcethe9quanticationintheconclusion.Thedisproofpaneingure7.1showsneitheracounter-examplenoranexample.Thepremisesaren'tforcedbecause,asatomicformulae,theyaren'tpresentattherootworld;theconclusionisforcedbecauseeveryindividualinthesituation(therearen'tany...rememberthegreensheep)forcesaversionofR(x)!S(x).Similarremarksapplytogures7.2and7.3.7.3MakingdiagramsTobeginyourdisproofJapepresentsyouwiththesimplestdiagram:theisolatedemptyworld.Youaddcomponentstoyourdiagram—worlds,formulaeandlines—usingdrag-and-dropmousegestures.Youcandeletecomponentsbydraggingthemtothewastebin.Youcanaddtileswithdouble-clicks.YoucanUndoyouractionstoanydegreethatyoulike,andRedolikewise.3 38CHAPTER7.DISPROOFTomoveacomponentofadiagramyouputthemousepointeroverit,press(leftbuttononamulti-buttonmouse),holdamoment,then—stillpressing—movetoanewposition,andnallyrelease.Japeshowsyouatransparentimageofthethingyouaredragging,soyoucanseewhatyouaredoing.Toduplicateacomponentyouholddownthealt/optionkeythroughoutthegesture(orusethemiddlebuttononamulti-buttonmouse)andyoudraganewcopyofthethingyoupressedon.Sometimesthepurposeofthedragistodroponecomponentonto,orinto,another.Youdragtherstcomponentuntilthemousepointerisovertheoneyouwanttodroponto/into.Therecipientwillchangecolourifit'spreparedtoacceptthedrop,andyousimplyletgowhileit'slitup.Ifthedropfails(youaren'toveracomponent,oritwon'tlightup)thenthedroppedcomponentiesbacktobase.7.3.1DraggingworldsYoucanmove-dragworldsabouttheplacetomakeyourdiagramlooknicer.Youpressontheblob,andyoudragtheblobplusanyformulaeattachedtoit.Linesconnectedtotheworldstayconnected,andyoucandropitanywhereyoulike.Topreservethe`connectionsonlyupwards'principle,Japewilldeletealineifyoudragaworldbelowitsparent.Byduplicate-draggingablob,youdragacopyoftheworld—theblobplusanyformulaeattachedtoit—withalineattachingittotheworlditcamefrom.Thenewworldstayswhereyouputit.Ifit'sabovetheworldyoudraggeditfrom,theywillbeconnectedbyaline.Ifit'slevelorbelow,thennoline.Youcandragaworldontoaline(whichlightsuptoshowyouareoverit)oranotherworld(whichlightsupditto)andJapedoestheobviousthing,addingwhateverformulaearenecessarytowhateverworldsinordertomaintainmonotonicity.Ifyoudragaworldtothewastebinit'sdeleted,alongwithalltheformulaeattachedtoitandallthelinesconnectedtoit.Thebinlightsupwhenitwillaccepttheworld;itwon'tacceptthecurrently-selectedworld.Ifyoudroptheworldontoanotherthetwoworldsaremerged.Japedoesthecorrectmonotonicityadjust-mentstothediagrambyaddingformulaetothechildrenofthedestination.7.3.2DragginglinesYoucandraglinesanddropthemontoworldsorintothewastebin,asyouwish.Japedoestheobviousthingineachcase(ifyoucan'tguesswhatthatis,justtryit!).IfyouwanttomakealinebetweenworldAandworldB,whereAisbelowB,duplicate-dragAtoBanddropthenewworldontoB.Japemakesthemonotonicityadjustments,addingformulaetoBanditschildrenasnecessary.DraggingfromBtoAwillhavesomenot-very-usefuleffect(butthere'salwaysUndo!).7.3.3DraggingformulaeYoucandropaformulaonaworld,ordragitawayfromaworld,inoneofseveralways.Ifaformulaisaddedtoaworldthen,topreservemonotonicity,itisaddedtothechildrenofthatworldaswell.Ifaformulaisdeletedfromaworldthenitisdeletedfromallancestorsofthatworld.Youcandragaformulafromatileanddropitontoaworld(theworldlightsup,ofcourse,toshowthatit'seagertoaccept;worldswon'tacceptasecondcopyofaformulatheyalreadyhave).Theformulaisn'tdeletedfromthetile,whicheverkindofdraggestureyouuse,becausetilesareinnitesourcesofformula-copies. 3UndoandRedoapplytothelastpaneyouusedthemousein,eitherproofordisproof. 7.4.MAKINGINDIVIDUALSANDPREDICATEINSTANCES39 Figure7.6:Acounter-example Figure7.7:::Eforcedhere Figure7.8:::E!Eforcedhere Figure7.9::Eforcedhere Figure7.10:Multipleforcing Figure7.11:ToomuchforcingYoucanmove-dragaformulafromoneworldontoanother;itisaddedtothedestinationworldanddeletedfromthesourceworld.Ifyouduplicate-dragitinstead,itissimplyaddedtothedestinationworld.7.4MakingindividualsandpredicateinstancesIfasequentmentionsanindividualbyincludingahypothesislikeactualj,thentherewillbeatileforthatindividual(seegures7.1,7.2,7.3and7.5,forexample).Iftherearequantiersbutnoindividualsyouwillgetafreeactualitile.Ifyouneedmoreindividuals,double-clickany“actual:::”tile.Japeusesanobviousnumberingalgorithmtonamethenewindividual—actualj,forexample,generatesrstactualj1thenactualj2,andsoon.4Ifyouwanttomakeanewpredicateinstance,double-clickapredicate-instancetile.Japelooksthroughyourtilesforunusedindividualsandusesthemtogiveyouanewone.ForexampleifyouhaveatileforS(j)andtilesforactualjandactualj1,thendouble-clickingS(j)getsyouS(j1),asyoumightexpect.Ifthere'smorethanoneinstancethatcouldbemade,Japeshowsyouthealternativesandasksyoutochoose.Ifyoudon'thaveenoughindividualstomakeanewinstance,ittellsyouso.7.5ExploringreasonsThehardestthingtoexplaintoanoviceiswhyaparticularformulaisforcedinaparticularsituation.Figure7.6showsaparticularlyludicrousformulaanditscounter-example,whichreallyneedsexplanation.Japeprovidesmechanismswhichcanbesomehelp. 4Itwouldbenicerifitwenti,j,k,i1,j1,k1,i2,...OnedayI'llmakeitdothat. 40CHAPTER7.DISPROOF Figure7.12:SupportforaquantierThecolouringofatomic(sub-)formulaeandconnectivesistherstmechanism.Butwiththenegativeconnectives—!and:—andwiththequantiers,weoftenneedabitmorehelp.Japeallowsyoutoselect(clickorleft-click)orsubformula-select(alt/option/middle-press-and-drag)inthesequent.Itwillcolourmagentaalltheworldswhichforcetheselected(sub)formula.Forexample,gure7.7showswhere::Eisforcedinthedifcultexample.Figures7.8and7.9showinformationaboutsomeothersubformulae.Ifyouchoosemorethanoneformula,Japecolourstheworldsthatforcethemall:seegures7.10and7.11.Ifyouchooseaquantierformulainthesequent,Japecoloursmagentanotonlytheworldswhichsupportit,butalsothepresencemarkerswhichsupportthatformula:i.e.individualsatworldswhichwhichgenerateaforcedformulaifyouinstantiatethequantiedformulawiththem.Ingure7.12,forexample,worldswhichforcetheselectedquantieraremagenta;individualswhichsupportitaremagentatoo.YoucanseethatR(k)!R(j)^R(k)ateachoftheworldsinthisexample.7.6CompletingadisproofWhenyouhaveadisproof(allthepremisesunderlined,theconclusionnotunderlined),youcanregisteritwithJapeusingEdit:Done.Disprovedconjecturesaremarkedwithacross;provedconjecturesgetatick.Becauseyoucanprovesomeconjecturesclassicallyandalsodisprovethemconstructively,it'spossibletogetbothatickandacrosstogether.Seegure1.5onpage8forexamples.7.7PrintingdisproofsYoucanprintorexportanimageofthedisproofpane,usingEdit:PrintDisprooforEdit:ExportDisproof. Chapter8Usingtheoremsandstatingconjectures8.1UsingtheoremsAtheoremisaprovedconjecture,onewithaticknexttoitinaconjecturepanel.JapeletsyouusethetheoremA1;A2;:::;An`BasifitwastheruleA1A2:::An BYoucanapplyatheorembackwardsorforwardsusingtheApplybuttoninitsconjecturepanel.Toworkbackwards,justselectanopenconclusionintheproofwindow,selectthetheoreminitspanel,andpresstheApplybutton.Japewillapplythetheoremlikeanyrule,instantiatingittottheconclusion,makingantecedentsofitspremisesandenteringthemashypothesesorlinkingtoexistinghypothesesifpossible.Seegure8.1,forexample.Becauseforwardstepstakealotofcarefuluseofbehind-the-scenestechnology,theoremsworkbestback-wards.Butsometimesyoumustworkforwards,andyoucandothatintwoways.Ifyourtheoremhasexactlyonepremise,youcanselectahypothesistomatchthatpremiseandapplythetheoremlikeaforwardrule,asillustratedingure8.2.Ifyourtheoremhasnopremisesormorethanonepremise,don'tselectahypothesisbutdoselectaconclu-sionandapplythetheorem.Itsoundsdaftbutitworks:Japemakesaversionofthetheoreminwhichallthevariableandformulanamesarereplacedbyunknownsandinsertsitintotheproof,asillustratedingure8.3.YouhavetogetridoftheunknownsusinghypstepsortheUnifycommand,asdescribedinchapter6. (a)before:conclusionE_:Eselected (b)after:hypothesis:(:E^::E)generatedFigure8.1:Theoremappliedbackward41 42CHAPTER8.USINGTHEOREMSANDSTATINGCONJECTURES (a)before:hypothesis(E!F)!Eselected (b)after:consequent(E^F)!EgeneratedFigure8.2:Single-premisetheoremappliedforward (a)before:conclusionselected (b)after:theoreminserted,withunknownsFigure8.3:Theoremappliedtonon-matchingconclusion Figure8.4:TheNewConjecturewindow 8.2.STATINGYOUROWNCONJECTURES438.2StatingyourownconjecturesPressthe“New...”buttononanyconjecturespanelandyouseeawindowlikegure8.4.Youtypeyourconjectureusingthekeyboardinthenormalway,andyoucanusethebuttonsprovidedtogetthefancysymbolsthataren'tonyourkeyboard.Namesinaconjecturehavetoobeycertainrules:variablesmuststartwithx,y,z,i,jorkandcancontinuewithanyletterordigit;formulaorpredicatenamesmuststartwithA,B,C,D,E,F,G,H,P,R,SorTandcancontinuewithanyletterordigit.Ifyoumakeamistake,likeleavingoutadotorabracketinacrucialspot,ortypinganameitcan'trecognise,Japewillcomplain.Ifyoumakemorethanonemistake,Japeonlyspotstherst(readinglefttoright).Sometimestheerrormessageswillbehardtounderstand:I'msorryforthat,butit'sreallyhardtoimprovethem. 44CHAPTER8.USINGTHEOREMSANDSTATINGCONJECTURES Chapter9Troubleshooting9.1ProblemsgettingstartedOnMacOS/OSXyoursecuritysettingsmaystopyourunningJape,sayingitcomesfromaunknowndeveloper.There'sawayroundthis:ctrl-clickJape,chooseOpenfromthelittlemenuthatappears,andsayOpenonthealertwindowthatcomesup.Afterthatitcanbedouble-clickedasnormal.OnWindowsandLinuxBernarddistributesan`installationjar'–abundleofstuffthatdistributesitselfroundyourlestore.Fromhiswebsite:Itisneverappropriateforyoutounpackthe.jarle,butitturnsoutthatcertainle-archivingsoftwareontheseoperatingsystemstelltheoperatingsystemthat.jarlesarearchives,andthatopeningmeansunpacking.OnaLinuxmachinethewayroundthisistojava-jarInstall...jape.jarfromaterminalwindow.OnaWindowsmachineright-clickonthejarle,andselecttheOpenwith...java...menuentry.TheJapeappcanbeputanywhereyoulike.Theexamplescanbeanywhereyoulike.IfyouinstalledJapeanditwon'tstartproperly,throwitallawayandinstallitagain.Thistimefollowtheinstructionsprecisely.Thenitwillwork.9.2Whatifaproofstepgoeswrong?Whenyoutrytoapplyaruleoneoftwothingscanhappen.Eithertheruleapplies,andthestepgoesthrough,oritdoesn't,andJapeshowsyouanerrormessage.Eventhougharuledoesapplyandtheproofstepdoesgothrough,itmaynotturnouttobetherightthingtodo.Sometimesanapparentlysuccessfulstepcanleadtoadeadend.Sometimesastepworks,butnotinthewaythatyouexpected—perhapslotsofunknownssuddenlyappearintheproof,ortherearelotsofextralinesthatyoudidn'texpect,orlotsoflinessuddenlydisappear.Wheneversomethinghappensthatisn'twhatyouexpected,therststageofacureistousetheUndocommandfromtheEditmenu.Undotakesyoubackonestepintheproof,twoUndostakeyoubacktwosteps,andsoon.UsingseveralUndoscanmoveyoubackfromadeadendtoanearlierpositionfromwhichyoucanmoveforwardinadifferentdirection.YoucanevenrecoverfromUndo!TheRedocommand(alsointheEditmenu)reversestheeffectofUndo,twoRedosreversetwoUndos,andsoon.Soifyoudecide,afterUndoing,thatyoureallydidwanttomake45 46CHAPTER9.TROUBLESHOOTINGthestepafterall,Redowillmakeitagain.(IfyouUndoandmakeanewproofstep,thentheoneyouUndidisgoneforever,likeitornot.)TheUndocommandallowsyoutoexploreifyoudon'tknowwhatruleortheoremtoapplyinaproof:youcanexperimentwithdifferentrulesandtheoremsfromthemenusuntilyoundonethatworks.Thatcanbeabadthing,ifyoujusttrythingsatrandomuntilyoundonethathappenstowork,anddon'treectonwhatyouaredoing.It'salsotheslowestwayofndingproofs.Butsometimesweallneedtosearchandexperiment(aka“thrashabout”),andthenUndoandRedoareinvaluable.Ihopethatwhenyoudosearchandndasurprisingavenuethathappenstowork,.youwillpausetoaskyourselfwhyitworks.Japeisdesignedtosupport`reectiveexploration'—ithelpswiththeexploringpart,andyoulearnbyreectingontheresults.

Shom More....
By: min-jolicoeur
Views: 35
Type: Public

Download Section

Please download the presentation from below link :


Download Pdf - The PPT/PDF document "toreplyquicklyandifyourmessageisofgenera..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Try DocSlides online tool for compressing your PDF Files Try Now

Related Documents