Skip to content

Conversation

@phantamanta44
Copy link

No description provided.

@krangelov
Copy link
Member

I looked at the conflict. The problem is in the bubble function. I like that you made a function, but your implementation seems to always propagate the variants to the top level. It is essential that in bubble variants are propagated upwards only if variants with the same choice id appear in more than one place. This happens in addVariants but you seem to miss that.

@phantamanta44
Copy link
Author

Rebased onto current majestic. Also, here's the modified repl i'm using for testing:

diff --git a/src/compiler/api/GF/Compile/Repl.hs b/src/compiler/api/GF/Compile/Repl.hs
index 066ee1dc1..36a169904 100644
--- a/src/compiler/api/GF/Compile/Repl.hs
+++ b/src/compiler/api/GF/Compile/Repl.hs
@@ -59,6 +59,8 @@ import GF.Infra.Option (noOptions)
 import GF.Infra.UseIO (justModuleName)
 import GF.Text.Pretty (render)
 
+import Debug.Trace
+
 data ReplOpts = ReplOpts
   { lang :: Lang
   , noPrelude :: Bool
@@ -275,7 +277,16 @@ runRepl' opts@ReplOpts { lang, evalToFlat } gl@(Gl g _) = do
 
     doEval st t opts = inferLType gl t >>= \case
       []          -> fail $ "No result while checking type: " ++ render (ppTerm Unqualified 0 t)
-      ((t', _):_) -> runEvalMWithOpts gl opts (value2termM evalToFlat [] (eval gl [] unit t' []))
+      ((t', _):_) -> runEvalMWithOpts gl opts $ do
+        let v = eval gl [] unit t' []
+        traceM $ ("EVAL\n" ++) $ render $ ppValue Unqualified 0 v
+        
+        let v' = bubble v
+        traceM $ ("BUBBLE\n" ++) $ render $ ppValue Unqualified 0 v'
+        
+        tv <- value2termM evalToFlat [] v'
+        traceM $ ("VALUE2TERM\n" ++) $ render $ ppTerm Unqualified 0 tv
+        return tv
     
     outputResults rs =
       forM_ (zip [1..] rs) $ \(i, ResultState r _ opts _) ->
$ gfci --lang=nlg --no-flat

@krangelov krangelov merged commit 09e98ed into GrammaticalFramework:majestic Jun 8, 2025
1 of 17 checks passed
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.

2 participants