7.2 Lambda expressions in use

Usage of lambda expressions

For defining relations

We use lambda expressions to stand for other things. Lambda expressions can be used to define new relations and concept types. For example:

   relation Singing(*x) is
     [Animate: ?x]<-(Agnt)<-[Sing]

Here, '*x' is the formal parameter of the relation. The formal parameter is the placeholder for what will be substituted into ?x's place when the relation is used. For example, the above relation might be used like this:

   [Person: John]<-(Singing)
   "John is singing"

When the relation is expanded to its defining lambda expression, the graph will look like this:

   [Person: John]<-([Animate: ?x]<-(Agnt)<-[Sing])
   "John is the formal parameter to the lambda expression 'An animate
    entity, ?x, is singing'"

This can then be unified to:

   [Person: John]<-(Agnt)<-[Sing]
   "John is singing"

For defining concept types

We can also define concept types using lambda expressions:

   type StarcrossedLover(*x) is
      [Lover: ?x]->(Attr)->[StarCrossed]

This concept type can then be used like this:

   [StarcrossedLover: {Romeo,Juliet}@2]<-(Agnt)<-[Take]-
      ->(Thme)->[Life: #their]
   "A pair of star-cross'd lovers take their life..."

The notation "{Romeo, Juliet}@2" will be explained later in the course, here and here. The notation "#their" will be explained here.


We see, then, that lambda expressions are used when defining relation types and concept types. Lambda expressions fill out the definition of relations and concept types, while allowing parts of the lambda expression to be filled with input from the outside.

Prev: 7.1 The basics
Up: 7 Lambda expressions
Next: 7.3 Quiz: Lambda expressions