Introduction

Two words over a finite alphabet are said to be equivalent by the Simon's congruence at index n if they have the same set of scattered subwords (also called subsequences) of length upto n. A set of words is said to be n-piecewise-testable if it is closed under this congruence. See this paper for detailed definitions and examples. This page has some tools to compute with the Simon's congruence.

The tools are written in Python and run in your browser using Brython.

PT-level calculator

This tool calculates the PT-level of singleton languages. That is, given a word w, it computes the smallest n such that {w} is n-piecewise-testable. Execution here may take a long time, for longer words run the Python code directly.

PT-level:

Simon's equivalency calculator

This tool calculates the "Simon's equivalency" of two words. That is, given two words, it calculates the largest n such that the two words are equivalent by the Simon's congruence at level n (or -1 if the words are equal). Execution here may take a long time, for longer words run the Python code directly.

Equivalency: