what color is(x)
  switch x 
    case "snow" : return "white"
    case "grass": return "green"
    case "sky"  : return "blue"
    default     : return "don't know"
what color is("snow") → "white"
what color is ("mud") → "don't know"
what color is(x)
  if is color(x, y) return y
what color is(x)
  if is made of(x, y) and is color(y, z)
    return z
what color is(x)
  return "don't know"
is color("snow", "white")
is made of("grass", "vegetation")
is color("vegetation", "green")
what color is("snow") → "white"
what color is("grass") → "green"
what color is ("mud") → "don't know"
is color("snow", "white")
what color is(x)
  if is made of(x, y) and is color(y, z)
    return z
| This page last modified on 2011 September 9. |