This is a part of Grammars/gra_pknot_microstate.gap. It is responsible for Strategy A computation of kissing hairpins for the program pKiss.
Strategy A makes the optimistic assumption that an optimal pseudoknot for the first half of the input sequence can be taken over to the kissing hairpin. The missing stem is adopted by an optimal, consistent pseudoknot for the second half.