feat(Core): add Str.ToLower and Str.ToUpper string operations#621
Open
feat(Core): add Str.ToLower and Str.ToUpper string operations#621
Conversation
- Add `unaryOp` optional `axioms` parameter in IntBoolFactory.lean - Add `strToLowerFunc` and `strToUpperFunc` in Factory.lean, each with concrete evaluation (String.toLower / String.toUpper) and three SMT axioms: idempotence, length preservation, and concat distributivity - Wire both ops into the DDM grammar, ASTtoCST, and Translate passes - Skip axiom-bearing factory functions in ExprEvalTest to avoid MBQI timeouts on UF-based operations - Merge StrToLowerTest and StrToUpperTest into StrCaseTest.lean - Update ProcedureEvalTests and ProgramTypeTests expected outputs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… doc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
aqjune-aws
approved these changes
Mar 20, 2026
| (((~Str.Concat : string → string → string) %1) %0)) | ||
| == (((~Str.Concat : string → string → string) | ||
| ((~Str.ToUpper : string → string) %1)) | ||
| ((~Str.ToUpper : string → string) %0)))] |
Contributor
There was a problem hiding this comment.
Confirmed that all these axioms and their ToLower versions are indeed valid, using CVC5.
I heard ß uppercases to SS, but probably ToUpper only deals with English alphabets.
joscoh
reviewed
Mar 20, 2026
Contributor
There was a problem hiding this comment.
I think we should have a test with an unprovable or false goal to demonstrate that the axioms are not vacuous.
joehendrix
approved these changes
Mar 20, 2026
Contributor
joehendrix
left a comment
There was a problem hiding this comment.
It's be nice to see if we can reduce some of the per-operator boilerplate wrt DDM integration, but that's clearly a separate PR.
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.
Summary
str.tolowerandstr.toupperoperations to Strata Core, each with concrete evaluation and SMT axiomsunaryOpcombinator inIntBoolFactory.leanwith an optionalaxiomsparameterExprEvalTestto avoid MBQI timeouts on UF-based operationsBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.