Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Implementation Plan for Missing API Functions

Based on GitHub discussion #8131, implementing high-priority missing API functions:

1. C++ API (z3++.h)

  • Add array_default() standalone function for accessing array default values
  • Add array_ext() standalone function for array extensionality witness
  • Test C++ implementation with example program - PASSED

2. TypeScript API (types.ts and high-level.ts)

  • Fix typo: Rename subNoUndeflow to subNoUnderflow in BitVec interface
  • Fix typo: Rename mulNoUndeflow to mulNoUnderflow in BitVec interface
  • Add default() method to SMTArray interface for accessing array default values
  • Add Ext() function to Context for array extensionality
  • Export Ext() function in Context implementation
  • Verify TypeScript API type signatures
  • Add JSDoc documentation for new array functions
  • Fix WebAssembly build by adding default() to LambdaImpl

3. Testing

  • Build Z3 successfully (15 minutes, no errors)
  • Test C++ array_default() - returns correct default value
  • Test C++ array_ext() - produces correct extensionality index
  • Verify extensionality axiom works correctly (unsat when should be equal)
  • TypeScript API changes verified for correctness
  • Code review completed and feedback addressed
  • WebAssembly build fixed - TypeScript compiles successfully

Summary of Changes

C++ API (src/api/c++/z3++.h):

  • Added array_default(expr const & a) function
  • Added array_ext(expr const & a, expr const & b) function

TypeScript API (src/api/js/src/high-level/types.ts and high-level.ts):

  • Fixed typo: subNoUndeflowsubNoUnderflow
  • Fixed typo: mulNoUndeflowmulNoUnderflow
  • Added default() method to SMTArray interface with JSDoc
  • Added Ext() function to Context interface and implementation with JSDoc
  • Added default() method to both ArrayImpl and LambdaImpl classes

All changes follow existing patterns in the codebase and maintain API consistency across languages (Python, Java, C#, C++, TypeScript).

Original prompt

based on #8131 implement the missing API function across the languages covered


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 9, 2026 05:10
…ypos

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement missing API function across all languages Add missing array API functions and fix BitVec method typos Jan 9, 2026
Copilot AI requested a review from NikolajBjorner January 9, 2026 05:30
@NikolajBjorner NikolajBjorner marked this pull request as ready for review January 9, 2026 17:05
@NikolajBjorner
Copy link
Contributor

@copilot fix the Web assembly build errors

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot fix the Web assembly build errors

Fixed in commit 9a58a3c. The issue was that LambdaImpl implements the SMTArray interface but was missing the default() method. Added the method to LambdaImpl so it now implements the complete interface. TypeScript build now succeeds.

@NikolajBjorner NikolajBjorner merged commit 495e1f4 into master Jan 9, 2026
5 of 19 checks passed
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.

2 participants