diff options
author | Mart Lubbers | 2015-02-06 08:39:37 +0100 |
---|---|---|
committer | Mart Lubbers | 2015-02-06 08:39:37 +0100 |
commit | 379b6353396ca2401241d714733d570629835ffe (patch) | |
tree | 26652c854a79c627b5f50bc8ac26f9b84f8e196d /files/practicum/PropositieLogica3.dcl | |
parent | Merge branch 'master' of https://github.com/dopefishh/fp1 (diff) |
added practicum files, updated gitignore
Diffstat (limited to 'files/practicum/PropositieLogica3.dcl')
-rw-r--r-- | files/practicum/PropositieLogica3.dcl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/files/practicum/PropositieLogica3.dcl b/files/practicum/PropositieLogica3.dcl new file mode 100644 index 0000000..af03b10 --- /dev/null +++ b/files/practicum/PropositieLogica3.dcl @@ -0,0 +1,34 @@ +definition module PropositieLogica3
+
+import StdBool2, StdClass
+
+// Definitie PropL moet gekopieerd worden uit PropositieLogica3.icl
+:: PropL d = Con d // constante d (2-waardig of 3-waardig)
+ | Var Ident // variabele met gegeven naam
+ | Niet (PropL d) // ontkenning van een term
+ | En (PropL d) (PropL d) // logische conjunctie
+ | Of (PropL d) (PropL d) // logische disjunctie
+:: Ident :== Int // variabelen hebben een index i (> 0)
+:: Valuatie d // valuatie van variabelen naar booleans
+
+:: Bool3 = Waar | Onwaar | Onbekend
+
+class domein d :: [d]
+class true d :: d
+
+instance domein Bool
+instance domein Bool3
+instance true Bool
+instance true Bool3
+instance == Bool3
+instance ~~ Bool3
+instance ||| Bool3
+instance &&& Bool3
+instance toString Bool3
+instance toString (PropL d) | toString d
+
+
+vars :: (PropL d) -> [Ident]
+vals :: [Ident] -> [Valuatie d] | domein d
+eval :: (Valuatie d) (PropL d) -> d | ~~, |||, &&& d
+truths :: (PropL d) -> [Valuatie d] | ~~, |||, &&&, ==, domein, true d
|