Ejemplo n.º 1
0
s << rp("Instance weak Brightness")
s << rp("Instance radiant Brightness")
s << rp("Instance blazing Brightness")

# The lantern has a brightness called the flame strength. The flame strength of the lantern is blazing.

s << rp("Property ['flame strength' lantern] Brightness")
s << rp("Set ['flame strength' lantern] blazing")
print("T: ", s.func_eval_named_prop('flame strength' ,"lantern"), "blazing")
print("F: ", s.func_eval_named_prop('flame strength' , "lantern"), "weak")
print("T: ", s.func_is_kind("blazing",  "Brightness" ))

# CanBe
# A fruit can be unripened, ripe, overripe, or mushy
s << rp("CanBe fruit  [unripened, ripe, overripe, mushy]")
s << rp("Set fruit ripe")
s << rp("Set [ color fruit ] red ")
s << rp("Set [ location fruit ] cozinha ")
s << rp("Set [food  player] fruit ")

s << rp("Set ['favorite food'  Animal] fruit ")

#print("T: ", s.func_eval(rp("[color [key  player]]")))
print("T: ", s.is_named_property("color"))
print("T: ", s.is_named_property("location"))
print("F: ", s.is_named_property("book"))

print("Eval Values ----------")
print("T: ", s.func_eval(rp("color [food  player]"))) #red
print("T: ", s.func_eval(rp("location ['favorite food' jairo]"))) #cozinha
print("T: ", s.func_eval(rp("color [location jairo]"))) #None