guile-z3/tests/basic.scm

basic.scm

1
;;;; basic.scm ---      -*- mode: scheme; coding: utf-8; -*-
2
;;;;
3
;;;;   Copyright (C) 2020 Julien Lepiller <julien@lepiller.eu>
4
;;;;
5
;;;; This library is free software; you can redistribute it and/or
6
;;;; modify it under the terms of the GNU Lesser General Public
7
;;;; License as published by the Free Software Foundation; either
8
;;;; version 3 of the License, or (at your option) any later version.
9
;;;;
10
;;;; This library is distributed in the hope that it will be useful,
11
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
;;;; Lesser General Public License for more details.
14
;;;;
15
;;;; You should have received a copy of the GNU Lesser General Public
16
;;;; License along with this library; if not, write to the Free Software
17
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19
(define-module (tests basic-test)
20
  #:use-module (srfi srfi-64)
21
  #:use-module (ice-9 format)
22
  #:use-module (z3))
23
24
25
(test-begin "basic")
26
27
(test-assert "z3 trivial sat"
28
  (equal?
29
    (run-with-z3
30
      (lambda (context)
31
        (z3-eval context '((assert true) (check-sat)))))
32
    'sat))
33
34
(test-assert "z3 trivial unsat"
35
  (equal?
36
    (run-with-z3
37
      (lambda (context)
38
        (z3-eval context '((assert false) (check-sat)))))
39
    'unsat))
40
41
(test-end "basic")
42