RuleML and DAML Rules Built-ins DRAFT 1 Said Tabet, Benjamin Grosof and Harold Boley 05/27/2003 This document describes a proposed preliminary list of built-ins for RuleML and DAML Rules. The approach we are taking is to focus on an initial set of functions and operators before extending this list to more advanced built-ins dealing with URIs, external APIs and other custom functionality. We organize the proposed list into subsets of built-ins: 1. Elementary Arithmetic built-ins: ---------------------------- 1.1 Addition: + 1.2 Substraction: - 1.3 Multiplication: * 1.4 Division: / 2. Comparaison built-ins: ------------------------ 2.1 Greater Than > 2.2 Less Than < 2.3 Equal == 2.4 Less Than or Equal <= 2.5 Greater Than or Equal >= 2.6 Not Equal != 3. More Built-ins: ---------------- 3.1 Assign = 3.2 Increment ++ 3.3 Decrement -- 3.4 Power ** 3.5 Abs (absolute value) 3.6 Min 3.7 Max 4. Data Types -------------- Our approach is to integrate XML Part 2, Data Types: http://www.w3.org/TR/xmlschema-2/ 5. String built-ins: ----------------- 5.1 str-length returns the length of a given string in characters 5.2 str-cat string concatenation 5.3 str-compare compares 2 strings 5.4 str-index returns the position of the first argument within the second argument 5.5 is-String returns TRUE if the argument is a string, FALSE otherwise 5.6 sub-string returns a substring from a string argument given two 1-based indices 5.7 str-upcase returns the given string argument in Uppercase 5.8 str-lowcase retrns the given string argument in lowercase 6. I/O Streams built-ins: ----------------------- 6.1 open Open a file or a stream 6.2 read Read from stream or file 6.3 write Write to a stream or file 6.4 close close file or stream 6.5 printout sends unformatted output to a given stream/router 7. Control and debugging built-ins: --------------------------------- 7.1 run invoke an inference cycle 7.2 query run a query 7.3 halt halts an inference/query cycle 7.4 reset reset the fact base 7.5 show-facts returns the list of asserted facts 7.5 show-rules returns the list of rules 7.8 debug runs in a debug mode: traces all rule firings 7.9 assert assert new facts 7.10 retract retract facts 7.11 load-facts asserts facts loaded from a file 7.12 load-rules loads rules from a file 7.13 evaluate evaluates a string input as command line input and returns the result 7.14 clear clear engine from all its contents: rules, facts, etc. 8. External objects and pointers access built-ins -------------------------------------------- TBD 9. URIs built-ins --------------- TBD