aboutsummaryrefslogtreecommitdiff
path: root/sem7/pp/prolog/lec3.pl
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-11-25 08:47:19 +0100
committerJulian T <julian@jtle.dk>2021-11-25 08:47:19 +0100
commit890ad2bcee172ab2a4cbb319145f5b42ba38619a (patch)
treec7cc445410379cb5ee4b37b18f2d45a56e680b28 /sem7/pp/prolog/lec3.pl
parent7f57150038a90f634dd27b25bd9bba05c461c22a (diff)
Add notes and assignment solution
Diffstat (limited to 'sem7/pp/prolog/lec3.pl')
-rw-r--r--sem7/pp/prolog/lec3.pl110
1 files changed, 110 insertions, 0 deletions
diff --git a/sem7/pp/prolog/lec3.pl b/sem7/pp/prolog/lec3.pl
new file mode 100644
index 0000000..d434134
--- /dev/null
+++ b/sem7/pp/prolog/lec3.pl
@@ -0,0 +1,110 @@
+
+/* Opgave 1
+
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ loves(caledon, rose).
+ happy(rose).
+ happy(jack).
+}
+{
+ loves(rose, jack).
+ loves(caledon, rose).
+}
+{
+ loves(jack, rose).
+ loves(caledon, rose).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ loves(caledon, rose).
+ happy(jack).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ loves(caledon, rose).
+ happy(rose).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ loves(caledon, rose).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ happy(jack).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ happy(rose).
+}
+{
+ loves(rose, jack).
+ loves(jack, rose).
+ happy(rose).
+ happy(jack)
+}
+
+Well okay i feel stupid
+
+We say that the universe U_p = {rose, jack, caledon}.
+We will then way that the base is:
+
+U_b = { loves(x, y) | x, y \in U_p } \cup { happy(x) | x \in U_p }
+
+Then all the interpretations are.
+
+I = { S | S \subseteq U_b }
+
+*/
+
+
+/* Opgave 2
+
+loves(rose, jack).
+happy(rose)
+
+happy(rose) <= loves(rose, jack),loves(jack,rose)
+We know rose is happy, we do not need to check the predicates.
+For some reason, kind of TODO.
+
+*/
+
+/* Opgave 3
+
+I_4 og I_5 er modeller for P, hvor I_4 lige har en extra happy(caledon).
+
+Her er I_4 minimal fordi ingen anden model for P er mindre.
+
+*/
+
+/* Opgave 4
+
+M_1 = T_P(Ø) = {god(odin),son(odin,thor),son(odin,baldr),son(thor,mothi),son(thor,magni)}
+M_2 = T_P(M_1) = M_1 \cup {demigod(thor),demigod(baldr)}
+M_3 = T_P(M_2) = M_2 \cup {mortal(mothi),mortal(magni)}
+
+*/
+
+/* Opgave 5
+
+B -+-> A
+D -+-> C
+B -+-> A
+C ---> A
+C -+-> B
+D ---> B
+
+D, C -> A, B
+D -> C -> B -> A
+
+Det er stratifyable.