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

Intern IDs #3122

Closed
wants to merge 31 commits into from
Closed

Intern IDs #3122

wants to merge 31 commits into from

Conversation

develop7
Copy link

@develop7 develop7 commented Jun 27, 2022

Fixes #3112

Scope:

Estimate:

Benchmark

report-intern-ids.md
report.pdf


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

Currently failing unit tests

https://github.com/runtimeverification/haskell-backend/runs/7230663172?check_suite_focus=true#step:8:27642
https://github.com/runtimeverification/haskell-backend/runs/7230662258?check_suite_focus=true#step:7:15278 https://github.com/runtimeverification/haskell-backend/runs/7230879449?check_suite_focus=true#step:5:27905

@develop7
Copy link
Author

Right now I'm getting test failures like this

{-
↓ test/Driver.hs
↓ Test
↓ Kore
↓ Unification
↓ UnifierT
↓ mergeAndNormalizeSubstitutions
✗ Predicate from normalizing substitution -}

test/Test/Kore/Unification/UnifierT.hs:357:
Conditional
{ term = _
, predicate =
    Predicate
    { getPredicate =
        CofreeT
        { runCofreeT =
            Identity
            { runIdentity =
                _
                    :<
                    EqualsF
                        Equals
                        { equalsOperandSort = _
                        , equalsResultSort = _
                        , equalsFirst =
                            TermLike
                            { getTermLike =
                                _
                                    :<
                                    ApplySymbolF
                                        Application
                                        { applicationSymbolOrAlias =
                                            Symbol
                                            { symbolConstructor =
                                                InternedId
                                                { getInternedId =
                                                    {- was: "cf" -} "cg"
                                                , internedIdLocation = _
                                                }
                                            , symbolParams = _
                                            , symbolSorts = _
                                            , symbolAttributes = _
                                            }
                                        , applicationChildren = _
                                        }
                            }
                        , equalsSecond =
                            TermLike
                            { getTermLike =
                                _
                                    :<
                                    ApplySymbolF
                                        Application
                                        { applicationSymbolOrAlias =
                                            Symbol
                                            { symbolConstructor =
                                                InternedId
                                                { getInternedId =
                                                    {- was: "cg" -} "cf"
                                                , internedIdLocation = _
                                                }
                                            , symbolParams = _
                                            , symbolSorts = _
                                            , symbolAttributes = _
                                            }
                                        , applicationChildren = _
                                        }
                            }
                        }
            }
        }
    }
, substitution =
    Kore.Internal.Substitution.wrap (Assignment_
                                     { assignedVariable = _
                                     , assignedTerm =
                                         TermLike
                                         { getTermLike =
                                             _
                                                 :<
                                                 ApplySymbolF
                                                     Application
                                                     { applicationSymbolOrAlias =
                                                         _
                                                     , applicationChildren =
                                                         TermLike
                                                         { getTermLike =
                                                             _
                                                                 :<
                                                                 ApplySymbolF
                                                                     Application
                                                                     { applicationSymbolOrAlias =
                                                                         Symbol
                                                                         { symbolConstructor =
                                                                             InternedId
                                                                             { getInternedId =
                                                                                 {- was:
                                                                                 "cf"
                                                                                 -}
                                                                                 "cg"
                                                                             , internedIdLocation =
                                                                                 _
                                                                             }
                                                                         , symbolParams =
                                                                             _
                                                                         , symbolSorts =
                                                                             _
                                                                         , symbolAttributes =
                                                                             _
                                                                         }
                                                                     , applicationChildren =
                                                                         _
                                                                     }
                                                         }
                                                             :
                                                             _
                                                     }
                                         }
                                     }
        :
        _)
}
    :
    _

@develop7
Copy link
Author

@JKTKops would this diff below be a proper fix for a #3122 (comment) failure? Since it doesn't like variable order — well, let's swap them :) I mean, it's probably not a proper fix, but I've got to ask :)

diff --git a/kore/test/Test/Kore/Unification/UnifierT.hs b/kore/test/Test/Kore/Unification/UnifierT.hs
index 7f47e8882..c87cc24f4 100644
--- a/kore/test/Test/Kore/Unification/UnifierT.hs
+++ b/kore/test/Test/Kore/Unification/UnifierT.hs
@@ -336,10 +336,10 @@ test_mergeAndNormalizeSubstitutions =
                     [ Conditional
                         { term = ()
                         , predicate =
-                            Predicate.makeEqualsPredicate Mock.cf Mock.cg
+                            Predicate.makeEqualsPredicate Mock.cg Mock.cf
                         , substitution =
                             Substitution.unsafeWrap
-                                [(inject Mock.xConfig, Mock.constr10 Mock.cf)]
+                                [(inject Mock.xConfig, Mock.constr10 Mock.cg)]
                         }
                     ]
             actual <-
@@ -350,8 +350,8 @@ test_mergeAndNormalizeSubstitutions =
                         , substitution =
                             Substitution.wrap $
                                 Substitution.mkUnwrappedSubstitution
-                                    [ (inject Mock.xConfig, Mock.constr10 Mock.cf)
-                                    , (inject Mock.xConfig, Mock.constr10 Mock.cg)
+                                    [ (inject Mock.xConfig, Mock.constr10 Mock.cg)
+                                    , (inject Mock.xConfig, Mock.constr10 Mock.cf)
                                     ]
                         }
             assertEqual "" expect actual

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.072404 0.000005
test/regression-evm/test-pop1.sh 0.084362 0.000004
test/regression-evm/test-add0.sh 0.130515 0.000004
test/regression-evm/test-dsvalue-peek-pass-rough.sh 0.348928 -0.234976
test/regression-evm/test-and0.sh 0.130524 0.000004
test/regression-evm/test-branching-invalid.sh 0.078457 0.000005
test/regression-evm/test-straight-line.sh 0.044362 -0.000021
test/regression-evm/test-sumTo10.sh 0.346126 0.000005
test/regression-evm/test-storagevar03.sh 0.616474 -0.180135
test/regression-evm/test-sha3_bigSize.sh 0.091949 0.000005
test/regression-evm/test-totalSupply.sh 0.190181 -0.496830
test/regression-evm/test-sum-to-n.sh 0.233771 -0.177826
test/regression-evm/test-lemmas.sh 0.101967 -0.169843
test/regression-evm/test-addu48u48.sh 0.051598 -0.163384
test/regression-evm/test-straight-line-no-invalid.sh 0.036766 0.000005
test/regression-evm/test-mul0.sh 0.135530 0.000004
test/regression-wasm/test-wrc20.sh 0.914098 -0.102574
test/regression-wasm/test-loops.sh 0.093976 -0.150763
test/regression-wasm/test-memory.sh 0.069930 -0.151205
test/regression-wasm/test-simple-arithmetic.sh 0.028385 -0.151859
test/regression-wasm/test-locals.sh 0.009386 -0.155781

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005865 -0.228097
test/regression-evm/test-storagevar03.sh -0.001162 0.006590
test/regression-evm/test-totalSupply.sh -0.041387 -0.362458
test/regression-evm/test-sum-to-n.sh -0.003955 -0.170147
test/regression-evm/test-lemmas.sh 0.003291 0.072541
test/regression-evm/test-addu48u48.sh -0.086217 -0.177381
test/regression-wasm/test-wrc20.sh 0.807971 -0.060436
test/regression-wasm/test-loops.sh 0.002290 -0.150722
test/regression-wasm/test-memory.sh 0.007577 -0.151202
test/regression-wasm/test-simple-arithmetic.sh 0.009213 -0.151854
test/regression-wasm/test-locals.sh 0.010049 -0.155881

@github-actions
Copy link

