mirror of
https://github.com/Z3Prover/z3
synced 2026-05-02 00:23:44 +00:00
Typescript typedef and doc fixes (#8073)
* Fix Typescript typedef to allow `new Context` * fix init() tsdoc example using nonexistent sat import
This commit is contained in:
parent
0076e3bf97
commit
6cfbcd19df
2 changed files with 3 additions and 2 deletions
|
|
@ -125,6 +125,7 @@ export type CheckSatResult = 'sat' | 'unsat' | 'unknown';
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
export interface ContextCtor {
|
export interface ContextCtor {
|
||||||
<Name extends string>(name: Name, options?: Record<string, any>): Context<Name>;
|
<Name extends string>(name: Name, options?: Record<string, any>): Context<Name>;
|
||||||
|
new <Name extends string>(name: Name, options?: Record<string, any>): Context<Name>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Context<Name extends string = 'main'> {
|
export interface Context<Name extends string = 'main'> {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export * from './low-level/types.__GENERATED__';
|
||||||
* The main entry point to the Z3 API
|
* The main entry point to the Z3 API
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { init, sat } from 'z3-solver';
|
* import { init } from 'z3-solver';
|
||||||
*
|
*
|
||||||
* const { Context } = await init();
|
* const { Context } = await init();
|
||||||
* const { Solver, Int } = new Context('main');
|
* const { Solver, Int } = new Context('main');
|
||||||
|
|
@ -22,7 +22,7 @@ export * from './low-level/types.__GENERATED__';
|
||||||
* const solver = new Solver();
|
* const solver = new Solver();
|
||||||
* solver.add(x.add(2).le(y.sub(10))); // x + 2 <= y - 10
|
* solver.add(x.add(2).le(y.sub(10))); // x + 2 <= y - 10
|
||||||
*
|
*
|
||||||
* if (await solver.check() !== sat) {
|
* if (await solver.check() !== 'sat') {
|
||||||
* throw new Error("couldn't find a solution")
|
* throw new Error("couldn't find a solution")
|
||||||
* }
|
* }
|
||||||
* const model = solver.model();
|
* const model = solver.model();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue