Working on some python scrips with a friend. Got these exercisees; - ia1 = Interpretation([knows(bob,john),knows(john,bob),knows(mary,alice),knows(alice,mary)],[bob,john,mary,alice])
-
This is supposed to be symmetric... but this is as far as I get. - f1a1 = forall(x, knows(x, bob)) > forall(y, knows(bob, y)) & forall(x, knows(x, mary)) > forall(y, knows(mary, y))
-
-
print 'This Is symmetric:', f1a1.val(ia1)
I shouldnt use the name bob, mary and so on, but if I use the variables a,b, for example I get the error that its not defined. -
ia2 = Interpretation([knows(bob,john),knows(john,bob),knows(mary,alice),knows(alice,mary)],[bob,john,mary,alice])
-
this part is supposed to be transitive. From what I can se (though Im kind of tired) it is not transitive. But I just cant seem to find the right answser. -
f1a2 = forall(z, forall(y, forall(x, (knows(x, y) & forall(x, knows(y,z)) > forall(x, knows(x, z))))))
-
print 'This Is Transitive:', f1a2.val(ia2)
and finally this, its going to be symmetric. -
ia5 =
-
Interpretation([loves(bob,mary),loves(john,john),loves(mary,alice),loves(bob,alice)],[bob,john,mary,alice])
-
and this is how far I came on this one -
f1a5 = forall(x, forall(y, forall(z, loves(x, y) & loves(y, z) > loves(x, z))))
-
print 'This is symmetric', f1a5.val(ia4)
-
cant find whats wrong with this one.
Would really appreciate any help on these exercises.
// Sweden
0 937 Sign in to post your reply or Sign up for a free account.
Similar topics
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |