1
(in-package "MODEL-CHECK")
3
(include-book "models")
6
(declare (xargs :guard t))
8
(not (in s '(+ & MU NU true false)))))
9
; there can be unexpected behaviour if I don't do this, e.g., what
10
; is the semantics of (mu & f)? is it a mu or an &?
12
(defun basic-m-calc-formulap (f ap v)
13
"True iff f is a mu-calculus formula given that ap is the list of
14
atomic proposition constants and v is the set of atomic proposition
15
variables. This checks that f is a basic mu-calc formula. We allow
16
for abbreviations (e.g. =>) with translate. Formats of formulas are: p
17
-propositional variable or constant (EX f), (f1 & f2), (f1 + f2),
18
(~ f), (MU y f(y)), (NU y f(y))"
19
(declare (xargs :guard (and (true-listp ap) (true-listp v))))
21
(or (in f '(true false))
23
(or (in f ap) (in f v)))))
25
(and (in (first f) '(~ EX))
26
(basic-m-calc-formulap (second f) ap v)))
28
(let ((first (first f))
31
(or (and (in second '(& +))
32
(basic-m-calc-formulap first ap v)
33
(basic-m-calc-formulap third ap v))
34
(and (or (in first '(MU NU)))
37
(basic-m-calc-formulap third ap (cons second v))))))))
40
(defthm truelistp-listlen0
41
(implies (and (equal (len x) 0)
44
:rule-classes :forward-chaining)
47
(defun translate-f (f)
48
"This is how I chose to extend the syntax of the Mu-calculus so one
49
now has AX, \| (same as +), => and -> (both are implies), and =, <->,
50
<=> (all are for boolean equality). This function just rewrites these
51
in terms of the basic boolean operators."
52
(declare (xargs :guard t))
55
(let ((first (first f))
57
(cond ((equal first 'AX)
58
`(~ (EX (~ ,(translate-f second)))))
59
(t `(,first ,(translate-f second))))))
61
(let ((first (first f))
64
(cond ((equal second '\|)
65
`(,(translate-f first) + ,(translate-f third)))
67
`((~ ,(translate-f first)) + ,(translate-f third)))
68
((in second '(= <=> <->))
69
`(((~ ,(translate-f first)) + ,(translate-f third)) &
70
((~ ,(translate-f third)) + ,(translate-f first))))
72
`(,first ,second ,(translate-f third)))
73
(t `(,(translate-f first) ,second ,(translate-f third))))))
76
(defun m-calc-formulap (f ap v)
77
(declare (xargs :guard (and (true-listp ap) (true-listp v))))
78
(basic-m-calc-formulap (translate-f f) ap v))
81
(defun m-calc-sentencep (f ap)
82
"Top level function. True if f is a mu-calculus formula. We require
83
that variable names and constant names do not overlap. Also, we do
84
not allow free variables."
85
(declare (xargs :guard (true-listp ap)))
86
(m-calc-formulap f ap nil))