Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed Jan 14, 2024
1 parent c0410e7 commit 4906037
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Elaboration/Equation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ type Equate v = StateT (Context v) M

equate :: Context v -> Flexibility -> Domain.Value -> Domain.Value -> M (Context v)
equate context flexibility value1 value2 = do
putText "Equating"
Context.dumpValue context value1
Context.dumpValue context value2
-- putText "Equating"
-- Context.dumpValue context value1
-- Context.dumpValue context value2
execStateT
(equateM flexibility value1 value2)
context
Expand Down
14 changes: 2 additions & 12 deletions src/Elaboration/Matching.hs
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,11 @@ simplifyMatch context canPostpone match@(Match value forcedValue plicity pat typ
simplifyMatch context canPostpone $ Match value forcedValue plicity (Pattern span unspannedPattern) type_
Pattern span unspannedPattern -> do
forcedValue' <- lift $ Context.forceHead context forcedValue
putText "forced value"
lift $ Context.dumpValue context forcedValue'
let match' =
Match value forcedValue' plicity pat type_
case (forcedValue', unspannedPattern) of
(Domain.Con constr args, Con _ constr' pats)
| constr == constr' -> do
putText $ "matching con" <> show constr
matches' <- lift $ do
constrType <- fetch $ Query.ConstructorType constr
(patsType, patSpine) <-
Expand Down Expand Up @@ -792,7 +789,6 @@ splitConstructor outerContext config scrutineeValue scrutineeHead scrutineeSpine
tele <- goConstrFields context' constr conArgs' target patterns'
pure $ Telescope.Extend bindings domain'' plicity tele
_ -> do
putText "Equating con"
context' <- Equation.equate context Flexibility.Rigid scrutineeValue $ Domain.Con constr conArgs
result <- check context' config Postponement.CanPostpone
pure $ Telescope.Empty result
Expand Down Expand Up @@ -897,24 +893,19 @@ splitEqualityOr context config matches k =
case match of
Match
scrutineeValue
scrutineeValue'
scrutineeValue'@Domain.Neutral {}
_
(Pattern _ Wildcard)
(Builtin.Equals type_ value1 value2) -> do
unificationResult <- try $ do
putText "equating equality"
unificationResult <- try do
context' <- Equation.equate context Flexibility.Rigid value1 value2
putText "equating equality refl"
Equation.equate context' Flexibility.Rigid scrutineeValue' $ Builtin.Refl type_ value1 value2
case unificationResult of
Left Equation.Nope -> do
putText "nope"
check context config {clauses = drop 1 config.clauses} Postponement.CanPostpone
Left Equation.Dunno -> do
putText "dunno"
splitEqualityOr context config matches' k
Right context' -> do
putText "yes"
result <- check context' config Postponement.CanPostpone
scrutinee <- Elaboration.readback context' scrutineeValue
pure $
Expand Down Expand Up @@ -968,7 +959,6 @@ uninhabitedType context fuel covered type_ = do
type' <- Context.forceHead context type_
case type' of
Builtin.Equals _ value1 value2 -> do
putText "equating for uninhabited type"
result <- try $ Equation.equate context Flexibility.Rigid value1 value2
pure $ case result of
Left Equation.Nope ->
Expand Down

0 comments on commit 4906037

Please sign in to comment.