Skip to content

Testing:tree structures#1

Closed
v1ta111 wants to merge 2 commits into
pik-gane:masterfrom
v1ta111:testing/tree-structures
Closed

Testing:tree structures#1
v1ta111 wants to merge 2 commits into
pik-gane:masterfrom
v1ta111:testing/tree-structures

Conversation

@v1ta111

@v1ta111 v1ta111 commented Jan 31, 2024

Copy link
Copy Markdown

@mensch72 please take a look to see if the changes make sense.

Rationale

when we compare the outputs of two programs in testing the two outcomes are possible

  • all tests are green
  • some (including all) tests are red

The former outcome has an information gain of 0: tests may be wrong and dual to bugs in programs
The latter outcome has information gain greater or equal to zero by default.

These changes should reduce the chances of zero information gain when some tests are red.

Two questions

Proposed output structures are answering two questions

  • What happened?
  • How come?

A forward diagram answers the former with a prefix tree structure, while a backward diagram answers the latter.

So what?

When we compare the outputs of simulations we will compare two prefix trees. And in a case when there's a mismatch, the case's forward and backward prefix trees will provide information on how different the answers for the two questions from above are.

Addendum

An example of a forward tree

PrefixTree {
  '@(1,2)': LocationVertex {
    '#|e49RO8I9BwAlqiDBu3nhZhTNKkc=|': StateVertex {
      '/r/': ActionVertex {
        '@(2,2)': LocationVertex {
          '#|djDflTQXDvMReE182hjm3a/Ni+k=|': StateVertex {
            '/d/': ActionVertex {
              '@(2,1)': LocationVertex {
                '#|LWE09PxwFqpKf6ecRW6IKUNGURY=|': StateVertex {
                  '/l/': ActionVertex {
                    '?': [
                      { aleph: [ 3, 3 ] },
                      { P: 6.971189141217938e-9 },
                      { P: 0.4443568623910541 }
                    ]
                  },
                  '?': [ { aleph: [ 3, 3 ] } ]
                }
              },
              '?': [
                { aleph: [ 3, 3 ] },
                { P: 6.971189141217938e-9 },
                { P: 0.4443568623910541 }
              ]
            },
            '/r/': ActionVertex {
              '@(3,2)': LocationVertex {
                '#|05zSzf2pqMVux2dV8GBRH+UDr6E=|': StateVertex {
                  '/d/': ActionVertex {
                    '@(3,1)': LocationVertex {
                      '#|gUUfXq5miAoZdSGoqXiDyWcafmc=|': StateVertex {
                        '/l/': ActionVertex {
                          '?': [
                            { aleph: [ 2, 2 ] },
                            { P: 0.00017913813801814858 },
                            { P: 0.11108921559776369 }
                          ]
                        },
                        '?': [ { aleph: [ 2, 2 ] } ]
                      }
                    },
                    '?': [
                      { aleph: [ 2, 2 ] },
                      { P: 0.00017913813801814858 },
                      { P: 0.11108921559776369 }
                    ]
                  },
                  '?': [ { aleph: [ 2, 2 ] } ]
                }
              },
              '?': [
                { aleph: [ 2, 2 ] },
                { P: 0.00017913813801814858 },
                { P: 0.11108921559776369 }
              ]
            },
            '?': [ { aleph: [ 1.99, 2.2100000000000004 ] } ]
          }
        },
        '?': [
          { aleph: [ 1.99, 2.2100000000000004 ] },
          { P: 6.971189141217938e-9 },
          { P: 0.00017913813801814858 },
          { P: 0.4443568623910541 },
          { P: 0.11108921559776369 }
        ]
      },
      '/d/': ActionVertex {
        '@(1,1)': LocationVertex {
          '#|PR9QtwK1/0DViVck3rlqrscUCBU=|': StateVertex {
            '/l/': ActionVertex { '?': [ { aleph: [ 1, 1 ] }, { P: 0.4443747769019749 } ] },
            '?': [ { aleph: [ 1, 1 ] } ]
          }
        },
        '?': [ { aleph: [ 1, 1 ] }, { P: 0.4443747769019749 } ]
      },
      '?': [ { aleph: [ 1.9, 2.1 ] } ]
    }
  }
}

An example of a backward tree

