The Tau meta language (TML) bot (mr_tau) can be seen as the first go-to application to experience TML in its current form.
This tutorial shall serve anyone interested in getting first hand TML experience as an easy-to-use guide to interact with the TML bot. This is thought to be a living document being continuously updated as TML, mr_tau and our knowledge around them also is continuously evolving.
To communicate with mr_tau (which is the name of the bot), you first need to know where to find it. There are two places you can go to, to find and interact with the TML bot:
- Telegram: You can join the IDNI Dev Chat. This chat has a bridge to the IRC channel where the bot resides. So you can directly communicate with him from here by writing:
*/query mr_tau .help*
This starts a direct conversation with mr_tau asking him for help. From here on,
you can play around with him.
As mr_tau prefers to communicate in TML, it is recommended to have a basic understanding of how TML works. You can find an introduction into TML here.
To speak out commands to mr_tau, you have to put a dot (.) in front of the command. If
you don’t put a dot in front of your text, mr_tau understands it as TML.
Command '.help.' shows a basic usage of the bot.
This is usually the first command to interact with mr_tau.
mr_tau then will provide you with information about how you can communicate
# Each user can create slots and switch between them. Each slot has its own pair of a data database and a program database.
# Data database contains only facts which are updated by executing TML code.
# Program database contains rules. Use '+RULE' or '-RULE' to add/remove rule to/from a program database.
# Use ':SLOT' to switch to another slot. Initial slot is called 'default'.
# REPL commands are prefixed by a comma '.'. Use command '.list.' to get list of commands. Use '.help(COMMAND).' to get help for a command.
This command serves to obtain a complete list of commands and input prefixes
available to communicate with mr_tau.It will answer:
# Commands: help, list, killall, clear, add, del, db, rules, try, run, slot, listslots, deleteslot, select, unselect, enable, disable, load, intersect, version. Use '.help(COMMAND).' to get help for the COMMAND.
# Input prefixes: . (REPL), + and - (add/del rule), : (selecting slot), / (deleting # Input prefixes: . (REPL), + and - (add/del rule), : (selecting slot), / (deleting get help for the PREFIX.
You can also write mrtau:_
*.list(relation REL SLOT).*
to display relation REL from slot SLOT. Current slot is used if SLOT omitted.
This command is used to instantly kill all running TML processes. mr_tau will
# killing all TML processes
Entering this command will clear both your data and program database. mr_tau:
# Db cleared
If you wish to only clear your data database use '.clear(db)'
and if you only wish to clear your program database use '.clear(rules)'.
Command '.add(rule RULE).' adds new rule
or use '+RULE.' as a shortcut.
For an explanation of what a rule is, please refer to section 2.1.8 .Rules.
Command '.del(rule RULE).' deletes the RULE
or use '-RULE.' as a shortcut.
Command '.db.' or “.db(SLOT).” displays facts contained in the data database of
the SLOT (current slot is listed if omitted).
If your database is empty, mr_tau will answer:
## Listing database:
## Database is empty
A rule is anything containing “:-”. To a large degree, one can interpret “:-” as
*a(mammal ?x) :- a(cat ?x)
This rule states: “If x is a cat, then x is a mammal”.*
Command '.rules.' or '.rules(SLOT).' displays the list of rules (program
database) of the SLOT (current slot is listed if omitted).
Command '.try.' or '.try(PROGRAM).' runs data and program databases (with
PROGRAM if provided), displays result and does not update database.
Command '.run.' or '.run(PROGRAM).' does the same as 'try' but 'run'
updates the data database if try was satisfied and no error happened
Command '.slot.' shows current database slot.
A slot can contain both facts and rules.
Command '.listslots.' or '.listslots(USER). shows list of a user's slot.
Command '.delete_slot(SLOT).' deletes the SLOT. Only user's own slots
which aren't currently selected can be deleted. Use '/SLOT' as a shortcut.
Command '.select(OPTION VALUE)' store a value by option. Only option
'slot' is currently support.
So you can use the “.select” command to switch in between your slots. Alternatively, you could also write “:slot_name” to switch the slot. Example:
Lets you switch from your current slot into the slot with the name “bigslot”.
used with a value ('.unselect(OPTION VALUE)') option is cleared only if the
VALUE argument matches the value currently set. Example:
.unselect (slot bigslot)
## Unselected slot : bigslot
Command '.enable(OPTION)' enables option. Run '.help(options)' to see list
Running ‘.help(options)’ provides you with all available options to enable/disable:
Enable 'auto_print' to automatically print the database after each run.
Enable 'print_steps' to print steps.
Enable 'auto_updates' to print updates from rules.
Command '.disable(OPTION)' disables option. Run '.help(options)' to see list of options.
Command '.load(SLOT).' to load facts from another SLOT (SLOT can be slot, [email protected] or @user). Use '<SLOT' as a shortcut.
Intersecting is a core part of detecting consensus in between slots and users. By intersecting between two slots, mr_tau will check for an overlap of consensus and answer it to you.
Command '.intersect(SLOT).' to result into intersection of current and another SLOT (SLOT can be slot, [email protected] or @user). Use '?SLOT' as a shortcut.
Note: When looking to intersect with a slot of another user, you have to add quotation marks like here:
In this example, we create the slot “i1”, then add “a.b.” facts. Then, we create the slot “r”, load content of slot “i1” and then intersect it with slot “i2”:
Mrtau: # Selected slot : i1
Mrtau: # elapsed: 0.25 ms
Mrtau: # Total elapsed: 28 ms user: 0.00 s system: 0.00 s memory: 4008 Kb
Mrtau: # step: 0
Mrtau: # Selected slot : i2
Mrtau: # elapsed: 0.14 ms
Mrtau: # Total elapsed: 15 ms user: 0.00 s system: 0.00 s memory: 4028 Kb
Mrtau: # step: 0
Mrtau: # Selected slot : r
Mrtau: # Loading data: i1
Mrtau: # elapsed: 0.44 ms
Mrtau: # Total elapsed: 30 ms user: 0.00 s system: 0.00 s memory: 4076 Kb
Mrtau: # step: 0
Mrtau: # Intersecting: i2
Mrtau: # step: 0
Command '.version.' displays version (commit) of TML used by bot.
Use this command to get explanatory information on any of the available commands. This document already contains the help information for all commands.
mr_tau manages a database for each user. You can add facts to your database by entering it in the following format:
Usually, ‘RELATION NAME’ is being replaced with a verb but it can be anything. Imagine you are creating a table with ‘RELATION NAME’ being the table’s name. Inside the table is the relation.