github-actions bot commented Jul 5, 2022

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005961 -0.226855
test/regression-evm/test-storagevar03.sh -0.001212 0.007532
test/regression-evm/test-totalSupply.sh -0.041769 -0.361382
test/regression-evm/test-sum-to-n.sh -0.004097 -0.170065
test/regression-evm/test-lemmas.sh 0.003133 0.071801
test/regression-evm/test-addu48u48.sh -0.087299 -0.177365
test/regression-wasm/test-wrc20.sh 0.807886 -0.065289
test/regression-wasm/test-loops.sh 0.002282 -0.150722
test/regression-wasm/test-memory.sh 0.007564 -0.151202
test/regression-wasm/test-simple-arithmetic.sh 0.009216 -0.151854
test/regression-wasm/test-locals.sh 0.010054 -0.155881

@develop7
Copy link
Author

develop7 commented Jul 7, 2022

fixed by 8972684

Nix: ✔️ Stack: ✔️ Cabal: ✖️
↓ test/Driver.hs
↓ Test
↓ Kore
↓ Unification
↓ UnifierT
↓ mergeAndNormalizeSubstitutions
✗ Predicate from normalizing substitution
test/Test/Kore/Unification/UnifierT.hs:357:
2022-07-07T10:11:58.5050239Z Conditional
2022-07-07T10:11:58.5050330Z { term = _
2022-07-07T10:11:58.5050422Z , predicate =
2022-07-07T10:11:58.5050595Z     Predicate
2022-07-07T10:11:58.5050723Z     { getPredicate =
2022-07-07T10:11:58.5050828Z         CofreeT
2022-07-07T10:11:58.5050940Z         { runCofreeT =
2022-07-07T10:11:58.5051042Z             Identity
2022-07-07T10:11:58.5051146Z             { runIdentity =
2022-07-07T10:11:58.5051242Z                 _
2022-07-07T10:11:58.5051343Z                     :<
2022-07-07T10:11:58.5051453Z                     EqualsF
2022-07-07T10:11:58.5051564Z                         Equals
2022-07-07T10:11:58.5051724Z                         { equalsOperandSort = _
2022-07-07T10:11:58.5051918Z                         , equalsResultSort = _
2022-07-07T10:11:58.5052035Z                         , equalsFirst =
2022-07-07T10:11:58.5052153Z                             TermLike
2022-07-07T10:11:58.5052295Z                             { getTermLike =
2022-07-07T10:11:58.5052411Z                                 _
2022-07-07T10:11:58.5052531Z                                     :<
2022-07-07T10:11:58.5052684Z                                     ApplySymbolF
2022-07-07T10:11:58.5052833Z                                         Application
2022-07-07T10:11:58.5053031Z                                         { applicationSymbolOrAlias =
2022-07-07T10:11:58.5053155Z                                             Symbol
2022-07-07T10:11:58.5053329Z                                             { symbolConstructor =
2022-07-07T10:11:58.5053480Z                                                 InternedId
2022-07-07T10:11:58.5053645Z                                                 { getInternedId =
2022-07-07T10:11:58.5053934Z                                                     {- was: "cf" -} "cg"
2022-07-07T10:11:58.5054120Z                                                 , internedIdLocation = _
2022-07-07T10:11:58.5054317Z                                                 }
2022-07-07T10:11:58.5054470Z                                             , symbolParams = _
2022-07-07T10:11:58.5054632Z                                             , symbolSorts = _
2022-07-07T10:11:58.5054885Z                                             , symbolAttributes = _
2022-07-07T10:11:58.5055019Z                                             }
2022-07-07T10:11:58.5055198Z                                         , applicationChildren = _
2022-07-07T10:11:58.5055321Z                                         }
2022-07-07T10:11:58.5055435Z                             }
2022-07-07T10:11:58.5055570Z                         , equalsSecond =
2022-07-07T10:11:58.5055676Z                             TermLike
2022-07-07T10:11:58.5055815Z                             { getTermLike =
2022-07-07T10:11:58.5055931Z                                 _
2022-07-07T10:11:58.5056048Z                                     :<
2022-07-07T10:11:58.5056196Z                                     ApplySymbolF
2022-07-07T10:11:58.5056342Z                                         Application
2022-07-07T10:11:58.5056540Z                                         { applicationSymbolOrAlias =
2022-07-07T10:11:58.5056667Z                                             Symbol
2022-07-07T10:11:58.5056839Z                                             { symbolConstructor =
2022-07-07T10:11:58.5056990Z                                                 InternedId
2022-07-07T10:11:58.5057154Z                                                 { getInternedId =
2022-07-07T10:11:58.5057435Z                                                     {- was: "cg" -} "cf"
2022-07-07T10:11:58.5057620Z                                                 , internedIdLocation = _
2022-07-07T10:11:58.5057756Z                                                 }
2022-07-07T10:11:58.5057923Z                                             , symbolParams = _
2022-07-07T10:11:58.5058067Z                                             , symbolSorts = _
2022-07-07T10:11:58.5058244Z                                             , symbolAttributes = _
2022-07-07T10:11:58.5058374Z                                             }
2022-07-07T10:11:58.5058608Z                                         , applicationChildren = _
2022-07-07T10:11:58.5058741Z                                         }
2022-07-07T10:11:58.5058855Z                             }
2022-07-07T10:11:58.5058961Z                         }
2022-07-07T10:11:58.5059060Z             }
2022-07-07T10:11:58.5059136Z         }
2022-07-07T10:11:58.5059223Z     }
2022-07-07T10:11:58.5059335Z , substitution =
2022-07-07T10:11:58.5059540Z     Kore.Internal.Substitution.wrap (Assignment_
2022-07-07T10:11:58.5059711Z                                      { assignedVariable = _
2022-07-07T10:11:58.5059861Z                                      , assignedTerm =
2022-07-07T10:11:58.5059998Z                                          TermLike
2022-07-07T10:11:58.5060137Z                                          { getTermLike =
2022-07-07T10:11:58.5060268Z                                              _
2022-07-07T10:11:58.5060404Z                                                  :<
2022-07-07T10:11:58.5060565Z                                                  ApplySymbolF
2022-07-07T10:11:58.5060728Z                                                      Application
2022-07-07T10:11:58.5060936Z                                                      { applicationSymbolOrAlias =
2022-07-07T10:11:58.5061080Z                                                          _
2022-07-07T10:11:58.5061259Z                                                      , applicationChildren =
2022-07-07T10:11:58.5061415Z                                                          TermLike
2022-07-07T10:11:58.5061583Z                                                          { getTermLike =
2022-07-07T10:11:58.5061732Z                                                              _
2022-07-07T10:11:58.5061885Z                                                                  :<
2022-07-07T10:11:58.5062059Z                                                                  ApplySymbolF
2022-07-07T10:11:58.5062237Z                                                                      Application
2022-07-07T10:11:58.5062512Z                                                                      { applicationSymbolOrAlias =
2022-07-07T10:11:58.5062680Z                                                                          Symbol
2022-07-07T10:11:58.5062863Z                                                                          { symbolConstructor =
2022-07-07T10:11:58.5063038Z                                                                              InternedId
2022-07-07T10:11:58.5063229Z                                                                              { getInternedId =
2022-07-07T10:11:58.5063530Z                                                                                  {- was:
2022-07-07T10:11:58.5063700Z                                                                                  "cf"
2022-07-07T10:11:58.5063928Z                                                                                  -}
2022-07-07T10:11:58.5064106Z                                                                                  "cg"
2022-07-07T10:11:58.5064320Z                                                                              , internedIdLocation =
2022-07-07T10:11:58.5064476Z                                                                                  _
2022-07-07T10:11:58.5064639Z                                                                              }
2022-07-07T10:11:58.5064821Z                                                                          , symbolParams =
2022-07-07T10:11:58.5064985Z                                                                              _
2022-07-07T10:11:58.5065168Z                                                                          , symbolSorts =
2022-07-07T10:11:58.5065327Z                                                                              _
2022-07-07T10:11:58.5065525Z                                                                          , symbolAttributes =
2022-07-07T10:11:58.5065749Z                                                                              _
2022-07-07T10:11:58.5065917Z                                                                          }
2022-07-07T10:11:58.5066104Z                                                                      , applicationChildren =
2022-07-07T10:11:58.5066265Z                                                                          _
2022-07-07T10:11:58.5066422Z                                                                      }
2022-07-07T10:11:58.5066566Z                                                          }
2022-07-07T10:11:58.5066716Z                                                              :
2022-07-07T10:11:58.5066861Z                                                              _
2022-07-07T10:11:58.5067006Z                                                      }
2022-07-07T10:11:58.5067133Z                                          }
2022-07-07T10:11:58.5067238Z                                      }
2022-07-07T10:11:58.5067327Z         :
2022-07-07T10:11:58.5067419Z         _)
2022-07-07T10:11:58.5067506Z }
2022-07-07T10:11:58.5067591Z     :
2022-07-07T10:11:58.5067677Z     _
2022-07-07T10:11:58.5067687Z 

@github-actions
Copy link

github-actions bot commented Jul 7, 2022

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005637 -0.221132
test/regression-evm/test-storagevar03.sh -0.001294 0.009885
test/regression-evm/test-totalSupply.sh -0.037872 -0.364266
test/regression-evm/test-sum-to-n.sh -0.003895 -0.166135
test/regression-evm/test-lemmas.sh 0.002870 -0.156322
test/regression-evm/test-addu48u48.sh -0.084470 -0.190687
test/regression-wasm/test-wrc20.sh 0.764755 -0.149847
test/regression-wasm/test-loops.sh 0.002680 -0.150754
test/regression-wasm/test-memory.sh 0.007289 -0.151234
test/regression-wasm/test-simple-arithmetic.sh 0.009088 -0.151880
test/regression-wasm/test-locals.sh 0.010008 -0.155906

@develop7
Copy link
Author

develop7 commented Jul 7, 2022

Couldn't fix this one:

↓ test/Driver.hs
↓ Test
↓ Kore
↓ Unification
↓ UnifierT
↓ mergeAndNormalizeSubstitutions
✗ Non-ctor circular dependency
test/Test/Kore/Unification/UnifierT.hs:309:
2022-07-07T10:11:58.5014998Z Conditional
2022-07-07T10:11:58.5015094Z { term = _
2022-07-07T10:11:58.5015202Z , predicate =
2022-07-07T10:11:58.5015291Z     Predicate
2022-07-07T10:11:58.5015409Z     { getPredicate =
2022-07-07T10:11:58.5015513Z         CofreeT
2022-07-07T10:11:58.5015627Z         { runCofreeT =
2022-07-07T10:11:58.5015734Z             Identity
2022-07-07T10:11:58.5015854Z             { runIdentity =
2022-07-07T10:11:58.5015951Z                 _
2022-07-07T10:11:58.5016038Z                     :<
2022-07-07T10:11:58.5016155Z                     EqualsF
2022-07-07T10:11:58.5016274Z                         Equals
2022-07-07T10:11:58.5016434Z                         { equalsOperandSort = _
2022-07-07T10:11:58.5016587Z                         , equalsResultSort = _
2022-07-07T10:11:58.5016716Z                         , equalsFirst =
2022-07-07T10:11:58.5016837Z                             TermLike
2022-07-07T10:11:58.5016964Z                             { getTermLike =
2022-07-07T10:11:58.5017080Z                                 _
2022-07-07T10:11:58.5017199Z                                     :<
2022-07-07T10:11:58.5017333Z                                     VariableF
2022-07-07T10:11:58.5017469Z                                         Const
2022-07-07T10:11:58.5017613Z                                         { getConst =
2022-07-07T10:11:58.5017752Z                                             Variable
2022-07-07T10:11:58.5017900Z                                             { variableName =
2022-07-07T10:11:58.5018094Z                                                 SomeVariableNameElement
2022-07-07T10:11:58.5018336Z                                                     ElementVariableName
2022-07-07T10:11:58.5018537Z                                                     { unElementVariableName =
2022-07-07T10:11:58.5018716Z                                                         ConfigVariableName
2022-07-07T10:11:58.5018883Z                                                             VariableName
2022-07-07T10:11:58.5019042Z                                                             { base =
2022-07-07T10:11:58.5019208Z                                                                 InternedId
2022-07-07T10:11:58.5019414Z                                                                 { getInternedId =
2022-07-07T10:11:58.5019678Z                                                                     {- was:
2022-07-07T10:11:58.5019836Z                                                                     "y"
2022-07-07T10:11:58.5020049Z                                                                     -}
2022-07-07T10:11:58.5020209Z                                                                     "x"
2022-07-07T10:11:58.5020403Z                                                                 , internedIdLocation =
2022-07-07T10:11:58.5020559Z                                                                     _
2022-07-07T10:11:58.5020709Z                                                                 }
2022-07-07T10:11:58.5020874Z                                                             , counter = _
2022-07-07T10:11:58.5021006Z                                                             }
2022-07-07T10:11:58.5021145Z                                                     }
2022-07-07T10:11:58.5021311Z                                             , variableSort = _
2022-07-07T10:11:58.5021443Z                                             }
2022-07-07T10:11:58.5021571Z                                         }
2022-07-07T10:11:58.5021737Z                             }
2022-07-07T10:11:58.5021882Z                         , equalsSecond =
2022-07-07T10:11:58.5021990Z                             TermLike
2022-07-07T10:11:58.5022129Z                             { getTermLike =
2022-07-07T10:11:58.5022244Z                                 _
2022-07-07T10:11:58.5022362Z                                     :<
2022-07-07T10:11:58.5022509Z                                     ApplySymbolF
2022-07-07T10:11:58.5022653Z                                         Application
2022-07-07T10:11:58.5022854Z                                         { applicationSymbolOrAlias = _
2022-07-07T10:11:58.5023034Z                                         , applicationChildren =
2022-07-07T10:11:58.5023159Z                                             TermLike
2022-07-07T10:11:58.5023315Z                                             { getTermLike =
2022-07-07T10:11:58.5023449Z                                                 _
2022-07-07T10:11:58.5023592Z                                                     :<
2022-07-07T10:11:58.5023748Z                                                     VariableF
2022-07-07T10:11:58.5023895Z                                                         Const
2022-07-07T10:11:58.5024058Z                                                         { getConst =
2022-07-07T10:11:58.5024202Z                                                             Variable
2022-07-07T10:11:58.5024379Z                                                             { variableName =
2022-07-07T10:11:58.5024583Z                                                                 SomeVariableNameElement
2022-07-07T10:11:58.5024775Z                                                                     ElementVariableName
2022-07-07T10:11:58.5024985Z                                                                     { unElementVariableName =
2022-07-07T10:11:58.5025180Z                                                                         ConfigVariableName
2022-07-07T10:11:58.5025364Z                                                                             VariableName
2022-07-07T10:11:58.5025590Z                                                                             { base =
2022-07-07T10:11:58.5025771Z                                                                                 InternedId
2022-07-07T10:11:58.5025951Z                                                                                 { getInternedId =
2022-07-07T10:11:58.5026271Z                                                                                     {- was:
2022-07-07T10:11:58.5026443Z                                                                                     "y"
2022-07-07T10:11:58.5026674Z                                                                                     -}
2022-07-07T10:11:58.5026848Z                                                                                     "x"
2022-07-07T10:11:58.5027059Z                                                                                 , internedIdLocation =
2022-07-07T10:11:58.5027232Z                                                                                     _
2022-07-07T10:11:58.5027400Z                                                                                 }
2022-07-07T10:11:58.5027574Z                                                                             , counter =
2022-07-07T10:11:58.5027724Z                                                                                 _
2022-07-07T10:11:58.5027885Z                                                                             }
2022-07-07T10:11:58.5028042Z                                                                     }
2022-07-07T10:11:58.5028223Z                                                             , variableSort = _
2022-07-07T10:11:58.5028371Z                                                             }
2022-07-07T10:11:58.5028515Z                                                         }
2022-07-07T10:11:58.5028696Z                                             }
2022-07-07T10:11:58.5028839Z                                                 :
2022-07-07T10:11:58.5028958Z                                                 _
2022-07-07T10:11:58.5029083Z                                         }
2022-07-07T10:11:58.5029195Z                             }
2022-07-07T10:11:58.5029303Z                         }
2022-07-07T10:11:58.5029401Z             }
2022-07-07T10:11:58.5029492Z         }
2022-07-07T10:11:58.5029579Z     }
2022-07-07T10:11:58.5029676Z , substitution =
2022-07-07T10:11:58.5029880Z     Kore.Internal.Substitution.wrap (Assignment_
2022-07-07T10:11:58.5030049Z                                      { assignedVariable = _
2022-07-07T10:11:58.5030201Z                                      , assignedTerm =
2022-07-07T10:11:58.5030338Z                                          TermLike
2022-07-07T10:11:58.5030490Z                                          { getTermLike =
2022-07-07T10:11:58.5030622Z                                              _
2022-07-07T10:11:58.5030874Z                                                  :<
2022-07-07T10:11:58.5031134Z                                                  {- was:
2022-07-07T10:11:58.5031286Z                                                  VariableF
2022-07-07T10:11:58.5031430Z                                                      Const
2022-07-07T10:11:58.5031589Z                                                      { getConst =
2022-07-07T10:11:58.5031742Z                                                          Variable
2022-07-07T10:11:58.5031913Z                                                          { variableName =
2022-07-07T10:11:58.5032115Z                                                              SomeVariableNameElement
2022-07-07T10:11:58.5032291Z                                                                  ElementVariableName
2022-07-07T10:11:58.5032501Z                                                                  { unElementVariableName =
2022-07-07T10:11:58.5032693Z                                                                      ConfigVariableName
2022-07-07T10:11:58.5032964Z                                                                          VariableName
2022-07-07T10:11:58.5033131Z                                                                          { base =
2022-07-07T10:11:58.5033377Z                                                                              Id { getId = "x", idLocation = AstLocationTest }
2022-07-07T10:11:58.5033554Z                                                                          , counter =
2022-07-07T10:11:58.5033725Z                                                                              Nothing
2022-07-07T10:11:58.5033886Z                                                                          }
2022-07-07T10:11:58.5034025Z                                                                  }
2022-07-07T10:11:58.5034195Z                                                          , variableSort =
2022-07-07T10:11:58.5034372Z                                                              SortActualSort
2022-07-07T10:11:58.5034540Z                                                                  SortActual
2022-07-07T10:11:58.5034725Z                                                                  { sortActualName =
2022-07-07T10:11:58.5034979Z                                                                      Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5035166Z                                                                  , sortActualSorts =
2022-07-07T10:11:58.5035323Z                                                                      []
2022-07-07T10:11:58.5035462Z                                                                  }
2022-07-07T10:11:58.5035609Z                                                          }
2022-07-07T10:11:58.5035748Z                                                      }
2022-07-07T10:11:58.5035933Z                                                  -}
2022-07-07T10:11:58.5036193Z                                                  ApplySymbolF
2022-07-07T10:11:58.5036361Z                                                      Application
2022-07-07T10:11:58.5036567Z                                                      { applicationSymbolOrAlias =
2022-07-07T10:11:58.5036719Z                                                          Symbol
2022-07-07T10:11:58.5036890Z                                                          { symbolConstructor =
2022-07-07T10:11:58.5037124Z                                                              Id { getId = "f", idLocation = AstLocationTest }
2022-07-07T10:11:58.5037306Z                                                          , symbolParams = []
2022-07-07T10:11:58.5037475Z                                                          , symbolSorts =
2022-07-07T10:11:58.5037652Z                                                              ApplicationSorts
2022-07-07T10:11:58.5037869Z                                                              { applicationSortsOperands =
2022-07-07T10:11:58.5038052Z                                                                  [ SortActualSort
2022-07-07T10:11:58.5038223Z                                                                      SortActual
2022-07-07T10:11:58.5038409Z                                                                      { sortActualName =
2022-07-07T10:11:58.5038649Z                                                                          Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5038839Z                                                                      , sortActualSorts =
2022-07-07T10:11:58.5038999Z                                                                          []
2022-07-07T10:11:58.5039159Z                                                                      }
2022-07-07T10:11:58.5039313Z                                                                  ]
2022-07-07T10:11:58.5039521Z                                                              , applicationSortsResult =
2022-07-07T10:11:58.5039758Z                                                                  SortActualSort
2022-07-07T10:11:58.5039922Z                                                                      SortActual
2022-07-07T10:11:58.5040093Z                                                                      { sortActualName =
2022-07-07T10:11:58.5040345Z                                                                          Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5040534Z                                                                      , sortActualSorts =
2022-07-07T10:11:58.5040693Z                                                                          []
2022-07-07T10:11:58.5040850Z                                                                      }
2022-07-07T10:11:58.5041000Z                                                              }
2022-07-07T10:11:58.5041191Z                                                          , symbolAttributes = _
2022-07-07T10:11:58.5041339Z                                                          }
2022-07-07T10:11:58.5041528Z                                                      , applicationChildren =
2022-07-07T10:11:58.5041674Z                                                          [ TermLike
2022-07-07T10:11:58.5041843Z                                                            { getTermLike =
2022-07-07T10:11:58.5041995Z                                                                _
2022-07-07T10:11:58.5042153Z                                                                    :<
2022-07-07T10:11:58.5042320Z                                                                    VariableF
2022-07-07T10:11:58.5042489Z                                                                        Const
2022-07-07T10:11:58.5042666Z                                                                        { getConst =
2022-07-07T10:11:58.5042891Z                                                                            Variable
2022-07-07T10:11:58.5043072Z                                                                            { variableName =
2022-07-07T10:11:58.5043291Z                                                                                SomeVariableNameElement
2022-07-07T10:11:58.5043498Z                                                                                    ElementVariableName
2022-07-07T10:11:58.5043726Z                                                                                    { unElementVariableName =
2022-07-07T10:11:58.5043932Z                                                                                        ConfigVariableName
2022-07-07T10:11:58.5044124Z                                                                                            VariableName
2022-07-07T10:11:58.5044306Z                                                                                            { base =
2022-07-07T10:11:58.5044567Z                                                                                                Id { getId = "x", idLocation = AstLocationTest }
2022-07-07T10:11:58.5044758Z                                                                                            , counter =
2022-07-07T10:11:58.5044930Z                                                                                                Nothing
2022-07-07T10:11:58.5045107Z                                                                                            }
2022-07-07T10:11:58.5045278Z                                                                                    }
2022-07-07T10:11:58.5045466Z                                                                            , variableSort =
2022-07-07T10:11:58.5045655Z                                                                                SortActualSort
2022-07-07T10:11:58.5046152Z                                                                                    SortActual
2022-07-07T10:11:58.5046381Z                                                                                    { sortActualName =
2022-07-07T10:11:58.5046758Z                                                                                        Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5046961Z                                                                                    , sortActualSorts =
2022-07-07T10:11:58.5047136Z                                                                                        []
2022-07-07T10:11:58.5047304Z                                                                                    }
2022-07-07T10:11:58.5047451Z                                                                            }
2022-07-07T10:11:58.5047608Z                                                                        }
2022-07-07T10:11:58.5047756Z                                                            }
2022-07-07T10:11:58.5047903Z                                                          ]
2022-07-07T10:11:58.5048048Z                                                      }
2022-07-07T10:11:58.5048178Z                                          }
2022-07-07T10:11:58.5048299Z                                      }
2022-07-07T10:11:58.5048374Z         :
2022-07-07T10:11:58.5048465Z         _)
2022-07-07T10:11:58.5048549Z }
2022-07-07T10:11:58.5048638Z     :
2022-07-07T10:11:58.5048723Z     _
2022-07-07T10:11:58.5048733Z 

