Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing:tree structures #1

Closed
wants to merge 2 commits into from

Conversation

v1ta111
Copy link

@v1ta111 v1ta111 commented Jan 31, 2024

@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
Copy link
Author

v1ta111 commented Feb 3, 2024

I mark this PR as a draft.

see: PR 2: example of generating the tree

@mensch72
Copy link

mensch72 commented Feb 3, 2024 via email

@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