|
This post was updated on .
Following is the code.
'''
class: Person
property: love: Person->Person
'''
with onto:
class love(Person >> Person):
pass
Person.is_a.append(love.some(Person)) # a person loves someone.
x = Person('x')
print(love.some(Person) in Person.is_a) # True
print(Person in x.INDIRECT_is_a) # True
print(love.some(Person) in x.INDIRECT_is_a) # False, excepted to be True, since x loves someone
print(love.some(Person) in x.INDIRECT_is_instance_of) # False
print(x in x.love) # False
while, following is OK
class love_person(Person):
equivalent_to = [Person & love.some(Person)]
print(love_person in x.INDIRECT_is_instance_of) # True, however, it is equivalent to the statement above
An additional question is that Person has no INDIRECT_is_a property.
|