@develop7
Copy link
Author

develop7 commented Jul 7, 2022

Couldn't fix this one too — it expects a full-fledged Conditional, but collapses to an empty list instead

↓ test/Driver.hs
↓ Test
↓ Kore
↓ Unification
↓ UnifierT
↓ mergeAndNormalizeSubstitutions
✗ Constructor circular dependency?
test/Test/Kore/Unification/UnifierT.hs:283:
2022-07-07T10:11:58.4984490Z {- was:
2022-07-07T10:11:58.4984595Z [ Conditional
2022-07-07T10:11:58.4984680Z   { term = ()
2022-07-07T10:11:58.4984789Z   , predicate =
2022-07-07T10:11:58.4984892Z       Predicate
2022-07-07T10:11:58.4985006Z       { getPredicate =
2022-07-07T10:11:58.4985107Z           CofreeT
2022-07-07T10:11:58.4985221Z           { runCofreeT =
2022-07-07T10:11:58.4985326Z               Identity
2022-07-07T10:11:58.4985432Z               { runIdentity =
2022-07-07T10:11:58.4985531Z                   _
2022-07-07T10:11:58.4985634Z                       :<
2022-07-07T10:11:58.4985744Z                       EqualsF
2022-07-07T10:11:58.4985859Z                           Equals
2022-07-07T10:11:58.4986083Z                           { equalsOperandSort = ()
2022-07-07T10:11:58.4986255Z                           , equalsResultSort = ()
2022-07-07T10:11:58.4986378Z                           , equalsFirst =
2022-07-07T10:11:58.4986498Z                               TermLike
2022-07-07T10:11:58.4986639Z                               { getTermLike =
2022-07-07T10:11:58.4986758Z                                   _
2022-07-07T10:11:58.4986879Z                                       :<
2022-07-07T10:11:58.4987020Z                                       VariableF
2022-07-07T10:11:58.4987152Z                                           Const
2022-07-07T10:11:58.4987299Z                                           { getConst =
2022-07-07T10:11:58.4987427Z                                               Variable
2022-07-07T10:11:58.4987587Z                                               { variableName =
2022-07-07T10:11:58.4987778Z                                                   SomeVariableNameElement
2022-07-07T10:11:58.4987962Z                                                       ElementVariableName
2022-07-07T10:11:58.4988164Z                                                       { unElementVariableName =
2022-07-07T10:11:58.4988348Z                                                           ConfigVariableName
2022-07-07T10:11:58.4988515Z                                                               VariableName
2022-07-07T10:11:58.4988671Z                                                               { base =
2022-07-07T10:11:58.4988896Z                                                                   Id { getId = "x", idLocation = AstLocationTest }
2022-07-07T10:11:58.4989060Z                                                               , counter =
2022-07-07T10:11:58.4989219Z                                                                   Nothing
2022-07-07T10:11:58.4989368Z                                                               }
2022-07-07T10:11:58.4989510Z                                                       }
2022-07-07T10:11:58.4989676Z                                               , variableSort =
2022-07-07T10:11:58.4989908Z                                                   SortActualSort
2022-07-07T10:11:58.4990066Z                                                       SortActual
2022-07-07T10:11:58.4990227Z                                                       { sortActualName =
2022-07-07T10:11:58.4990472Z                                                           Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4990660Z                                                       , sortActualSorts = []
2022-07-07T10:11:58.4990983Z                                                       }
2022-07-07T10:11:58.4991118Z                                               }
2022-07-07T10:11:58.4991250Z                                           }
2022-07-07T10:11:58.4991364Z                               }
2022-07-07T10:11:58.4991504Z                           , equalsSecond =
2022-07-07T10:11:58.4991617Z                               TermLike
2022-07-07T10:11:58.4991761Z                               { getTermLike =
2022-07-07T10:11:58.4991878Z                                   _
2022-07-07T10:11:58.4991999Z                                       :<
2022-07-07T10:11:58.4992126Z                                       AndF
2022-07-07T10:11:58.4992259Z                                           And
2022-07-07T10:11:58.4992402Z                                           { andSort =
2022-07-07T10:11:58.4992550Z                                               SortActualSort
2022-07-07T10:11:58.4992703Z                                                   SortActual
2022-07-07T10:11:58.4992879Z                                                   { sortActualName =
2022-07-07T10:11:58.4993125Z                                                       Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4993305Z                                                   , sortActualSorts = []
2022-07-07T10:11:58.4993542Z                                                   }
2022-07-07T10:11:58.4993700Z                                           , andFirst =
2022-07-07T10:11:58.4993842Z                                               TermLike
2022-07-07T10:11:58.4993986Z                                               { getTermLike =
2022-07-07T10:11:58.4994123Z                                                   _
2022-07-07T10:11:58.4994268Z                                                       :<
2022-07-07T10:11:58.4994431Z                                                       ApplySymbolF
2022-07-07T10:11:58.4994597Z                                                           Application
2022-07-07T10:11:58.4994811Z                                                           { applicationSymbolOrAlias =
2022-07-07T10:11:58.4994965Z                                                               Symbol
2022-07-07T10:11:58.4995155Z                                                               { symbolConstructor =
2022-07-07T10:11:58.4995395Z                                                                   Id { getId = "constr10", idLocation = AstLocationTest }
2022-07-07T10:11:58.4995575Z                                                               , symbolParams =
2022-07-07T10:11:58.4995732Z                                                                   []
2022-07-07T10:11:58.4995907Z                                                               , symbolSorts =
2022-07-07T10:11:58.4996093Z                                                                   ApplicationSorts
2022-07-07T10:11:58.4996314Z                                                                   { applicationSortsOperands =
2022-07-07T10:11:58.4996499Z                                                                       [ SortActualSort
2022-07-07T10:11:58.4996676Z                                                                           SortActual
2022-07-07T10:11:58.4996853Z                                                                           { sortActualName =
2022-07-07T10:11:58.4997117Z                                                                               Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4997381Z                                                                           , sortActualSorts =
2022-07-07T10:11:58.4997551Z                                                                               []
2022-07-07T10:11:58.4997711Z                                                                           }
2022-07-07T10:11:58.4997868Z                                                                       ]
2022-07-07T10:11:58.4998073Z                                                                   , applicationSortsResult =
2022-07-07T10:11:58.4998255Z                                                                       SortActualSort
2022-07-07T10:11:58.4998427Z                                                                           SortActual
2022-07-07T10:11:58.4998609Z                                                                           { sortActualName =
2022-07-07T10:11:58.4998869Z                                                                               Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4999063Z                                                                           , sortActualSorts =
2022-07-07T10:11:58.4999233Z                                                                               []
2022-07-07T10:11:58.4999392Z                                                                           }
2022-07-07T10:11:58.4999547Z                                                                   }
2022-07-07T10:11:58.4999735Z                                                               , symbolAttributes =
2022-07-07T10:11:58.4999886Z                                                                   _
2022-07-07T10:11:58.5000038Z                                                               }
2022-07-07T10:11:58.5000270Z                                                           , applicationChildren =
2022-07-07T10:11:58.5000439Z                                                               [ TermLike
2022-07-07T10:11:58.5000614Z                                                                 { getTermLike =
2022-07-07T10:11:58.5000771Z                                                                     _
2022-07-07T10:11:58.5000932Z                                                                         :<
2022-07-07T10:11:58.5001104Z                                                                         VariableF
2022-07-07T10:11:58.5001272Z                                                                             Const
2022-07-07T10:11:58.5001449Z                                                                             { getConst =
2022-07-07T10:11:58.5001609Z                                                                                 Variable
2022-07-07T10:11:58.5001805Z                                                                                 { variableName =
2022-07-07T10:11:58.5002025Z                                                                                     SomeVariableNameElement
2022-07-07T10:11:58.5002244Z                                                                                         ElementVariableName
2022-07-07T10:11:58.5002471Z                                                                                         { unElementVariableName =
2022-07-07T10:11:58.5002680Z                                                                                             ConfigVariableName
2022-07-07T10:11:58.5002880Z                                                                                                 VariableName
2022-07-07T10:11:58.5003072Z                                                                                                 { base =
2022-07-07T10:11:58.5003336Z                                                                                                     Id { getId = "x", idLocation = AstLocationTest }
2022-07-07T10:11:58.5003531Z                                                                                                 , counter =
2022-07-07T10:11:58.5003763Z                                                                                                     Nothing
2022-07-07T10:11:58.5003943Z                                                                                                 }
2022-07-07T10:11:58.5004117Z                                                                                         }
2022-07-07T10:11:58.5004309Z                                                                                 , variableSort =
2022-07-07T10:11:58.5004503Z                                                                                     SortActualSort
2022-07-07T10:11:58.5004692Z                                                                                         SortActual
2022-07-07T10:11:58.5004896Z                                                                                         { sortActualName =
2022-07-07T10:11:58.5005169Z                                                                                             Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5005378Z                                                                                         , sortActualSorts =
2022-07-07T10:11:58.5005540Z                                                                                             []
2022-07-07T10:11:58.5005712Z                                                                                         }
2022-07-07T10:11:58.5005880Z                                                                                 }
2022-07-07T10:11:58.5006044Z                                                                             }
2022-07-07T10:11:58.5006195Z                                                                 }
2022-07-07T10:11:58.5006344Z                                                               ]
2022-07-07T10:11:58.5006544Z                                                           }
2022-07-07T10:11:58.5006687Z                                               }
2022-07-07T10:11:58.5006823Z                                           , andSecond =
2022-07-07T10:11:58.5006967Z                                               TermLike
2022-07-07T10:11:58.5007124Z                                               { getTermLike =
2022-07-07T10:11:58.5007262Z                                                   _
2022-07-07T10:11:58.5007409Z                                                       :<
2022-07-07T10:11:58.5007562Z                                                       VariableF
2022-07-07T10:11:58.5007708Z                                                           Const
2022-07-07T10:11:58.5007871Z                                                           { getConst =
2022-07-07T10:11:58.5008015Z                                                               Variable
2022-07-07T10:11:58.5008198Z                                                               { variableName =
2022-07-07T10:11:58.5008401Z                                                                   SomeVariableNameElement
2022-07-07T10:11:58.5008600Z                                                                       ElementVariableName
2022-07-07T10:11:58.5008809Z                                                                       { unElementVariableName =
2022-07-07T10:11:58.5009004Z                                                                           ConfigVariableName
2022-07-07T10:11:58.5009190Z                                                                               VariableName
2022-07-07T10:11:58.5009364Z                                                                               { base =
2022-07-07T10:11:58.5009611Z                                                                                   Id { getId = "y", idLocation = AstLocationTest }
2022-07-07T10:11:58.5009777Z                                                                               , counter =
2022-07-07T10:11:58.5009953Z                                                                                   Nothing
2022-07-07T10:11:58.5010176Z                                                                               }
2022-07-07T10:11:58.5010334Z                                                                       }
2022-07-07T10:11:58.5010511Z                                                               , variableSort =
2022-07-07T10:11:58.5010689Z                                                                   SortActualSort
2022-07-07T10:11:58.5010857Z                                                                       SortActual
2022-07-07T10:11:58.5011046Z                                                                       { sortActualName =
2022-07-07T10:11:58.5011288Z                                                                           Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.5011481Z                                                                       , sortActualSorts =
2022-07-07T10:11:58.5011645Z                                                                           []
2022-07-07T10:11:58.5011804Z                                                                       }
2022-07-07T10:11:58.5011953Z                                                               }
2022-07-07T10:11:58.5012099Z                                                           }
2022-07-07T10:11:58.5012233Z                                               }
2022-07-07T10:11:58.5012360Z                                           }
2022-07-07T10:11:58.5012458Z                               }
2022-07-07T10:11:58.5012564Z                           }
2022-07-07T10:11:58.5012664Z               }
2022-07-07T10:11:58.5012754Z           }
2022-07-07T10:11:58.5012843Z       }
2022-07-07T10:11:58.5013094Z   , substitution = NormalizedSubstitution (Data.Map.Strict.fromList [])
2022-07-07T10:11:58.5013183Z   }
2022-07-07T10:11:58.5013255Z ]
2022-07-07T10:11:58.5013429Z -}
2022-07-07T10:11:58.5013512Z []
2022-07-07T10:11:58.5013579Z 