PrefixTree {
  '@(2,1)': LocationVertex {
    '#|LWE09PxwFqpKf6ecRW6IKUNGURY=|': StateVertex {
      '/l/': ActionVertex {
        '@(2,2)': LocationVertex {
          '#|djDflTQXDvMReE182hjm3a/Ni+k=|': StateVertex {
            '/d/': ActionVertex {
              '@(1,2)': LocationVertex {
                '#|e49RO8I9BwAlqiDBu3nhZhTNKkc=|': StateVertex {
                  '/r/': ActionVertex {
                    '?': [
                      { aleph: [ 1.99, 2.2100000000000004 ] },
                      { P: 6.971189141217938e-9 },
                      { P: 0.4443568623910541 }
                    ]
                  },
                  '?': [ { aleph: [ 1.9, 2.1 ] } ]
                }
              },
              '?': [
                { aleph: [ 3, 3 ] },
                { P: 6.971189141217938e-9 },
                { P: 0.4443568623910541 }
              ]
            },
            '?': [ { aleph: [ 1.99, 2.2100000000000004 ] } ]
          }
        },
        '?': [
          { aleph: [ 3, 3 ] },
          { P: 6.971189141217938e-9 },
          { P: 0.4443568623910541 }
        ]
      },
      '?': [ { aleph: [ 3, 3 ] } ]
    }
  },
  '@(3,1)': LocationVertex {
    '#|gUUfXq5miAoZdSGoqXiDyWcafmc=|': StateVertex {
      '/l/': ActionVertex {
        '@(3,2)': LocationVertex {
          '#|05zSzf2pqMVux2dV8GBRH+UDr6E=|': StateVertex {
            '/d/': ActionVertex {
              '@(2,2)': LocationVertex {
                '#|djDflTQXDvMReE182hjm3a/Ni+k=|': StateVertex {
                  '/r/': ActionVertex {
                    '@(1,2)': LocationVertex {
                      '#|e49RO8I9BwAlqiDBu3nhZhTNKkc=|': StateVertex {
                        '/r/': ActionVertex {
                          '?': [
                            { aleph: [ 1.99, 2.2100000000000004 ] },
                            { P: 0.00017913813801814858 },
                            { P: 0.11108921559776369 }
                          ]
                        },
                        '?': [ { aleph: [ 1.9, 2.1 ] } ]
                      }
                    },
                    '?': [
                      { aleph: [ 2, 2 ] },
                      { P: 0.00017913813801814858 },
                      { P: 0.11108921559776369 }
                    ]
                  },
                  '?': [ { aleph: [ 1.99, 2.2100000000000004 ] } ]
                }
              },
              '?': [
                { aleph: [ 2, 2 ] },
                { P: 0.00017913813801814858 },
                { P: 0.11108921559776369 }
              ]
            },
            '?': [ { aleph: [ 2, 2 ] } ]
          }
        },
        '?': [
          { aleph: [ 2, 2 ] },
          { P: 0.00017913813801814858 },
          { P: 0.11108921559776369 }
        ]
      },
      '?': [ { aleph: [ 2, 2 ] } ]
    }
  },
  '@(1,1)': LocationVertex {
    '#|PR9QtwK1/0DViVck3rlqrscUCBU=|': StateVertex {
      '/l/': ActionVertex {
        '@(1,2)': LocationVertex {
          '#|e49RO8I9BwAlqiDBu3nhZhTNKkc=|': StateVertex {
            '/d/': ActionVertex { '?': [ { aleph: [ 1, 1 ] }, { P: 0.4443747769019749 } ] },
            '?': [ { aleph: [ 1.9, 2.1 ] } ]
          }
        },
        '?': [ { aleph: [ 1, 1 ] }, { P: 0.4443747769019749 } ]
      },
      '?': [ { aleph: [ 1, 1 ] } ]
    }
  }
}

@v1ta111 v1ta111 requested a review from mensch72 January 31, 2024 09:32
@v1ta111 v1ta111 self-assigned this Jan 31, 2024
@v1ta111 v1ta111 requested a review from martinkunev January 31, 2024 09:36
@v1ta111 v1ta111 marked this pull request as draft February 3, 2024 07:53
@v1ta111

v1ta111 commented Feb 3, 2024

Copy link
Copy Markdown
Author

I mark this PR as a draft.

see: PR 2: example of generating the tree

@mensch72

mensch72 commented Feb 3, 2024 via email

Copy link
Copy Markdown

@v1ta111 v1ta111 closed this Feb 12, 2024
@v1ta111 v1ta111 deleted the testing/tree-structures branch February 12, 2024 10:52
@v1ta111 v1ta111 restored the testing/tree-structures branch February 12, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants