From 9875d60b9126881fb10f395645ad941ec4b0e6bf Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 4 Apr 2018 20:44:07 +0200 Subject: [PATCH] some comments on Reversed BCS construction --- .../src/tree/properties/ReversedBadCharacterShiftTable.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h index ad2e930901..4cf4a3d779 100644 --- a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h +++ b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h @@ -65,8 +65,7 @@ ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadC // of the first symbol representing the variable's bar size_t firstSBarOffset = FirstVariableOffsetFront::offset ( pattern ) + 1; - // limit the shift by occurrence of the last variable - + // limit the shift by occurrence of the last variable's bar for ( const common::ranked_symbol < SymbolType, RankType > & symbol : alphabet ) { if ( ( symbol == pattern.getSubtreeWildcard ( ) ) || ( pattern.getNonlinearVariables ( ).count ( symbol ) ) || ( symbol == pattern.getVariablesBar ( ) ) ) continue; @@ -118,9 +117,10 @@ ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadC } // find the distance between the beginning of the pattern and the index - // of the first symbol representing the variable's bar + // of the first symbol representing the variable size_t firstSOffset = FirstVariableOffsetFront::offset ( pattern ); + // handle situation when the pattern is just S if ( firstSOffset == 0 ) firstSOffset = 1; // limit the shift by occurrence of the last variable -- GitLab