@develop7
Copy link
Author

develop7 commented Jul 7, 2022

Couldn't fix this one

↓ test/Driver.hs
↓ Test
↓ Kore
↓ Unification
↓ SubstitutionNormalization
↓ normalize
✗ unnormalized substitution, variable-only
test/Test/Kore/Unification/SubstitutionNormalization.hs:38:
2022-07-07T10:11:58.4461713Z ↓ test/Driver.hs
2022-07-07T10:11:58.4461839Z ↓ Test
2022-07-07T10:11:58.4461947Z ↓ Kore
2022-07-07T10:11:58.4462095Z ↓ Unification
2022-07-07T10:11:58.4462305Z ↓ SubstitutionNormalization
2022-07-07T10:11:58.4462443Z ↓ normalize
2022-07-07T10:11:58.4462705Z ✗ unnormalized substitution, variable-only
2022-07-07T10:11:58.4462715Z 
2022-07-07T10:11:58.4462965Z test/Test/Kore/Unification/SubstitutionNormalization.hs:38:
2022-07-07T10:11:58.4463060Z Just
2022-07-07T10:11:58.4463157Z     Normalization
2022-07-07T10:11:58.4463269Z     { normalized =
2022-07-07T10:11:58.4463360Z         _
2022-07-07T10:11:58.4463458Z             :
2022-07-07T10:11:58.4463576Z             (Assignment_
2022-07-07T10:11:58.4463717Z              { assignedVariable =
2022-07-07T10:11:58.4463828Z                  Variable
2022-07-07T10:11:58.4463944Z                  { variableName =
2022-07-07T10:11:58.4464108Z                      SomeVariableNameElement
2022-07-07T10:11:58.4464263Z                          ElementVariableName
2022-07-07T10:11:58.4464437Z                          { unElementVariableName =
2022-07-07T10:11:58.4464572Z                              VariableName
2022-07-07T10:11:58.4464694Z                              { base =
2022-07-07T10:11:58.4464830Z                                  InternedId
2022-07-07T10:11:58.4465117Z                                  { getInternedId = {- was: "x" -} "y"
2022-07-07T10:11:58.4465299Z                                  , internedIdLocation = _
2022-07-07T10:11:58.4465416Z                                  }
2022-07-07T10:11:58.4465550Z                              , counter = _
2022-07-07T10:11:58.4465667Z                              }
2022-07-07T10:11:58.4465774Z                          }
2022-07-07T10:11:58.4465907Z                  , variableSort = _
2022-07-07T10:11:58.4465994Z                  }
2022-07-07T10:11:58.4466121Z              , assignedTerm =
2022-07-07T10:11:58.4466232Z                  TermLike
2022-07-07T10:11:58.4466361Z                  { getTermLike =
2022-07-07T10:11:58.4466468Z                      _
2022-07-07T10:11:58.4466579Z                          :<
2022-07-07T10:11:58.4466762Z                          {- was:
2022-07-07T10:11:58.4466880Z                          ApplySymbolF
2022-07-07T10:11:58.4467015Z                              Application
2022-07-07T10:11:58.4467204Z                              { applicationSymbolOrAlias =
2022-07-07T10:11:58.4467392Z                                  Symbol
2022-07-07T10:11:58.4467560Z                                  { symbolConstructor =
2022-07-07T10:11:58.4467781Z                                      Id { getId = "a", idLocation = AstLocationTest }
2022-07-07T10:11:58.4467943Z                                  , symbolParams = []
2022-07-07T10:11:58.4468094Z                                  , symbolSorts =
2022-07-07T10:11:58.4468239Z                                      ApplicationSorts
2022-07-07T10:11:58.4468446Z                                      { applicationSortsOperands = []
2022-07-07T10:11:58.4468635Z                                      , applicationSortsResult =
2022-07-07T10:11:58.4468790Z                                          SortActualSort
2022-07-07T10:11:58.4468938Z                                              SortActual
2022-07-07T10:11:58.4469108Z                                              { sortActualName =
2022-07-07T10:11:58.4469414Z                                                  Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4469588Z                                              , sortActualSorts = []
2022-07-07T10:11:58.4469723Z                                              }
2022-07-07T10:11:58.4469845Z                                      }
2022-07-07T10:11:58.4470013Z                                  , symbolAttributes = _
2022-07-07T10:11:58.4470130Z                                  }
2022-07-07T10:11:58.4470306Z                              , applicationChildren = []
2022-07-07T10:11:58.4470419Z                              }
2022-07-07T10:11:58.4470567Z                          -}
2022-07-07T10:11:58.4470676Z                          VariableF
2022-07-07T10:11:58.4470907Z                              Const
2022-07-07T10:11:58.4471042Z                              { getConst =
2022-07-07T10:11:58.4471172Z                                  Variable
2022-07-07T10:11:58.4471332Z                                  { variableName =
2022-07-07T10:11:58.4471520Z                                      SomeVariableNameElement
2022-07-07T10:11:58.4471694Z                                          ElementVariableName
2022-07-07T10:11:58.4471868Z                                          { unElementVariableName =
2022-07-07T10:11:58.4472028Z                                              VariableName
2022-07-07T10:11:58.4472172Z                                              { base =
2022-07-07T10:11:58.4472404Z                                                  Id { getId = "x", idLocation = AstLocationTest }
2022-07-07T10:11:58.4472574Z                                              , counter = Nothing
2022-07-07T10:11:58.4472709Z                                              }
2022-07-07T10:11:58.4472837Z                                          }
2022-07-07T10:11:58.4472990Z                                  , variableSort =
2022-07-07T10:11:58.4473127Z                                      SortActualSort
2022-07-07T10:11:58.4473276Z                                          SortActual
2022-07-07T10:11:58.4473448Z                                          { sortActualName =
2022-07-07T10:11:58.4473693Z                                              Id { getId = "testSort", idLocation = AstLocationTest }
2022-07-07T10:11:58.4473875Z                                          , sortActualSorts = []
2022-07-07T10:11:58.4474004Z                                          }
2022-07-07T10:11:58.4474124Z                                  }
2022-07-07T10:11:58.4474237Z                              }
2022-07-07T10:11:58.4474323Z                  }
2022-07-07T10:11:58.4474421Z              }
2022-07-07T10:11:58.4474521Z                 :
2022-07-07T10:11:58.4474623Z                 _)
2022-07-07T10:11:58.4474744Z     , denormalized = _
2022-07-07T10:11:58.4474831Z     }
2022-07-07T10:11:58.4474842Z 

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005622 -0.228356
test/regression-evm/test-storagevar03.sh -0.001308 0.008700
test/regression-evm/test-totalSupply.sh -0.037872 -0.364266
test/regression-evm/test-sum-to-n.sh -0.003886 -0.166746
test/regression-evm/test-lemmas.sh 0.002852 -0.158730
test/regression-evm/test-addu48u48.sh -0.084470 -0.177381
test/regression-wasm/test-wrc20.sh 0.764754 -0.153212
test/regression-wasm/test-loops.sh 0.002695 -0.150754
test/regression-wasm/test-memory.sh 0.007297 -0.151234
test/regression-wasm/test-simple-arithmetic.sh 0.009081 -0.151880
test/regression-wasm/test-locals.sh 0.010019 -0.155906

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005544 -0.220204
test/regression-evm/test-addu48u48.sh -0.084154 -0.166879
test/regression-evm/test-lemmas.sh 0.002002 -0.157696
test/regression-evm/test-sum-to-n.sh -0.003842 -0.169554
test/regression-evm/test-totalSupply.sh -0.037791 -0.364721
test/regression-evm/test-storagevar03.sh -0.001745 0.008814
test/regression-wasm/test-locals.sh 0.010005 -0.155906
test/regression-wasm/test-memory.sh 0.007297 -0.151234
test/regression-wasm/test-loops.sh 0.002723 -0.150919
test/regression-wasm/test-simple-arithmetic.sh 0.009122 -0.151545
test/regression-wasm/test-wrc20.sh 0.764752 -0.143297

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005549 -0.219328
test/regression-evm/test-addu48u48.sh -0.084155 -0.171001
test/regression-evm/test-lemmas.sh 0.002016 -0.158655
test/regression-evm/test-sum-to-n.sh -0.003845 -0.171046
test/regression-evm/test-totalSupply.sh -0.037797 -0.364010
test/regression-evm/test-storagevar03.sh -0.001739 0.001231
test/regression-wasm/test-locals.sh 0.009955 -0.155906
test/regression-wasm/test-memory.sh 0.007304 -0.151233
test/regression-wasm/test-loops.sh 0.002729 -0.150754
test/regression-wasm/test-simple-arithmetic.sh 0.009077 -0.151880
test/regression-wasm/test-wrc20.sh 0.764759 -0.150959

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005527 -0.221033
test/regression-evm/test-addu48u48.sh -0.084154 -0.168166
test/regression-evm/test-lemmas.sh 0.002012 -0.158583
test/regression-evm/test-sum-to-n.sh -0.003852 -0.169766
test/regression-evm/test-totalSupply.sh -0.037793 -0.359284
test/regression-evm/test-storagevar03.sh -0.001746 -0.000070
test/regression-wasm/test-locals.sh 0.010020 -0.155906
test/regression-wasm/test-memory.sh 0.007299 -0.151234
test/regression-wasm/test-loops.sh 0.002694 -0.150754
test/regression-wasm/test-simple-arithmetic.sh 0.009075 -0.151880
test/regression-wasm/test-wrc20.sh 0.764752 -0.160826

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005540 -0.220316
test/regression-evm/test-addu48u48.sh -0.084153 -0.169718
test/regression-evm/test-lemmas.sh 0.001998 -0.158502
test/regression-evm/test-sum-to-n.sh -0.003851 -0.169452
test/regression-evm/test-totalSupply.sh -0.037793 -0.362469
test/regression-evm/test-storagevar03.sh -0.001749 0.009117
test/regression-wasm/test-locals.sh 0.010017 -0.155906
test/regression-wasm/test-memory.sh 0.007287 -0.151234
test/regression-wasm/test-loops.sh 0.002710 -0.150754
test/regression-wasm/test-simple-arithmetic.sh 0.009072 -0.151880
test/regression-wasm/test-wrc20.sh 0.764744 -0.151935

