next up previous contents index
Next: Memory Management Up: System Description Previous: Dynamically loading predicates in   Contents   Index


Command Line Arguments

There are several command line options for the emulator. The general synopsis is:


      	xsb [flags] [-l] [-i]
	xsb [flags] -n
	xsb [flags] module
	xsb [flags] -B boot_module [-D cmd_loop_driver] [-t] [-e goal]
	xsb [flags] -B module_to_disassemble -d
	xsb -[h | v]
	xsb --help | --version | --nobanner | --quietload | --noprompt

	memory management flags:
	    -c tcpsize | -m glsize | -o complsize | -u pdlsize | -r | -g gc_type
	miscellaneous flags:
	    -s | -T

	module:
	    Module to execute after XSB starts up.
	    Module should have no suffixes, no directory part, and
	    the file module.O must be on the library search path.
      	boot_module:
	    This is a developer's option.
	    The -B flags tells XSB which bootstraping module to use instead
	    of the standard loader. The loader must be specified using its
	    full pathname, and boot_module.O must exist.
    	module_to_disassemble:
	    This is a developer's option.
	    The -d flag tells XSB to act as a disassembler.
	    The -B flag specifies the module to disassemble.
	cmd_loop_driver:
	    The top-level command loop driver to be used instead of the
	    standard one. Usually needed when XSB is run as a server.

      	    -i : bring up the XSB interpreter
       -e goal : evaluate goal when XSB starts up
      	    -l : the interpreter prints unbound variables using letters
      	    -n : used when calling XSB from C
	    -B : specify the boot module to use in lieu of the standard loader
	    -D : Sets top-level command loop driver to replace the default.
      	    -t : trace execution at the SLG-WAM instruction level
		 (for this to work, build XSB with the --debug option)
	    -d : disassemble the loader and exit
      	  -c N : allocate N KB for the trail/choice-point stack
      	  -m N : allocate N KB for the local/global stack
      	  -o N : allocate N KB for the SLG completion stackof
      	  -u N : allocate N KB for the SLG unification (table copy) stack
      	    -r : turn off automatic stack expansion
    -g gc_type : choose the garbage collection ("none", "sliding", or "copying")
      	    -s : maintains more detailed statistical information
      	    -T : print a trace of each called predicate
 -v, --version : print the version and configuration information about XSB.
    -h, --help : print this help message
    --nobanner : don't show the XSB banner on startup
   --quietload : don't show the `module loaded' messages
    --noprompt : don't show prompt (for non-interactive use)
The order in which these options appear makes no difference.

-i
Brings up the XSB interpreter. This is the normal use and because of this, use of this option is optional and is only kept for backwards compatibility.
-l
Forces the interpreter to print unbound variables as letters, as opposed to the default setting which prints variables as memory locations prefixed with an underscore. For example, starting XSB's interpreter with this option will print the following:

                  | ?- Y = X, Z = 3, W = foo(X,Z).

                  Y = A
                  X = A
                  Z = 3
                  W = foo(A,3)
as opposed to something like the following:

                  | ?- Y = X, Z = 3, W = foo(X,Z).

                  Y = _10073976
                  X = _10073976
                  Z = 3
                  W = foo(_10073976,3);
-n
used in conjunction with the -i option, to indicate that the usual read-eval-print top-loop is not to be entered, but instead will interface to a calling C program. See the chapter Calling XSB from C in Volume 2 for details.
-d
Produces a disassembled dump of byte_code_file to stdout and exits.
-c size
Allocates initial size Kbytes of space to the trail/choice-point stack area. The trail stack grows upward from the bottom of the region, and the choice point stack grows downward from the top of the region. Because this region is expanded automatically from Version 1.6.0 onward, this option should rarely need to be used. Default initial size: 768 Kbytes.
-m size
Allocates size Kbytes of space to the local/global stack area. The global stack grows upward from the bottom of the region, and the local stack grows downward from the top of the region. Default: 768 Kbytes.
-o size
Allocates size Kbytes of space to thecompletion stack area. Because this region is expanded automatically from Version 1.6.0 onward, this option should rarely need to be used. Default initial size 64 Kbytes.
-u size
Allocates size Kbytes of space to the unification (and table copy) stack. Default 64 Kbytes. (This option should rarely need to be used).
-D
Tells XSB to use a top-level command loop driver specified here instead of the standard XSB interpreter. This is most useful when XSB is used as a server.
-r
Turns off automatic stack expansion.
-g gc_type
Chooses the garbage collection strategy that is employed; choice of the strategy is between "none" (meaning perform no garbage collection), or garbage collection based on "sliding" or on "copying". Since garbage collection is only available when the emulator is based on a CHAT model (see also the installation options), this option only makes sense in this context; it is ineffective when the emulator is SLG-WAM based.
-s
Maintains information on the size of program stacks for the predicate statistics/0. This option may be expected to slow execution by around 10%. Default: off.
-T
Generates a trace at entry to each called predicate (both system and user-defined). This option is available mainly for people who want to modify and/or extend XSB, and it is not the normal way to trace XSB programs. For the latter, the builtin predicates trace/0 or debug/0 should be used (see Chapter 7).

Note: This option is not available when the system is being used at the non-tracing mode (see Section 7).

-t
Traces through code at SLG-WAM instruction level. This option is for internal debugging and is not fully supported. It is also not available when the system is being used at the non-debug mode (see Section 7).
-e goal
Pass goal to XSB at starup. This goal is evaluated right before the first prompt is issued. For instance, xsb -e "write(Hello!'), nl."' will print a heart-warming message when XSB starts up.
-nobanner
Start XSb without showing the startup banner. Useful in batch scripts and for interprocess communication (when XSB is launched as a subprocess).
-quietload
Do not tell when a new module gets loaded. Again, is useful in non-interactive activities and for interprocess communication.
-noprompt
Do not show te XSB prompt. This is useful only in batch mode and in interprocess communication when you do not want the prompt to clutter the picture.

As an example, a program which uses more heap and local stack than the default configuration of XSB might be run by invoking XSB with the command.


         xsb -m 2000


next up previous contents index
Next: Memory Management Up: System Description Previous: Dynamically loading predicates in   Contents   Index
Baoqiu Cui
2000-04-23