Skip to content

[TS] Make empty strings falsy in symbolic conditions - #456

Open
CaelmBleidd wants to merge 1 commit into
mainfrom
caelmbleidd/ts-423-string-truthiness
Open

CaelmBleidd wants to merge 1 commit into
mainfrom
caelmbleidd/ts-423-string-truthiness

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #423.

Empty strings now evaluate to false in conditions, !, &&, and ||; nonempty strings and ordinary objects remain truthy. Uniquely typed string fields receive bounded UTF-16 contents, literal field types preserve exact code units, and reads preserve prior writes. Dynamic string references without modeled contents produce an explicit unsupported outcome while supported nonstring paths continue.

This version contains only #456's changes on top of merged #455 at 2c4f17c4c9fc0d70057e374ec462600a0d9c4bbf. Both new backing readers use the private mkStringBackingLValue. Regression tests follow the current discoverProperties structure and replay generated inputs in Node.js. The guarded-any test now requires the replayable strings provided by #455 instead of expecting a missing-backing extraction failure.

Validation on head f2a22c368c515e3591c8f5f0fd02a1be19eedf23, using published pinned JacoDB without substitution:

  • Full :usvm-ts:test: 988 passed, 142 skipped, 0 failures/errors.
  • :usvm-ts-calls:test: 13 passed, 0 skipped/failures/errors.
  • :usvm-ts:detektMain, :usvm-ts:detektTest, and git diff --check: passed.
  • Source regressions cover empty/nonempty inputs, string fields, literal fields, unconditional/conditional writes, and explicit unsupported outcomes; replay checks run in Node.js.

The model remains bounded by TsOptions.maxArraySize. Values outside that contract are not evidence of unbounded string support. This review covers directly executed condition operators; source-level Boolean(...) call resolution was not validated.

These are local results. CI for the published replacement head must be checked after publication.

Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/expr/ExprUtil.kt Fixed
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review October 2, 2026 21:36
@CaelmBleidd
CaelmBleidd marked this pull request as draft October 2, 2026 22:18
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-423-string-truthiness branch from 38041dd to b57c27f Compare October 2, 2026 22:25
@CaelmBleidd
CaelmBleidd changed the base branch from caelmbleidd/ts-421-symbolic-string to caelmbleidd/ts-422-string-value-equality October 2, 2026 22:25
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-422-string-value-equality branch from 7927e93 to 127ecb5 Compare October 3, 2026 05:21
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-423-string-truthiness branch from 2c08f04 to 9d511c1 Compare October 3, 2026 05:26
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review October 3, 2026 06:43
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-422-string-value-equality branch from e5527a3 to 7217c2a Compare October 4, 2026 19:51
Base automatically changed from caelmbleidd/ts-422-string-value-equality to main October 5, 2026 12:37
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-423-string-truthiness branch from 7fe2676 to f2a22c3 Compare October 5, 2026 13:09
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.

[TS] Make empty strings falsy in symbolic conditions

2 participants