3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-25 21:57:00 +00:00

Update emscripten (#7473)

* fixes for newer emscripten thread handling behavior

* fix return type for async wrapper functions

* update prettier

* update typescript and fix errors

* update emscripten version in CI

* update js readme about tests
This commit is contained in:
Kevin Gibbons 2024-12-06 18:11:14 -08:00 committed by GitHub
parent 4fbf54afd0
commit e5f8327483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 275 additions and 108 deletions

View file

@ -1,6 +1,6 @@
// @ts-ignore we're not going to bother with types for this
import process from 'process';
import { init, Z3_error_code } from '../../build/node';
import { init, Z3_error_code } from '../../build/node.js';
// demonstrates use of the raw API
@ -58,10 +58,24 @@ import { init, Z3_error_code } from '../../build/node';
}
console.log('confirming error messages work:', Z3.get_error_msg(ctx, Z3.get_error_code(ctx)));
Z3.global_param_set('verbose', '0');
let result = await Z3.eval_smtlib2_string(
ctx,
`
(declare-const p Bool)
(declare-const q Bool)
(declare-const r Bool)
(declare-const s Bool)
(declare-const t Bool)
(assert ((_ pbeq 5 2 1 3 3 2) p q r s t))
(check-sat)
(get-model)
`,
);
console.log('checking string evaluation', result);
Z3.dec_ref(ctx, strAst);
Z3.del_context(ctx);
em.PThread.terminateAllThreads();
})().catch(e => {
console.error('error', e);
process.exit(1);

View file

@ -20,7 +20,7 @@ import type {
Z3_sort,
Z3_symbol,
} from '../../build/node';
import { init, Z3_ast_kind, Z3_lbool, Z3_sort_kind, Z3_symbol_kind } from '../../build/node';
import { init, Z3_ast_kind, Z3_lbool, Z3_sort_kind, Z3_symbol_kind } from '../../build/node.js';
let printf = (str: string, ...args: unknown[]) => console.log(sprintf(str.replace(/\n$/, ''), ...args));
@ -383,9 +383,6 @@ let printf = (str: string, ...args: unknown[]) => console.log(sprintf(str.replac
await bitvector_example2();
await unsat_core_and_proof_example();
// shut down
em.PThread.terminateAllThreads();
})().catch(e => {
console.error('error', e);
process.exit(1);