▁next ▁comparison ▁phase ▁a ▁prefix ▁of ▁ ▁must ▁match ▁the ▁substring ▁. ▁Thus ▁if ▁the ▁compar isons ▁get ▁down ▁to ▁position ▁ ▁of ▁, ▁an ▁occurrence ▁of ▁ ▁can ▁be ▁recorded ▁without ▁explicitly ▁comparing ▁past ▁. ▁In ▁addition ▁to ▁increasing ▁the ▁efficiency ▁of ▁Bo yer – Mo ore , ▁the ▁Gal il ▁rule ▁is ▁required ▁for ▁prov ing ▁linear - time ▁execution ▁in ▁the ▁worst ▁case . ▁ ▁The ▁Gal il ▁rule , ▁in ▁its ▁original ▁version , ▁is ▁only ▁effective ▁for ▁versions ▁that ▁output ▁multiple ▁matches . ▁It ▁updates ▁the ▁substring ▁range ▁only ▁on ▁, ▁i . e . ▁a ▁full ▁match . ▁A ▁generalized ▁version ▁for ▁dealing ▁with ▁sub matches ▁was ▁reported ▁in ▁ 1 9 8 5 ▁as ▁the ▁Apost ol ico – G ian car lo ▁algorithm . ▁ ▁Performance ▁The ▁Bo yer – Mo ore ▁algorithm ▁as ▁presented ▁in ▁the ▁original ▁paper ▁has ▁worst - case ▁running ▁time ▁of ▁ ▁only ▁if ▁the ▁pattern ▁does ▁not ▁appear ▁in ▁the ▁text . ▁This ▁was ▁first ▁proved ▁by ▁Kn uth , ▁Morris , ▁and ▁Pr att ▁in ▁ 1 9 7 7 , ▁followed ▁by ▁Gu ib as ▁and ▁Od ly z ko ▁in ▁ 1 9 8 0 ▁with ▁an ▁upper ▁bound ▁of ▁ ▁compar isons ▁in ▁the ▁worst ▁case . ▁Richard ▁Cole ▁gave ▁a ▁proof ▁with ▁an ▁upper ▁bound ▁of ▁ ▁compar isons ▁in ▁the ▁worst ▁case ▁in ▁ 1 9 9 1 . ▁ ▁When ▁the ▁pattern ▁does ▁occur ▁in ▁the ▁text , ▁running ▁time ▁of ▁the