mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
Merge branch 'master' of https://github.com/z3prover/z3
This commit is contained in:
commit
f6e4a45f4b
32 changed files with 118 additions and 97 deletions
|
@ -124,7 +124,7 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
internal Symbol[] MkSymbols(string[] names)
|
||||
{
|
||||
if (names == null) return null;
|
||||
if (names == null) return new Symbol[0];
|
||||
Symbol[] result = new Symbol[names.Length];
|
||||
for (int i = 0; i < names.Length; ++i) result[i] = MkSymbol(names[i]);
|
||||
return result;
|
||||
|
|
|
@ -110,7 +110,7 @@ public class Context implements AutoCloseable {
|
|||
Symbol[] mkSymbols(String[] names)
|
||||
{
|
||||
if (names == null)
|
||||
return null;
|
||||
return new Symbol[0];
|
||||
Symbol[] result = new Symbol[names.length];
|
||||
for (int i = 0; i < names.length; ++i)
|
||||
result[i] = mkSymbol(names[i]);
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Arith, Bool, Model, Z3AssertionError, Z3HighLevel } from './types';
|
|||
*
|
||||
* **NOTE**: The set of solutions might be infinite.
|
||||
* Always ensure to limit amount generated, either by knowing that the
|
||||
* solution space is constrainted, or by taking only a specified
|
||||
* solution space is constrained, or by taking only a specified
|
||||
* amount of solutions
|
||||
* ```typescript
|
||||
* import { sliceAsync } from 'iter-tools';
|
||||
|
@ -46,7 +46,7 @@ async function* allSolutions<Name extends string>(...assertions: Bool<Name>[]):
|
|||
.filter(decl => decl.arity() === 0)
|
||||
.map(decl => {
|
||||
const term = decl.call();
|
||||
// TODO(ritave): Assert not an array / uinterpeted sort
|
||||
// TODO(ritave): Assert not an array / uninterpreted sort
|
||||
const value = model.eval(term, true);
|
||||
return term.neq(value);
|
||||
}),
|
||||
|
|
|
@ -224,6 +224,12 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
|
|||
function _toExpr(ast: Z3_ast): Bool<Name> | IntNum<Name> | RatNum<Name> | Arith<Name> | Expr<Name> {
|
||||
const kind = check(Z3.get_ast_kind(contextPtr, ast));
|
||||
if (kind === Z3_ast_kind.Z3_QUANTIFIER_AST) {
|
||||
if (Z3.is_quantifier_forall(contextPtr, ast))
|
||||
return new BoolImpl(ast);
|
||||
if (Z3.is_quantifier_exists(contextPtr, ast))
|
||||
return new BoolImpl(ast);
|
||||
if (Z3.is_lambda(contextPtr, ast))
|
||||
return new ExprImpl(ast);
|
||||
assert(false);
|
||||
}
|
||||
const sortKind = check(Z3.get_sort_kind(contextPtr, Z3.get_sort(contextPtr, ast)));
|
||||
|
|
|
@ -617,7 +617,7 @@ export interface Arith<Name extends string = 'main'> extends Expr<Name, ArithSor
|
|||
*/
|
||||
mul(other: Arith<Name> | number | bigint | string): Arith<Name>;
|
||||
/**
|
||||
* Substract second number from the first one
|
||||
* Subtract second number from the first one
|
||||
*/
|
||||
sub(other: Arith<Name> | number | bigint | string): Arith<Name>;
|
||||
/**
|
||||
|
@ -709,7 +709,7 @@ export interface RatNum<Name extends string = 'main'> extends Arith<Name> {
|
|||
}
|
||||
|
||||
/**
|
||||
* A Sort represting Bit Vector numbers of specified {@link BitVecSort.size size}
|
||||
* A Sort representing Bit Vector numbers of specified {@link BitVecSort.size size}
|
||||
*
|
||||
* @typeParam Bits - A number representing amount of bits for this sort
|
||||
* @category Bit Vectors
|
||||
|
@ -878,42 +878,42 @@ export interface BitVec<Bits extends number = number, Name extends string = 'mai
|
|||
|
||||
/**
|
||||
* Creates a signed less-or-equal operation (`<=`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
sle(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates an unsigned less-or-equal operation (`<=`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
ule(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates a signed less-than operation (`<`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
slt(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates an unsigned less-than operation (`<`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
ult(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates a signed greater-or-equal operation (`>=`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
sge(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates an unsigned greater-or-equal operation (`>=`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
uge(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates a signed greater-than operation (`>`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
sgt(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
/**
|
||||
* Creates an unsigned greater-than operation (`>`)
|
||||
* @category Comparision
|
||||
* @category Comparison
|
||||
*/
|
||||
ugt(other: CoercibleToBitVec<Bits, Name>): Bool<Name>;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ $ ldd ./run
|
|||
/lib64/ld-linux-x86-64.so.2 (0x00007fb570de9000)
|
||||
```
|
||||
|
||||
The bytecode version will have a depedency on z3 and other external
|
||||
The bytecode version will have a dependency on z3 and other external
|
||||
libraries (packed as dlls and usually installed in opam switch):
|
||||
```
|
||||
$ ocamlobjinfo run | grep 'Used DLL' -A5
|
||||
|
@ -126,7 +126,7 @@ Using Dynlink
|
|||
-------------
|
||||
|
||||
The built z3ml.cmxs file is a self-contained shared library that
|
||||
doesn't have any depndencies on z3 (the z3 code is included in it) and
|
||||
doesn't have any dependencies on z3 (the z3 code is included in it) and
|
||||
could be loaded with `Dynlink.loadfile` in runtime.
|
||||
|
||||
Installation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue