Defining worlds for the expression evaluator

I'm accepting suggestions for alternate worlds... the world files look like (for example):

 # Simple world.  Diddly example whipped together by
 # John Halleck as a demo.
 #
  $worldname = "Frog World";  # World name MUST be set.

  &makeobject('frog','fly','bug','pad','water','kidwithrock','rock');
# List of the world's actual objects.

  &makepredicate('centeroftheuniverse', 'good', 'walks','fun', 'food');
  &makepredicate('breedingspot', 'evil', 'bad');
  &makepredicate('biggerthan');
# List of the predicates in the world.

  &make1predicate('frog', 'centeroftheuniverse', 'good', 'walks');
  &make1predicate ('fly',  'food', 'good', 'fun');
  &make1predicate ('bug', 'food', 'good', 'walks');
  &make1predicate ('pad', 'good');
  &make1predicate ('water', 'good', 'breedingspot');
  &make1predicate ('kidwithrock', 'bad', 'evil', 'walks');
  &make1predicate ('rock', 'bad');
# For each one object, list what 1 place predicates true of it.

  &maketruth('biggerthan','kidwithrock','frog');
  &maketruth('biggerthan','frog','bug');
# For multiple place predicates, list the predicates, with the relations
# that are true.  For example the second statement above says that
#   biggerthan(frog,bug) is true.
  
  # Note that greater than's have to be done (for html) as > .
  @examples = (
     'fun(fly)',
     'exists(x,  good(x)*food(x) )',
     'forall(x, -good(x) > -frog(x) )',
     'exists(x, good(x))',
     'biggerthan(frog,bug)'
              );
  #
 1; # This line MUST be left on the end of the file.

World files are just Perl "require" files and can contain any perl code.

When designing worlds, remember that objects are expensive and predicates are cheap.


Go to ...


This page is http://www.cc.utah.edu/~nahaj/logic/evaluate/defineworld.html
This page was last modified on May 15th, 2000.