## Basic

These functions are part of the core user interface. They are available in both scripting and interactive modes.

application ([ "name" | object ])
Set the current application to the one given by name (loading its rules if necessary) or by an object of the type Poly::Application.
Called without arguments just returns the current Poly::Application object, which is also available in the variable $application. Say print $application->name to see its name.
include ("rulefile", ...)
Read additional rule files, interpret them in the context of the current application. If no paths are specified explicitly, the rulefiles are searched in the current directory as well as in the directories stored in the preference variable @lookup_rules.
load ("filename")
Read the data file filename and create the object according to the type stored there. If the data file does not contain a type declaration, the default type of the current application is assumed.
When called in a void context (that is, the return value is neither explicitly stored in a variable, nor passed to another function) the object is stored in the variable $this. The application which has created this data file is then made the current application.
save ([ object [, "filename" [, overwrite ]]])
Store the given object, or $this if omitted, in a data file.
If filename is specified, create the file with this name and store the object there. The boolean option overwrite allows to overwrite existing files. If omitted or FALSE, and the given file already exists, emit a warning message and do nothing.
If filename is omitted, write the object back to the file it was loaded from. If the object was created with a new constructor, a new file is created, with the name consisting of the object name (specified by the creation) and the application-specific suffix. If the object name is empty, an artificial name of the form ObjectType_NNN is generated, where NNN is an ordinal number.
In any case all open transactions on the object are reverted with rollback prior to writing to the file. The save operation is not performed if the changed attribute of the object reverts to FALSE after the rollback.
prefer ("label", ... | "reset")
Make the production rules, user functions, or methods labeled with given label be preferred over competing rules (functions, methods). The label syntax is the same as in the prefer directive in the rule files, except that the complex label names and wildcards must be quoted in order to avoid perl complaints about bad syntax.
The new preference list is also saved in your personal file ~/.polymake/prefer.pl so that it remains active in all forthcoming sessions until you revoke it with another prefer command.
The special keyword reset reverts all preference settings to the initial state as they had after loading the rule files.

## Application-specific

All user functions defined in the current application are automatically available in the script mode. Besides the explicitly defined functions described under "User Functions" topics in the application-specific navigation subtrees, each application defines a lot of implicit user functions, most of them as convenient shortcuts for some longer expressions.

application_name;
is a shortcut for application "application_name"; provided the application is already loaded.
ObjectType( [ "name" ], "PROPERTY_NAME" => value, ... );
is the same as the object constructor call with immediate commit afterwards. This function also employs a little magic for guessing the object name from the variable name it is assigned to:
$abc=OBJECT_TYPE( ... );
will set the object name to "abc". If, to the contrary, called in a void context, it assigns the new object to the variable $this.
label;
Make all production rules, user functions, and methods labeled with the given label or some of its descendants temporarily preferred until the user script is executed or the input line in the interactive mode is completely interpreted.
For a more fine-granular steering you can specify sublevel names in exactly the same manner as they are declared, e.g. lrs.convex_hull;
PROPERTY_NAME; METHOD_NAME;
are shortcuts for $this->PROPERTY_NAME and $this->METHOD_NAME for all defined object properties and public methods respectively. Indeed, you can also pass arguments to the method.