on master help sign in
Make note of unapplied unifiation solutions
fef1207Edwin Brady
CHANGELOG+2
@@ -1,6 +1,8 @@
1New in 0.9.11:
1New in 0.9.11:
2-------------
2-------------
3+
3* Agda-style equational reasoning (in Syntax.PreorderReasoning)
4* Agda-style equational reasoning (in Syntax.PreorderReasoning)
5+* 'case' construct now abstracts over the scrutinee in its type
4
6
5New in 0.9.10:
7New in 0.9.10:
6--------------
8--------------
src/Idris/Core/ProofState.hs+13−12
@@ -184,24 +184,25 @@ unify' ctxt env topx topy =
184 " in " ++ show env ++
184 " in " ++ show env ++
185 "\nHoles: " ++ show (holes ps) ++ "\n") $
185 "\nHoles: " ++ show (holes ps) ++ "\n") $
186 lift $ unify ctxt env topx topy dont (holes ps)
186 lift $ unify ctxt env topx topy dont (holes ps)
187+ let notu = filter (\ (n, t) -> case t of
188+ P _ _ _ -> False
189+ _ -> n `elem` dont) u
187 traceWhen (unifylog ps)
190 traceWhen (unifylog ps)
188 ("Unified " ++ show (topx, topy) ++ " without " ++ show dont ++
191 ("Unified " ++ show (topx, topy) ++ " without " ++ show dont ++
189 "\nSolved: " ++ show u ++ "\nNew problems: " ++ qshow fails
192 "\nSolved: " ++ show u ++ "\nNew problems: " ++ qshow fails
190 ++ "\nCurrent problems:\n" ++ qshow (problems ps)
193 ++ "\nCurrent problems:\n" ++ qshow (problems ps)
191-- ++ show (pterm ps)
194-- ++ show (pterm ps)
192 ++ "\n----------") $
195 ++ "\n----------") $
193− case fails of
194−-- [] -> return u
195− err ->
196− do ps <- get
196+ do ps <- get
197− let (h, ns) = unified ps
197+ let (h, ns) = unified ps
198− let (ns', probs') = updateProblems (context ps) (u ++ ns)
198+ let (ns', probs') = updateProblems (context ps) (u ++ ns)
199− (err ++ problems ps)
199+ (fails ++ problems ps)
200− (injective ps)
200+ (injective ps)
201− (holes ps)
201+ (holes ps)
202− put (ps { problems = probs',
202+ put (ps { problems = probs',
203− unified = (h, ns') })
203+ unified = (h, ns'),
204+ notunified = notu ++ notunified ps })
204− return u
205+ return u
205
206
206getName :: Monad m => String -> StateT TState m Name
207getName :: Monad m => String -> StateT TState m Name
207getName tag = do ps <- get
208getName tag = do ps <- get
test/reg005/reg005.idr+1
@@ -48,3 +48,4 @@ Main.eqCharOK = proof {
48 exact x = x;
48 exact x = x;
49}
49}
50
50
51+