Giter Site home page Giter Site logo

Comments (5)

andreasabel avatar andreasabel commented on July 21, 2024

-- Jesper, 2022-10-22: We should never block on a meta that is
-- already solved.
forM_ (allBlockingMetas unblock) $ \ m ->
whenM (isInstantiatedMeta m) $ do
reportSDoc "tc.constr.add" 5 $ "Attempted to block on solved meta" <+> prettyTCM m
__IMPOSSIBLE__

This is another instance of

from agda.

andreasabel avatar andreasabel commented on July 21, 2024

With -v tc:30 the last words of Agda are:

solving _9 := _10
completed assignment of _9@14618456326245523507
Postponing constraint
  funSort SSet _10 == SSet
adding constraint funSort SSet _10 = SSet
                    (blocked on _7, belongs to problem 6) unblocker:  _7
Attempted to block on solved meta _7

The diff between Set and SSet seems to be the unsolvability of funSort SSet _10 == SSet (the equivalent for Set solves _10 := Set).

from agda.

andreasabel avatar andreasabel commented on July 21, 2024

Could be related:

Relevant debug print seems to be:

equalSort _7 (y = y) == _9
term _9 := _7 (y = y)
...
initOccursCheck: we look into the following definitions:
(none)
offending variable:  y
  of type  A
  (after singleton test)
error during flexible occurs check, we are StronglyRigid
Pattern violation (you shouldn't see this)
oops, pattern violation for _7@14618456326245523507
attempting kills
  m'    = _7@14618456326245523507
  vs    = [y]
  kills = [True]
after kill analysis
  metavar = _7
  kills   = [True]
  kills'  = [True]
  oldType = (y₁ : A) →
            "dummyType: __DUMMY_TYPE__, called at src/full/Agda/TypeChecking/MetaVars.hs:197:25 in Agda-2.6.5-4ATBkX6jZbSGAWG421gpPu:Agda.TypeChecking.MetaVars"
  newType = "dummyType: __DUMMY_TYPE__, called at src/full/Agda/TypeChecking/MetaVars.hs:197:25 in Agda-2.6.5-4ATBkX6jZbSGAWG421gpPu:Agda.TypeChecking.MetaVars"
...
actual killing
  new meta: _10@14618456326245523507
  kills   : True
  inst    : _7@14618456326245523507 := _10
completed assignment of _7@14618456326245523507
passed occursCheck
...
solving _9 := _10
completed assignment of _9@14618456326245523507
funSortEquals
  s0 = SSet
  s1 = SSet
  s2 = _10
Postponing constraint
  funSort SSet _10 == SSet
adding constraint funSort SSet _10 = SSet
                    (blocked on _7, belongs to problem 6) unblocker:  _7
Attempted to block on solved meta _7

_7 is solved by pruning, so it is not a valid blocker anymore. The logic of blockers does not seem to expect a meta suddently solved by pruning.

Relevant code:

s1b <- reduceB s1
s2b <- reduceB s2
let (s1,s2) = (ignoreBlocking s1b, ignoreBlocking s2b)
blocker = unblockOnEither (getBlocker s1b) (getBlocker s2b)
let postponeIfBlocked = catchPatternErr $ \blocker ->
if | blocker == neverUnblock -> typeError $ UnequalSorts s1 s2
| otherwise -> do
reportSDoc "tc.conv.sort" 30 $ vcat
[ "Postponing constraint"
, nest 2 $ fsep [ prettyTCM s1 <+> "=="
, prettyTCM s2 ]
]
addConstraint blocker $ SortCmp CmpEq s1 s2

postponeIfBlocked $ case (s1, s2) of

-- equating @FunSort a b@ to another sort
(s1 , FunSort a b) -> funSortEquals propEnabled s1 a b blocker
(FunSort a b , s2) -> funSortEquals propEnabled s2 a b blocker

-- Equate a sort @s@ to @funSort s1 s2@
-- Precondition: @s@ and @funSort s1 s2@ are already reduced
funSortEquals :: Bool -> Sort -> Sort -> Sort -> Blocker -> m ()
funSortEquals propEnabled s0 s1 s2 blocker = do

from agda.

andreasabel avatar andreasabel commented on July 21, 2024

I might have introduced this regression when I refactored some code related to sorts during AIM XXXVI Delft and after.
Could be:

from agda.

andreasabel avatar andreasabel commented on July 21, 2024

Unfortunately, bisection only produces the usual suspect:

536b73f is the first bad commit
Author: Jesper Cockx
Date: Fri Nov 11 11:34:05 2022 +0000
[ re #6211 ] Pull off the band-aid

This does not provide any interesting information...

Only that I could have been wrong about blaming myself...

from agda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.