Skip to content

feat: *-kinded holes which are solved by BRAT #69

Merged
acl-cqc merged 10 commits intomainfrom
just-holes
Jan 7, 2025
Merged

feat: *-kinded holes which are solved by BRAT #69
acl-cqc merged 10 commits intomainfrom
just-holes

Conversation

@croyzor
Copy link
Collaborator

@croyzor croyzor commented Dec 18, 2024

  • Add ! as type to be inferred when there is exactly one solution.
  • Separate typeEq from eqTest, into new SolveHoles.hs, with some beginnings of support for nat holes
  • Move doesntOccur from SolvePatterns.hs to Eval.hs and factor out getNumVar
  • Driveby hlints in Helpers.hs pullPorts and Parser.hs pullAndJuxt

Closes #28.

^^^

Expected to work out values for these holes:
In checking_check_defs_1_g_1_Eval 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does #54 help here? I guess we can punt it until that if this goes in first

Copy link
Collaborator

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff and nice minimal PR! :)

RemoveHope e -> let hset = hopes ctx in
if M.member e hset
then handler (k ()) (ctx { hopes = M.delete e hset }) g
else Left (dumbErr (InternalError ("Trying to remove Hope not in set: " ++ show e)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else Left (dumbErr (InternalError ("Trying to remove Hope not in set: " ++ show e)))
else Left (dumbErr (InternalError ("Trying to remove unknown Hope: " ++ show e)))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some $s too

[e1, e2] | e1 == e2 -> pure () -- trivially same, even if both still yet-to-be-defined
_es -> error "TODO: must wait for one or the other to become more defined"

-- This will update the `hopes` set, potentially invalidating things that have
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- This will update the `hopes` set, potentially invalidating things that have
-- This will update the `hopes, potentially invalidating things that have

typeEqEta _ (Zy :* _ :* _) hopes Nat exp act
| Just (SPar (InEnd e)) <- isNumVar exp, M.member e hopes = solveHope Nat e act
| Just (SPar (InEnd e)) <- isNumVar act, M.member e hopes = solveHope Nat e exp
-- 2. harder cases, neither is in the hope set, so we can't define it ourselves
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- 2. harder cases, neither is in the hope set, so we can't define it ourselves
-- 2. harder cases, neither is in `hopes`, so we can't define it ourselves

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left hope set as OK terminology, but removed things like

`hopes` set

@acl-cqc acl-cqc merged commit 4d60f70 into main Jan 7, 2025
@acl-cqc acl-cqc deleted the just-holes branch January 7, 2025 12:27
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.

feat: Let BRAT fill in holes

2 participants