Simple Virtual Machine - Official plugin bool(7)

SYNOPSIS
svm_plugin_bool - Simple Virtual Machine official plugin for boolean management.

DESCRIPTION
This plugin introduces extra features to manage built-in type BLN values.

INVOKATION
This plugin can be added to the Simple Virtual Machine using the directive:
PLUGIN "svmbool.so"

CONTENT

  Basic operations

  INSTRUCTION bool.and ( BLN * | PTR ) -> BLN
This instruction returns the logical and of a set of booleans. If the set is empty, TRUE is returned. When a pointer is specified, the instruction uses the pointed memory block as boolean set.

  INSTRUCTION bool.equal BLN BLN -> BLN
This instruction returns TRUE when the two booleans are the same ones, FALSE otherwise.

  INSTRUCTION bool.nand ( BLN * | PTR ) -> BLN
This instruction returns the logical negative and of a set of booleans. If the set is empty, FALSE is returned. When a pointer is specified, the instruction uses the pointed memory block as boolean set.

  INSTRUCTION bool.nor ( BLN * | PTR ) -> BLN
This instruction returns the logical negative or of a set of booleans. If the set is empty, TRUE is returned. When a pointer is specified, the instruction uses the pointed memory block as boolean set.

  INSTRUCTION bool.not BLN -> BLN
This instruction returns the logical negation of a boolean.

  INSTRUCTION bool.or ( BLN * | PTR ) -> BLN
This instruction returns the logical or of a set of booleans. If the set is empty, FALSE is returned. When a pointer is specified, the instruction uses the pointed memory block as boolean set.

  INSTRUCTION bool.xor BLN BLN -> BLN
This instruction returns TRUE when the two booleans are different, FALSE otherwise.

  Boolean expressions

  INSTRUCTION bool.rpn ( [ BLN 'NOT' 'AND' 'OR' 'XOR' 'NAND' 'NOR' 'EQUAL' ] | { PEP INT } ) + -> BLN
This instruction evaluates a full boolean expression written using the reverse polish notation (aka. post-fixed operations: a AND b is written a b AND).

    Boolean values can be constants or values coming from the memory. NOT is the unary negation of a boolean. AND, OR, XOR, NAND, NOR, EQUAL are binary operations supported in this plugin. { PEP INT } are function calls: the plugin entry point is the function name and the integer the number of parameters of the function. The function has to be a valid plugin function following this definition: FUNCTION <plugin>.bool_<entry> BLN * -> BLN

  Boolean functions

  FUNCTION bool.not BLN -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.and ( BLN * | PTR ) -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.or ( BLN * | PTR ) -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.xor BLN BLN -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.nand ( BLN * | PTR ) -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.nor ( BLN * | PTR ) -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.equal BLN BLN -> BLN
This function does the same operation as the corresponding instruction.

  FUNCTION bool.format BLN INT:size [ 'LEFT' 'CENTER' 'RIGHT' ] ? ( [ 'UPPER' 'LOWER' 'CAMEL' 'LETTER' 'NUM' ] | STR:true STR:false ) -> STR
This function formats a boolean into a string. The resulting string has the requested size, and the boolean value is put left (default alignement), centered or put right. The rendering of the boolean is set as: TRUE/FALSE for UPPER, true/false for LOWER, True/False for CAMEL, T/F for LETTER, 1/0 for NUM, and set to the given values when specified.

SEE ALSO
svm(1) for help on the Simple Virtual Machine.

AUTHOR
The Simple Virtual Machine is designed, implemented and maintained by Julien Bruguier <===EMAILCONTACT===>.