@jberthold
Copy link
Member

test/regression-wasm/test-wrc20.sh 0.764744 -0.151935

I just noticed the sharp increase in allocation in this test. Not sure why that happens, it might deserve a closer look.

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.005524 -0.221547
test/regression-evm/test-addu48u48.sh -0.084155 -0.164080
test/regression-evm/test-lemmas.sh 0.001995 -0.158607
test/regression-evm/test-sum-to-n.sh -0.003850 -0.169300
test/regression-evm/test-totalSupply.sh -0.037792 -0.362323
test/regression-evm/test-storagevar03.sh -0.001749 0.001210
test/regression-wasm/test-locals.sh 0.010015 -0.155906
test/regression-wasm/test-memory.sh 0.007285 -0.151234
test/regression-wasm/test-loops.sh 0.002653 -0.150754
test/regression-wasm/test-simple-arithmetic.sh 0.009081 -0.151879
test/regression-wasm/test-wrc20.sh 0.764749 -0.151714

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-lemmas.sh 0.005765 -0.158609
test/regression-evm/test-dsvalue-peek-pass-rough.sh -0.004835 -0.220939
test/regression-evm/test-storagevar03.sh -0.000866 0.006800
test/regression-evm/test-totalSupply.sh -0.037277 -0.361393
test/regression-evm/test-addu48u48.sh -0.083598 -0.173471
test/regression-evm/test-sum-to-n.sh -0.000910 -0.171204
test/regression-wasm/test-memory.sh 0.015836 -0.154174
test/regression-wasm/test-wrc20.sh 0.766551 -0.151417
test/regression-wasm/test-simple-arithmetic.sh 0.020200 -0.154574
test/regression-wasm/test-locals.sh 0.022061 -0.155930
test/regression-wasm/test-loops.sh 0.008554 -0.153572

