Here is how to enter formulas, structures and input files.
-
All symbols except parentheses and commas must be separated by whitespace.
Example:- (p ^ q)
; not:-(p^q)
. -
All formulas use round brackets.
Example:\exi x (P(x) ^ Q(x))
; not:\exi x [P(x) ^ Q(x)]
. -
Terms inside function expressions and atomic predications are enclosed by brackets and separated by commas.
Example:P(a,b)
; not:Pab
. -
Bracketing conventions:
- Binary connectives go with outer brackets, unary operators do not.
Example:
(p ∧ (q → r))
,(p → ¬q)
,∃x(P(x) ∧ Q(x))
; not:(p → (¬q))
,(∃x(P(x) ∧ Q(x)))
. - Outer brackets may be omitted.
Example:p ∧ q
=(p ∧ q)
. - Occurrences of the same operator are left-associative.
Example:p ∧ q ∧ r
=((p ∧ q) ∧ r)
. - Operator precedence:
∃
,∀
,¬
>∧
>∨
>→
>↔
>⊕
.
Example:¬ p ∨ q ∧ r
=((¬p) ∨ (q ∧ r))
,∃x P(x) ∧ Q(x)
=(∃x P(x)) ∧ Q(x)
(brackets around¬
and∃
only for clarity here).
- Binary connectives go with outer brackets, unary operators do not.
Example:
Lowercase letters x
- z
, optionally followed by a number, optionally separated by an underscore.
Examples: x
, y
, z5
, x_23
.
Lowercase letters a
- e
and i
- o
, optionally followed by a number, optionally separated by an underscore;
or: a sequence of letters, numbers and underscore, with the first symbol a lowercase letter.
Examples: a
, m
, c12
, peter
; not: p
, Mary
.
Lowercase letters f
- h
, optionally followed by a number, optionally separated by an underscore.
Examples: f
, g2
.
Lowercase letters p
- u
, optionally followed by a number, optionally separated by an underscore.
Examples: p
, q
, p_1
, u_23
.
A sequence of letters, numbers and underscore, with the first symbol an uppercase letter.
Examples: P
, Loves
, P_123
; not: p
, loves
.
=
, \eq
.
⊤
, \top
, \verum
, \ltrue
⊥
, \bot
, \falsum
, \lfalse
¬
, -
, ~
, \neg
, \lnot
∧
, ^
, &
, \wedge
, \land
∨
, v
, |
, \vee
, \lor
→
, ⇒
, ⊃
, ->
, =>
, \rightarrow
, \Rightarrow
, \to
, \limp
↔
, ⇔
, ≡
, <->
, <=>
, \leftrightarrow
, \Leftrightarrow
, \oto
, \lbiimp
⊕
, ⊻
, \oplus
, \lxor
∃
, \exists
, \exi
, \ex
∀
, \forall
, \all
, \fa
\most
Example: \most x(Child(x), Sleep(x))
.
\more
Example: \more x(Boy(x), Girl(x), Sleep(x))
.
◇
, *
, \Diamond
, \poss
□
, #
, \Box
, \nec
\int
\ext
Examples:
p ^ q -> (- r v p)
P(a)
\all x (Woman(x) -> \exi y (- (x = y) ^ Man(y) ^ Love(x,y)))
# p -> \falsum
Believe(john, \int Bald(theking))
- A structure is specified by listing its components, with components separated by linebreaks (without commas), and the component name and its specification separated by
=
.
Component names:
V
: valuation function for propositional logicsD
: domain of discourse for predicate logicsI
: interpretation function for predicate logicsW
: set of possible worlds for modal logicsK
: set of states for intensional logics (instead of W)R
: accessibility relation for modal and intensional logicsV
: set of designated assignment functions for predicate logics (optional)
Component specifications:
- Whitespace and linebreaks within component specifications are ignored.
- Names (formal symbols and real-world objects) are entered as bare strings.
Example:a
,John
,0
. - Sets are enclosed by
{
,}
, with the elements separated by,
. - Tuples are enclosed by
(
,)
, with the elements separated by,
. - Functions are enclosed by
[
,]
, with the elements separated by,
and argument - value pairs separated by:
. - Elements of interpretations of one-place predicates and one-place function domains have to be entered as singleton tuples enclosed in brackets
(a)
rather than as bare elementsa
. - For classical modal structures, frame properties such as reflexivity can not be set generically and need to be specified by explicitly listing all respective pairs in the accessibility relation.
- For intuitionistic Kripke structures, the reflexive and transitive closure of the accessibility relation and the monotonic closure of the valuation resp. interpretation function are computed automatically and do not need to be explicitly specified in the structure definition; only the atomic accessibility pairs and the atoms that are new in each state need to be listed.
Examples:
Non-modal propositional structure:
V = [p: True, q: False, r: True]
Non-modal predicational structure:
D = {Mary, Susan, Paula, John, Peter}
I = [m: Mary,
j: John,
f: [(Mary): Susan, (John): Peter],
Woman: {(Mary), (Susan), (Paula)},
Man: {(John), (Peter)},
Happy: {(Mary), (Susan), (John), (Peter)},
Loves: {(Mary, John), (Susan, John), (Paula, Peter), (Peter, John)}]
V = [v1: [x: Mary, y: Paula, z: Peter],
v2: [x: Paula, y: Paula, z: Peter]]
Modal propositional structure:
W = {w1, w2}
R = {(w1, w1), (w1, w2)}
V = [p: [w1: True, w2: False],
q: [w1: False, w2: True]]
Modal predicational structure with constant domains:
W = {w1, w2}
R = {(w1, w1), (w1, w2)}
D = {Mary, John}
I = [m: [w1: Mary,
w2: Mary],
Loves: [w1: {(Mary, Peter)},
w2: {(Mary, Peter), (Peter, Mary)}]]
Modal predicational structure with varying domains:
W = {w1, w2}
R = {(w1, w1), (w1, w2)}
D = [w1: {Mary, John},
w2: {Mary, Susan}]
I = [m: [w1: Mary,
w2: Mary],
Loves: [w1: {(Mary, Peter)},
w2: {(Mary, Susan), (Mary, Mary)}]]
Kripke (intuitionistic) structures:
like modal propositional structure and modal varying predicational structure, except with the set of worlds named K
instead of W
.
- Input files are plain text files.
- Each formula is written on one line.
- The first formula in the list is interpreted as the conclusion and the others as the premises (if applicable).
- If a structure and formulas are specified, they are separated by a blank line.
- If expressions are to be evaluated against assignment functions and/or possible worlds in a structure, they are specified by prepending their names to the formula prefixed with
v:
andw:
respectively and suffixed with
Examples:v:v1 Love(m,x)
,w:w2 \exi x Unicorn(x)
,v:v1 w:w2 Unicorn(x)
.
Examples: see the exemplary files in pyPL/input
.
If you don't want to use the graphical interface, you can also enter input and commands in the source code. See the commented-out examples in pyPL/main.py
.