semialgorithm