"singlefold.hh" is a little hack to save code duplication. The only difference between a grammar for single sequence input and alignment input is the base-pairing filter. We use the special pair function, which does different things for both input types. For the single sequence input it just calls the GAP built-in basepairing
filter.
Should you also want to use this trick, ensure to insert the line import "Extensions/singlefold.hh"
or import "Extensions/alifold.hh"
in your BGAP program for single sequence inputs or alignment inputs, respectively.