Template-Axiom-Query (TAQ)

TAQ Language Introduction

Unification of Structures

Template-Axiom-Query (TAQ) Language uses a query format to initiate execution of a program. This format uses structures to declare the problem a program needs to solve..The query takes information contained in structures and transforms it into a solution which is also consists of structures. Computation is performed using a process called unification which pairs two structures to determine if they are logically equivalent. Each step pairs an axiom to a template, and if taken to completion, produces a new axiom to pass to the solution.

Axiom

Am axiom contains information as a sequence of terms, with each term consisting of a name and a value. An axiom can represent externally sourced data, such as from a database row, or declared within the TAQ program. Here is an example of the declaration of an axiom list containing cities and their elevations in feet:

axiom list city_altitude()
{"bilene", 1718}
{"addis ababa", 8000}
{"denver", 5280}
{"flagstaff", 6970}
{"jacksonville", 8}
{"leadville", 10200}
{"madrid", 1305}
{"richmond",19}
{"spokane", 1909}
{"wichita", 1305}
Template

A template, like an axiom, has a sequence of terms but these terms are able to evaluate expressions for performing logical operations or generatiog values to place in a solution axiom. Here is a template named "high_city" declared with 2 terms the first of which tests for the condition a city has an elevation greater than 5,000 feet:

template high_city(city ? altitude > 5000, altitude)
Query and Solution

The following "high_cities" query determines which of the cities of the above declared axiom list are high cites:

query<axiom> high_cities (city_altitude : high_city)
high_city(name = addis ababa, altitude = 8000)
high_city(name = denver, altitude = 5280)
high_city(name = flagstaff, altitude = 6970)
high_city(name = leadville, altitude = 10200)

TAQ Reference Guide

This reference presents TAQ, one topic at time, to progressively introduce the features of the language. Each topic contains one or more example programs. A page is linked to each example which shows the TAQ file along with supporting documentation. All such links are also displayed on the right hand side of the Reference index. An example page link is identified by the name of the TAQ file. The high_cities link is high_cities.taq.

The TAQ project suite, which includes all the examples, is available from Github. The TAQ files have extension ".taq" and can be compiled and run from a terminal window using commands given in the example pages. Each command must be run from the root directory of the examples project. A dedicated application is also provided for each example so it can be run in a Java IDE such as IntelliJ IDEA.

TAQ Primer

Syntax highlighting helps with readability. Here is the color scheme.

ColorSyntax Highlighted
axiomkeywords
integertypes
"text";text strings
123numbers
// Citiescomments

A program will have at least one query but there may be more depending on what is being demonstrated. It is recommended to copy paste commands as given on example pages in order to avoid errors. Often the only required parameter is the name of the example TAQ file, but other other arguments may be required, such as the name of queries to exclude or a value to input into the query.

The early programs should be easy to follow as only a limited number of features are being demonstrated. Each query declaration determines which structures participate and in which order. Topic 11 on "Flow" marks a transition to perhaps more challenging material as procedural programming features are introduced. The notation is terse so one needs to pay attention to understand the code. .

TAQ has no keywords for execution flow control such as "if" or "else". The only clue is the humble question mark which indicates a possible change in the flow according to whether a condition tests true or false. The high_cities query show one way a question mark performs execution flow control:

city ? altitude > 5000