Interface Arith<Name>

Represents Integer or Real number expression

interface Arith<Name extends string = "main"> {
    ctx: Context<Name>;
    get ast(): Z3_ast;
    get sort(): S;
    add(other: CoercibleToArith<Name>): Arith<Name>;
    arg(i: number): AnyExpr<Name>;
    children(): AnyExpr<Name>[];
    decl(): FuncDecl<Name, Sort<Name>[], Sort<Name>>;
    div(other: CoercibleToArith<Name>): Arith<Name>;
    eq(other: CoercibleToExpr<Name>): Bool<Name>;
    eqIdentity(other: Ast<Name, unknown>): boolean;
    ge(other: CoercibleToArith<Name>): Bool<Name>;
    gt(other: CoercibleToArith<Name>): Bool<Name>;
    hash(): number;
    id(): number;
    le(other: CoercibleToArith<Name>): Bool<Name>;
    lt(other: CoercibleToArith<Name>): Bool<Name>;
    mod(other: CoercibleToArith<Name>): Arith<Name>;
    mul(other: CoercibleToArith<Name>): Arith<Name>;
    name(): string | number;
    neg(): Arith<Name>;
    neq(other: CoercibleToExpr<Name>): Bool<Name>;
    neqIdentity(other: Ast<Name, unknown>): boolean;
    numArgs(): number;
    params(): (
        | string
        | number
        | Sort<Name>
        | Expr<Name, AnySort<Name>, unknown>
        | FuncDecl<Name, Sort<Name>[], Sort<Name>>
    )[];
    pow(exponent: CoercibleToArith<Name>): Arith<Name>;
    sexpr(): string;
    sub(other: CoercibleToArith<Name>): Arith<Name>;
}

Type Parameters

  • Name extends string = "main"

Hierarchy (View Summary)

Properties

Accessors

Methods

  • Returns a number modulo second one

    const x = Int.const('x');

    await solve(x.mod(7).eq(1), x.gt(7)) // x % 7 == 1, x > 7
    // x=8

    Parameters

    • other: CoercibleToArith<Name>

    Returns Arith<Name>

  • Applies power to the number

    const x = Int.const('x');

    await solve(x.pow(2).eq(4), x.lt(0)); // x**2 == 4, x < 0
    // x=-2

    Parameters

    • exponent: CoercibleToArith<Name>

    Returns Arith<Name>