guix-more/more/packages/smt.scm

smt.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix is distributed in the hope that it will be useful, but
12
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages smt)
20
  #:use-module (guix packages)
21
  #:use-module (guix download)
22
  #:use-module (guix build-system gnu)
23
  #:use-module (guix build-system python)
24
  #:use-module ((guix licenses) #:prefix license:)
25
  #:use-module (gnu packages)
26
  #:use-module (gnu packages ocaml)
27
  #:use-module (gnu packages python)
28
  #:use-module (more packages python))
29
30
(define-public z3-solver
31
  (package
32
    (name "z3-solver")
33
    (version "4.5.0")
34
    (source (origin
35
              (method url-fetch)
36
              (uri (string-append "https://github.com/Z3Prover/z3/archive/z3-"
37
                                  version ".tar.gz"))
38
              (sha256
39
               (base32
40
                "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))
41
              (file-name (string-append name "-" version ".tar.gz"))))
42
    (build-system gnu-build-system)
43
    (arguments
44
     `(#:phases
45
       (modify-phases %standard-phases
46
         (delete 'configure)
47
         (add-before 'build 'generate-make
48
           (lambda _
49
             (system* "python" "scripts/mk_make.py")
50
             (chdir "build"))))
51
       #:test-target "test"
52
       #:make-flags
53
       (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
54
    (native-inputs
55
     `(("python" ,python-2)))
56
    (home-page "https://github.com/Z3Prover/z3")
57
    (synopsis "SMT solver library")
58
    (description "Z3 is a theorem prover from Microsoft Research.")
59
    (license license:expat)))
60
61
(define-public python2-z3-solver
62
  (package
63
    (inherit z3-solver)
64
    (name "python2-z3-solver")
65
    (build-system python-build-system)
66
    (propagated-inputs
67
     `(("z3" ,z3-solver)))
68
    (arguments
69
     `(#:python ,python-2
70
       #:phases
71
       (modify-phases %standard-phases
72
         (add-before 'build 'prepare
73
           (lambda* (#:key inputs #:allow-other-keys)
74
             (system* "python" "scripts/mk_make.py")
75
             (copy-file "build/python/z3/z3core.py" "src/api/python/z3/z3core.py")
76
             (copy-file "build/python/z3/z3consts.py" "src/api/python/z3/z3consts.py")
77
             (chdir "src/api/python")
78
             (substitute* "z3/z3core.py"
79
               (("_dirs = \\[")
80
                (string-append "_dirs = ['" (assoc-ref inputs "z3")
81
                                            "/lib', ")))
82
             (substitute* "MANIFEST.in"
83
               ((".*") ""))
84
             (substitute* "setup.py"
85
               (("self.execute\\(.*") "\n")
86
               (("scripts=.*") "\n")))))))))
87
88
(define-public python2-claripy
89
  (package
90
    (name "python2-claripy")
91
    (version "6.7.4.12")
92
    (source (origin
93
              (method url-fetch)
94
              (uri (pypi-uri "claripy" version))
95
              (sha256
96
               (base32
97
                "0w6f2jvqajmw1mmdbdzvvs71fsv62z73w0q6jz3sap7mhlwj3vrd"))
98
              (modules '((guix build utils)))
99
              (snippet
100
               `(substitute* "setup.py"
101
                  (("angr-only-z3-custom==9002") "z3-solver")))))
102
    (build-system python-build-system)
103
    (propagated-inputs
104
     `(("ana" ,python2-ana)
105
       ("z3" ,python2-z3-solver)))
106
    (arguments
107
     `(#:python ,python-2))
108
    (home-page "https://github.com/angr/claripy")
109
    (synopsis "Claripy is a abstracted constraint-solving wrapper")
110
    (description "Claripy is a abstracted constraint-solving wrapper.")
111
    (license license:bsd-2)))
112
113
(define-public why3
114
  (package
115
    (name "why3")
116
    (version "0.87.3")
117
    (source (origin
118
              (method url-fetch)
119
              (uri (string-append "https://gforge.inria.fr/frs/download.php/file/36398/why3-"
120
                                  version ".tar.gz"))
121
              (sha256
122
               (base32
123
                "1fn9v6w1ilkrm2n4rz31w8qvjnchyvwxiqs67z3f59b5k99wb2ka"))))
124
    (build-system gnu-build-system)
125
    (native-inputs
126
     `(("ocaml" ,ocaml)))
127
    (propagated-inputs
128
     `(("menhir" ,ocaml-menhir)))
129
    (arguments
130
     `(#:tests? #f)) ;; Need Alt-Ergo
131
       ;#:phases
132
       ;(modify-phases %standard-phases
133
       ;  (replace 'check
134
       ;    (lambda _
135
       ;      (zero? (system* "make" ;"test-ocaml-extraction"
136
       ;                      "test-runstrat" "test-coq-tactic.opt"
137
       ;                      "test-coq-tactic.byte" "test-session.opt"
138
       ;                      "test-session.byte" "test-api-mlw.opt"
139
       ;                      "test-api-mlw.byte" "test-api-mlw-tree.opt"
140
       ;                      "test-mlw-tree.byte" "test-api-logic.opt"
141
       ;                      "test-api-logic.byte")))))))
142
    (home-page "http://why3.lri.fr")
143
    (synopsis "")
144
    (description "")
145
    (license license:lgpl2.1)))
146