structured control for active tree tree pattern rewriting systems (tprs)
TRANSCRIPT
Structured Control for Active Tree
Tree Pattern Rewriting Systems
(TPRS)
MailOrder Example
Mail Order: Play.com example
MailOrder (similar to Luc, Serge, Victor): -Catalog of Product, -Order History of Customer (Including Cart).
Orders can be successively: in cart, ordered, processed, posted and received.
Mail Order: Play.com example
What we want to know: - Products and their price of an order- Number of days since a product has been posted
Mail Order: Play.com example
What we want to allow a customer to do (through services): - Customer can register or resilliate.- Customer can add and delete products from their cart- Customer can checkout an order.- Customer can cancel a non processed order- Customer can be refunded if product not delivered after 21 days
Mail Order: Play.com example
What we want to verify: - Can a canceled or refunded order be delivered?- Can the system run infinitely?- Can 2 runs with same services calls with same matching but in different order result in different trees ? (kind of confluence)
A TPRS rule
TPRS : The query
Rule Processing gives a bill for an order. Find all the products and their price with a TPQuery.
W2[Ordered]
w3[X]
W1[Play.com]
Name
Y
product
X
w4[Y]
PriceTPQ:
TPQL TPQR
TPRS : Evaluation of the query
Rule Processing gives a bill for an order. Find all the products and their price with a TPQuery.
W2[Ordered]
w3[X]
W1[Play.com]
w4[Y]Name
product
Price
X YLOTR £25
TPRS : Evaluation of the query
Rule Processing gives a bill for an order. Find all the products and their price with a TPQuery.
W2[Ordered]
w3[X]
W1[Play.com]
w4[Y]Name
product
Price
X Yskins £10
TPRS : result of the query
Rule Processing gives a bill for an order. Find all the products and their price with a TPQuery.
TPRS : the “processing” rule
Rule Processing gives a bill for an order. Find all the products and their price with a TPQuery. Find an ordered product and process it by appending the bill
W2[Ordered]
w3[X]
W1[root]
Name
Y
product
X
w4[Y]
Price
Applying a TPRS rule
TPRS : the “processing” rule
Semantics: 1) Find a customer with an order with status Ordered.2) Compute the result of query relative to this order3) Delete the ordered son and its subtree4) Add under the customer a node processed plus the bill with the products found by the query associated with this order (self)
W2[Ordered]
w3[X]
W1[root]
Name
Y
product
X
w4[Y]
Price
Mail Order: Play.com example
2) Compute result of TPQ with w2 = v10
1) Match left
Mail Order: Play.com example
1) Match left
2) Compute result of TPQ with w2 = v10
3) Delete node w2 = v10
Mail Order: Play.com example
4) Add a node Processed with a son Bill and the result of the query under it.
Other rules:
Other rules:
Decidability
Models
restrictions
Positive AXML
Guarded
AXML
TPRS
deletion No Yes Yes
Control cycles Yes No (Bounded number steps)
Yes
Inf alphabet No Yes No
Depth all bounded bounded*
Negative Pattern No Yes No
Property Basic TreePattern
LTL
Pattern
Reachab.
Complexity P-EXP 2EXP Non elem.
No cycles in control (or no deletion): cannot (add and delete) a product from cart.
Models
restrictions
Positive AXML
Guarded
AXML
TPRS
deletion No Yes Yes
Control cycles Yes No (Bounded number steps)
Yes
Inf alphabet No Yes No
Depth all bounded bounded*
Negative Pattern No Yes No
Property Basic TreePattern
LTL
Pattern
Reachab.
Complexity P-EXP 2EXP Non elem.No Inf alphabet: products in catalog are fixed, cannot relate bank account/customer, return messages, cannot have fine control (who is making the choice? Several peers. -> all non det.)
Models
restrictions
Positive AXML
Guarded
AXML
TPRS
deletion No Yes Yes
Control cycles Yes No (Bounded number steps)
Yes
Inf alphabet No Yes No
Depth all bounded bounded*
Negative Pattern No Yes No
Property Basic TreePattern
LTL
Pattern
Reachab.
Complexity P-EXP 2EXP Non elem.Depth: not important for MailOrder exampleCan have unbounded depth with TPRS if use only ancestor orderAnd not parent/son (use Kruskall Theorem)
Models
restrictions
Positive AXML
Guarded
AXML
TPRS
deletion No Yes Yes
Control cycles Yes No (Bounded number steps)
Yes
Inf alphabet No Yes No
Depth all bounded bounded*
Negative Pattern No Yes No
Property Basic TreePattern
LTL
Pattern
Reachab.
Complexity P-EXP 2EXP Non elem.
Negative Pattern: useful for optimization (a rule disabled if another rule with higher priority is allowed)
Conclusion:
No current solution is good enough!(Still both are useful to understand what we can and cannot do).
We should at least have: - Infinite Alphabet - Unbounded controlTo model precisely a REAL system.
Main Tool For TPRS
the following < is a well quasi order:A< B if A can be injectively send on B (son/label preserved). Equivalently, A is obtained from B by deleting subtrees.Then, in any infinite sequence, there exists u_i > u_j with i>j
In particular, finite number of minimal events in a forest.
WSTS for well quasi order <
If X Y and X ->* X’ thenY’ with X’ Y’ and Y ->* Y’
X < Y
X’ < Y’That’s why we cannot test negative pattern
Idea: Unbounded control + Infinite Alphabet?
the following < is a well quasi order:The minor order in graphs.
Equivalence class
Infinite alphabet: can be seen as equivalence class
x y z
Bankaccount
customer
The obtained structure is a graph (actually 2 tree structures mixed): Apply Minor Th.
Lower Bound
Simulate deterministic Turing machine:
Hard to encode the tape of the machine:
We should keep some unbounded linear order.But no order between brothers, no infinite depthor infinite depth but no linear order…
If we can count accurately to N, increment, decrement, copythen we can simulate a machine of space(N).
Simulate deterministic Turing machine:
b
2
M
1
b,qa
30
a
Simulation du ruban abqba
run
Simulate deterministic Turing machine:
b
2
M
1
b,qa
30
a
Pas q,b -> a, droite: b,q
Y
M
X
Z a
Y
M
X
Z,qCheck-suc
YX
21
run
run
Simulate deterministic Turing machine:
b
2
M
1
aa
30
a,q’ run
We have obtained the successor state!If wrong guess of « Y = X+1 » then deadlock.We reach halt in the new systm iff we reach halt in the first system.
How high can we count?
Representation of 13 = 8+4+1
First bit last bit
First bit last bit
We can do a tower of exponential! Non elementary complexity.