Skip to content

Commit

Permalink
test fromString
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 18, 2022
1 parent 53e1688 commit 6fb7a04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/js/src/high-level/high-level.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ describe('high-level', () => {
expect(await solver.check()).toStrictEqual('unsat');
});

it('test loading a solver state from a string', async () => {
const { Solver } = api.Context('main');
const solver = new Solver();
solver.fromString("(declare-const x Int) (assert (and (< x 2) (> x 0)))")
expect(await solver.check()).toStrictEqual('sat')
const x = Int.const('x')
solver.add(Not(x.eq(1)))
expect(await solver.check()).toStrictEqual('unsat')
}

it('disproves x = y implies g(g(x)) = g(y)', async () => {
const { Solver, Int, Function, Implies, Not } = api.Context('main');
const solver = new Solver();
Expand Down

0 comments on commit 6fb7a04

Please sign in to comment.