@goodlyrottenapple
Copy link
Member

Notes on test/Test/Kore/Unification/UnifierT.hs:309

Here are some notes after our coding session with @jberthold and @develop7.

Description of test

This test is meant to test that the predicate

y = f y

together with the substitution

x -> y

is equivalent to calling merge on these two substitutions

[x -> y, y -> f x]

such that we get a kore term:

\and(
  /* term: */
  /* D Sfa */ \top{_}(),
\and(
  /* predicate: */
  /* Spa */
  \equals{testSort{}, _}(
      /* Fl Fn D Sfa */ Configy:testSort{},
      /* Created: Test.Kore.Unification.UnifierT.f */
      /* Fn Spa */
      f{}(/* Fl Fn D Sfa */ Configy:testSort{})
  ),
  /* substitution: */
  /* Spa */
  \equals{testSort{}, _}(
      /* Fl Fn D Sfa */ Configy:testSort{},
      /* Fl Fn D Sfa */ Configx:testSort{}
  )
))

Observations

After the investigation today, we have the following progress/insights/questions:

  1. The definition of equality is not always syntactic equality. This made debugging much more difficult, as we were seeing assertEqual expect actual together with assertNormalizedPredicatesMulti actual pass, but assertNormalizedPredicatesMulti expect would fail. This is due to the fact that the Substitution type uses semantic equality, i.e. it will equate NormalizedSubstitution with Substitution

  2. After interning ids, the RHS of this particular test merges the list of substitutions

    [x -> y, y -> f x]
    

    to a predicate

    x = f x
    

    and substitution

    y -> f x
    

    In raw kore:

    \and(
      /* term: */
      /* D Sfa */ \top{_}(),
    \and(
      /* predicate: */
      /* Sfa */
      \equals{testSort{}, _}(
          /* Fl Fn D Sfa */ Configx:testSort{},
          /* Created: Test.Kore.Unification.UnifierT.f */
          /* Fn Sfa */
          f{}(/* Fl Fn D Sfa */ Configx:testSort{})
      ),
      /* substitution: */
      /* Spa */
      \equals{testSort{}, _}(
          /* Fl Fn D Sfa */ Configy:testSort{},
          /* Created: Test.Kore.Unification.UnifierT.f */
          /* Fn Sfa */
          f{}(/* Fl Fn D Sfa */ Configx:testSort{})
      )
    ))
    
  3. I am not entirely sure what this is testing and what the expected outcome should actually be, since there doesn't seem to be an obvious "normal form" for the original predicate + substitution and the result seems very implementation specific (i.e. beyond just a simple variable order swap).

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-lemmas.sh 0.054736 0.073626
test/regression-evm/test-dsvalue-peek-pass-rough.sh 0.034917 -0.230435
test/regression-evm/test-storagevar03.sh 0.040506 0.004091
test/regression-evm/test-totalSupply.sh 0.003451 -0.374348
test/regression-evm/test-addu48u48.sh -0.031130 -0.178514
test/regression-evm/test-sum-to-n.sh 0.038021 -0.171830
test/regression-wasm/test-memory.sh 0.051626 -0.154040
test/regression-wasm/test-wrc20.sh 0.852953 -0.067797
test/regression-wasm/test-simple-arithmetic.sh 0.050802 -0.154410
test/regression-wasm/test-locals.sh 0.048651 -0.155876
test/regression-wasm/test-loops.sh 0.055300 -0.153437

@develop7
Copy link
Author

develop7 commented Jul 25, 2022

@goodlyrottenapple So in bc2db8b I've dropped unwrapping instances for Eq Substitution & Ord Substitution and it didn't seem to change things much — passing tests pass, failing tests fail (except slight differences in failing property tests), integration tests crash same way as before. Given the nature of the change, it's not an expected result; does it also mean it's quite safe to keep it that way and introduce a special comparison instead of assertEquals to compare things syntactically where applicable?

@ana-pantilie
Copy link
Contributor

Hey @develop7 and @goodlyrottenapple .

Why did you modify the Eq and Ord for substitutions?

Also, variable substitutions get ordered according to this instance:

compareSubstitution = compare
. So, now the variable with the smaller interned id should get substituted.

Is the test result from the comment above resulting from before/after the change to the instances for Substitution?

@develop7
Copy link
Author

develop7 commented Jul 25, 2022

Why did you modify the Eq and Ord for substitutions?

It's completely my idea; to see what breaks and/or get busy since the call wasn't as fruitful as I expected.

Is the test result from the comment above resulting from before/after the change to the instances for Substitution?

From before, of course.

@ana-pantilie
Copy link
Contributor

ana-pantilie commented Jul 25, 2022

Alright. I think that many tests make the assumption that variable substitutions will be ordered lexicographically, but now that is no longer the case. Concretely, when we write Substitution.assign Mock.x (mkElemVar Mock.y) in a test we used to be certain that the substitution would be x -> y. After these changes, that might not actually be the case anymore, because the ordering is dependent on whatever random internal number is associated with x or y.

I've thought about this a bit, and we could try to force the above as follows:

let (x', y') = if x `compareSubstitution` y then (x, y) else (y, x)
-- use x' instead of x and y' instead of y in the affected test

This should be quick and it'll allow us to check if this is indeed the issue or not.

Ideally, since a lot of the code related to substitutions assumes lexicographical ordering of variable substitutions, we could find a way to ensure that the order on the string Ids is preserved by the order on the interned Ids.

If we can't do that, maybe we could mock the interned Id table for the data in Test.Kore.Rewrite.MockSymbols. That might not be as easy as it sounds, though.

@gromakovsky gromakovsky mentioned this pull request Aug 23, 2022
4 tasks
@gromakovsky
Copy link
Contributor

Closing in favor of #3217.

@gromakovsky gromakovsky closed this Sep 3, 2022
@jberthold jberthold deleted the intern-ids branch July 5, 2023 01:03
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.

Serokell: finish interning strings
6 participants