Loading
Tutorials (basic syntax)
String
You can define in C-style string by enclosing the string in double quotes (").
- If you want to put a double quotation in a string, you need to put \" in the string.
- \" and \r and \n, \\ are the same way as C.
You can define in BASIC-style string by enclosing the string in single quotes (').
- If you want to put a single quotation in a string, you need to put '' in the string.
If a string contains new line, it is valid.
Example
"SELECT *
FROM tab "
Variables
A variable name has to start dollar $ sign.
Example
$x
$value
Predicate(Like calling a function)
Predicate is the ADP assessment unit.Write the following.
predicate_name(
argment list)
Example
print("Hello World")
Term
Strings and numbers, variables and predicate are called term.
Goal cluase(Like a function body parts)
Goal cluase has terms separated by commas "," and terminated by a semicolon ";".
Goal clause is evaluated in the description of the order of source files by adp command.
Example
,print("Hello World");
You input the source file above to adp command, then the command 'Hello World' on the screen.
Horn clause(Like a function definition)
Horn clause has a horn head and a goal cluase. The horn head begins from a "+" charactor and has horn_clause_name and argment lists.
+
horn_clause_name(
argment list)
goal_cluase
Example
+horn_name($x,$y),print($x, '=', $y);
Comments
A comment begins from a '#' character and ends to the end of the line.
,printn("Hello World"); # Here is a comment.
Powered by ADP.