Skip to content
Snippets Groups Projects
Commit 1f91ca7a authored by Jan Trávníček's avatar Jan Trávníček
Browse files

more simplifications in ExactPatternMatch

parent 777e526a
No related branches found
No related tags found
1 merge request!145Merge jt
Pipeline #80527 failed
...@@ -80,7 +80,7 @@ private: ...@@ -80,7 +80,7 @@ private:
static bool matchUnorderedHelper ( const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ); static bool matchUnorderedHelper ( const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable );
   
template < class SymbolType > template < class SymbolType >
static void matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ); static void matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < SymbolType > & subject, const ext::tree < SymbolType > & pattern, const SymbolType & subtreeVariable );
   
}; };
   
...@@ -190,12 +190,12 @@ bool ExactPatternMatch::matchUnorderedHelper ( const ext::tree < common::ranked_ ...@@ -190,12 +190,12 @@ bool ExactPatternMatch::matchUnorderedHelper ( const ext::tree < common::ranked_
} }
   
template < class SymbolType > template < class SymbolType >
void ExactPatternMatch::matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ) { void ExactPatternMatch::matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < SymbolType > & subject, const ext::tree < SymbolType > & pattern, const SymbolType & subtreeVariable ) {
if ( matchUnorderedHelper ( subject, pattern, subtreeVariable ) ) occ.insert ( index ); if ( matchUnorderedHelper ( subject, pattern, subtreeVariable ) ) occ.insert ( index );
   
index++; index++;
   
for ( const ext::tree < common::ranked_symbol < SymbolType > > & child : subject.getChildren ( ) ) for ( const ext::tree < SymbolType > & child : subject.getChildren ( ) )
matchUnorderedInternal ( index, occ, child, pattern, subtreeVariable ); matchUnorderedInternal ( index, occ, child, pattern, subtreeVariable );
} }
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment