-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtransducer1.smt2
39 lines (33 loc) · 1.58 KB
/
transducer1.smt2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(set-logic QF_S)
; Successor transducer
(set-option :parse-transducers true)
(define-funs-rec ((succ ((x String) (y String)) Bool)
(succH ((x String) (y String)) Bool)) (
; definition of succ
(or (and (not (= x "")) (not (= y ""))
(= (str.head x) (char.from-int 48)) ; '0'
(= (str.head y) (char.from-int 48)) ; '0'
(succ (str.tail x) (str.tail y)))
(and (not (= x "")) (not (= y ""))
(= (str.head x) (char.from-int 49)) ; '1'
(= (str.head y) (char.from-int 49)) ; '1'
(succ (str.tail x) (str.tail y)))
(and (not (= x "")) (not (= y ""))
(= (str.head x) (char.from-int 48)) ; '0'
(= (str.head y) (char.from-int 49)) ; '1'
(succH (str.tail x) (str.tail y))))
; definition of succH
(or (and (= x "")
(= y ""))
(and (not (= x "")) (not (= y ""))
(= (str.head x) (char.from-int 49)) ; '1'
(= (str.head y) (char.from-int 48)) ; '0'
(succH (str.tail x) (str.tail y))))))
(declare-fun x () String)
(declare-fun y () String)
(assert (str.in.re x
(re.++
(re.+ (re.union (str.to.re "0") (str.to.re "1")))
(re.union (str.to.re "0") (str.to.re "1")))))
(assert (succ x y))
(check-sat)