1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
1.  Does X start with a string not found starting a string in A?
    Yes:
      Does Y start with the same string?
      Yes:
        Go to 2.
      No:
        Y IS NOT A VALID THEOREM
    No:
2.    Does X end with a string not found ending a string in A?
      Yes:
        Does Y end in the same string?
        Yes:
          Go to 3.
        No:
          Y IS NOT A VALID THEOREM
      No:
3.      Does Y start with a string not found starting a string in B?
        Yes:
          Does X start with the same string?
          Yes:
            Go to 4.
          No:
            Y IS NOT A VALID THEOREM
        No:
4.        Does Y end with a string not found ending a string in A?
          Yes:
            Does X start with the same string?
              Yes:
                UNDETERMINED CASE 1
              No:
                Y IS NOT A VALID THEOREM
          No:
            UNDETERMINED CASE 2