Conversation
acl-cqc
reviewed
Dec 2, 2024
Collaborator
There was a problem hiding this comment.
Ok, so
- The number of comments suggests you've managed to break out a good sized chunk of code that is not too overwhelming :-), which is an achievement in itself - well done and thank you :-) 😁 👍
- There's a lot of hard stuff in the nat-inversion-building that I really haven't followed through the logic - I can only say that it looks plausible. However really I would prefer to do one of
- Add tests that cover all the cases and at least compile them down to Hugr. Then when we are able to execute them we suddenly gain a massive amount of assurance that we are actually building something sensible ;-) ;-)
- If these functions are not covered by tests, then leave them
error "TODO"here, and move the logic into another PR which can remainWIPuntil we do have tests (or at least, more time to think about them) - If the tests are only writable once we have
Fork, lets leave themtodoand move the code into #41 (they are quite localized - no change to APIs - so there shouldn't be much fallout from leaving them out of this PR)
brat/Brat/Checker.hs
Outdated
|
|
||
| (_, argUnders, [(kindOut,_)], (_ :<< _va, _)) <- | ||
| next "" Hypo (S0, Some (Zy :* S0)) aliasArgs (REx ("type",Star []) R0) | ||
| next "aliasargs" Hypo (S0, Some (Zy :* S0)) aliasArgs (REx ("type",Star []) R0) |
Collaborator
There was a problem hiding this comment.
maybe call this "kc_alias" and the other "load_alias" or something like that?
|
|
||
| -- Both targets, we need to create the thing that they both derive from | ||
| (InEnd bigTgt, [VPar (InEnd weeTgt)]) -> do | ||
| (_, [(idTgt, _)], [(idSrc, _)], _) <- anext "numval id" Id (S0, Some (Zy :* S0)) |
Collaborator
There was a problem hiding this comment.
(This case has no test coverage)
brat/Brat/Checker/SolvePatterns.hs
Outdated
| -- = 2^k + 2^k * y | ||
| demandSucc (StrictMono k (Linear (VPar (ExEnd out)))) = do | ||
| y <- mkPred out | ||
| demandSucc _sm@(StrictMono _k (Linear (VPar (ExEnd _x)))) = error "Todo..." {-do |
Collaborator
There was a problem hiding this comment.
I think the whole of demandSucc has no test coverage
| solveNumMeta (InEnd tgt) (n2PowTimes 1 half) | ||
| pure (StrictMonoFun (StrictMono 0 (Linear (VPar (toEnd halfTgt))))) | ||
| Full sm -> StrictMonoFun sm <$ demand0 (NumValue 0 (StrictMonoFun sm)) | ||
| evenGro (StrictMonoFun (StrictMono n mono)) = pure (StrictMonoFun (StrictMono (n - 1) mono)) |
Collaborator
There was a problem hiding this comment.
This is the only line of evenGro that has test coverage
| oddGro (StrictMonoFun (StrictMono 0 mono)) = case mono of | ||
| Linear (VPar (ExEnd out)) -> mkPred out >>= demandEven | ||
| Linear _ -> err . UnificationError $ "Can't force " ++ show n ++ " to be even" | ||
| -- TODO: Why aren't we using `out`?? |
Collaborator
There was a problem hiding this comment.
None of oddGro has test coverage
croyzor
added a commit
that referenced
this pull request
Dec 3, 2024
And other drive-by fixes pulled out from #59 --------- Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
Co-authored-by: Alan Lawrence <alan.lawrence@quantinuum.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #28 and #30