Code: Select all
domains
person, activity = symbol
predicates
likes(person,activity)
clauses
likes(ellen,tennis).
likes(john,football).
likes(tom,baseball).
likes(eric,swimming).
likes(mark,tennis).
likes(bill,X) if likes(tom,X)
Code: Select all
#define likes(x,y) If(ValType(likes[x])=="B", Eval(likes[x],y), likes[x]==y)
function Main()
local likes := {=>}
likes[ "ellen" ] = "tennis"
likes[ "john" ] = "football"
likes[ "tom" ] = "baseball"
likes[ "eric" ] = "swimming"
likes[ "marc" ] = "tennis"
likes[ "bill" ] = { | x | likes( "tom", x ) }
? likes( "bill", "tennis" )
? likes( "bill", "baseball" )
return nil