added practicum files, updated gitignore
[fp1415.git] / files / practicum / PropositieLogica3.dcl
1 definition module PropositieLogica3
2
3 import StdBool2, StdClass
4
5 // Definitie PropL moet gekopieerd worden uit PropositieLogica3.icl
6 :: PropL d = Con d // constante d (2-waardig of 3-waardig)
7 | Var Ident // variabele met gegeven naam
8 | Niet (PropL d) // ontkenning van een term
9 | En (PropL d) (PropL d) // logische conjunctie
10 | Of (PropL d) (PropL d) // logische disjunctie
11 :: Ident :== Int // variabelen hebben een index i (> 0)
12 :: Valuatie d // valuatie van variabelen naar booleans
13
14 :: Bool3 = Waar | Onwaar | Onbekend
15
16 class domein d :: [d]
17 class true d :: d
18
19 instance domein Bool
20 instance domein Bool3
21 instance true Bool
22 instance true Bool3
23 instance == Bool3
24 instance ~~ Bool3
25 instance ||| Bool3
26 instance &&& Bool3
27 instance toString Bool3
28 instance toString (PropL d) | toString d
29
30
31 vars :: (PropL d) -> [Ident]
32 vals :: [Ident] -> [Valuatie d] | domein d
33 eval :: (Valuatie d) (PropL d) -> d | ~~, |||, &&& d
34 truths :: (PropL d) -> [Valuatie d] | ~~, |||, &&&, ==, domein, true d