Skip to content

feat(core-models): model unsigned_abs for signed integers - #2347

Open
WilliamTakeshi wants to merge 1 commit into
pereq-dev:mainfrom
WilliamTakeshi:add-core-models-unsigned-abs
Open

WilliamTakeshi wants to merge 1 commit into
pereq-dev:mainfrom
WilliamTakeshi:add-core-models-unsigned-abs

Conversation

@WilliamTakeshi

Copy link
Copy Markdown
Contributor

Add model for unsigned_abs

While working on proofs for lakers, I hit a call to .unsigned_abs() that neither backend could resolve, because core-models had no model for it. The fix looked small, so I added it myself.

Problem

fn abs_u32(x: i32) -> u32 {
    x.unsigned_abs()
}

extracts fine but fails to typecheck:

F*:   Error 72: Identifier impl_i32__unsigned_abs not found in module Core_models.Num
Lean: Unknown identifier `core.num.I32.unsigned_abs`

Tested again pointing to hax local, everything works.

Question for maintainers

I'd like to keep filling in missing core-models items as I run into them. Is that welcome, or is there ongoing work I should coordinate with or wait for?

Should I do one change per PR? because seems like the generated lean/F* code can create conflicts in some cases

Disclaimer

I used Claude Opus 5.5 to help me understand where was to update it, every line was reviewed by me

@WilliamTakeshi
WilliamTakeshi force-pushed the add-core-models-unsigned-abs branch from 906d9ed to b45adc2 Compare October 23, 2026 13:22
@WilliamTakeshi
WilliamTakeshi force-pushed the add-core-models-unsigned-abs branch from b45adc2 to 885c522 Compare October 23, 2026 13:27

This branch has not been deployed

No deployments
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.

1 participant