Expression Pattern Language (eXPL)

eXPL Logic Chain Query

A logic chain query, is joined to a query to contribute more information based on solution found so far. Query chaining is applied at the stage when a solution has been found and only more details are required. Here is an example where two logic chain queries add payment and freight charges to customer account details:

axiom customer()
{"Marathon Marble", "Sparta"}
{"Acropolis Construction", "Athens"}
{"Agora Imports", "Sparta"}
{"Spiros Theodolites", "Milos"};

axiom fee (name, fee)
{"Marathon Marble", 61}
{"Acropolis Construction", 47}
{"Agora Imports", 49}
{"Spiros Theodolites", 57};

axiom freight (city, freight)
{"Athens", 5 }
{"Sparta", 16 }
{"Milos", 22};

template customer(name, city);
template account(name ? customer.name == name, fee);
template delivery(city ? customer.city == city, freight);

query greek_business(customer:customer)
>> (fee:account) >> (freight:delivery);

You can see that ">>" signifies query chaining and each logic chain query is specified with an axiom and template pair combination.

The tutorial8 GreekConstruction3 code example runs this query. The console output when the query is run is:

account(name = Marathon Marble, fee = 61)
delivery(city = Sparta, freight = 16)
account(name = Acropolis Construction, fee = 47)
delivery(city = Athens, freight = 5)
account(name = Agora Imports, fee = 49)
delivery(city = Sparta, freight = 16)
account(name = Spiros Theodolites, fee = 57)
delivery(city = Milos, freight = 22)