PRODUCTOS OBTENIDOS
PRODUCTO Y CUANTIFICACIÓN DE LAS MUESTRAS
Choice. LetA andBbe expression vectors, both for the same shapeS, but with disjoint domains, DompAq XDompBq “ H. The conditional choice,AelseBis an expression vector forSdefined as follows: for each patchpv,mqofS,
pAelseBqv,m“Av,melseBv,m. (5.3.1) Each component expressionpAelseBqv,m is consistent because the sub-expressions have disjoint domains.
Proposition 5.8. IfL,L1
Ď Σ˚ are disjoint sets of paths starting from the same stateq such that all stringswPLYL1have the same shapeS, and are summarized by the expression vectors AandA1respectively, thenAelseA1 summarizes all paths inLYL1.
IfA1,A2, . . . is a family of expression vectors with pairwise-disjoint domains, then we write řAj for their combination using the else combinator (
ř
Aj “ bot if the family of component expression vectors is empty).
Shifting domains. Given a DReX expressioneand a regular expressionr, we write shiftpe,rq
for the “left-shifted” expression which splits the input streamwintow“w1¨w2, such that
the suffixw2matchesr, and applieseto the prefixw1:
shiftpe,rq “
#
splitpe,rÞÑq ifJrK‰ H, and
bot otherwise.
The expression is consistent ifeis consistent, ris unambiguous, and Dompeq andJrKare
unambiguously concatenable. Similarly, the “right-shifted” expression shiftpr,eqis defined as:
shiftpr,eq “
#
splitprÞÑ,eq if Dompeq ‰ H, and bot otherwise.
These “expression-level” operations, shiftpe,rq and shiftpr,eq can be naturally lifted to entire expression vectors shiftpA,rqand shiftpr,Aq:
shiftpA,rqv,m“shiftpAv,m,rq, and shiftpr,Aqv,m“shiftpr,Av,mq.
Concatenation. Pick three statesq,q1,q2
in the given SST, and letLbe a set of strings fromqtoq1with shapeS, andL1 be a set of strings fromq1 toq2 with shapeS1. Then strings
wPL¨L1
transition fromqtoq2 and have shapeS¨S1
. Say the expression vectorsA and A1
summarize all paths inLandL1 respectively. We will now construct an expression vector A¨A1
which summarizes all paths inL¨L1 .
The idea is to left-shift the component expressions in A by DompA1
q, right-shift the component expressions inA1 by DompAq and appropriately combine the results.We first demonstrate the construction with an example.
Example 5.9. As before, we are referring to the SSTM2 from figure 3.2. Consider the set of stringsL“Ja
˚
Kwhich loop in the stateq2, and the set of stringsL
1
“Jb¨b¨b
˚
Kwhich
transition from q2 toq3. The shape of strings w P L is the identity function S “ tx ÞÑ x,yÞÑ y,zÞÑzu, and the shape of stringsw1 PL1
is S1 “ txÞÑ x¨y¨z,yÞÑ,zÞÑu. We have already constructed the expression vectorAwhich summarizesLin example 5.6. The following expression vectorA1 summarizes strings inL1:
Now pick a stringw¨w1
such thatwPLandw1
PL1
and consider the run ofM2starting from the stateq2. After processingw, the register valuesx1,y1andz1 are given by:
x1 “x¨JiterpaÞÑaqKpwq “x¨JshiftpiterpaÞÑaq,b¨b¨b ˚ qKpw¨w 1 q, y1 “y, and z1 “z¨JiterpaÞÑbqKpwq “z¨JshiftpiterpaÞÑbq,b¨b¨b ˚ qKpw¨w 1 q.
After processingw1, the register valuesx2,y2, andz2 are given by:
x2 “sx1sy1sz1s, y2 “s, and z2 “s, where s“Jb¨b¨b ˚ ÞÑKpw1q “Jshiftpa ˚,b ¨b¨b˚ ÞÑqKpw¨w 1 q.
The combined expression vectorA¨A1
, defined as
pA¨A1qx,1 “ pA¨A1qx,3“ pA¨A1qy,1“ pA¨A1qz,1“shiftpa˚,b¨b¨b˚ ÞÑq,
pA¨A1qx,2 “combinepshiftpiterpaÞÑaq,b¨b¨b˚q,shiftpa˚,b¨b¨b˚ÞÑqq, and pA¨A1qx,4 “combinepshiftpiterpaÞÑbq,b¨b¨b˚q,shiftpa˚,b¨b¨b˚ ÞÑqq
summarizes all stringsw¨w1
PL¨L1
. 4
We will now define the concatenation operationA¨A1
for arbitrary expression vectorsA andA1. As a first step, we define “shifted” expression vectors:
As“shiftpA,DompA1
qq, and A1s“shiftpDompAq,A1q. Pick a registervand let
v:“e1v1e2v2¨ ¨ ¨v1
lel1`1
be the update expression forvinA1s. For each registervmin the right-hand side, let
vm:“em,1vm,1em,2vm,2¨ ¨ ¨vm,lem,l`1
be the update expression inAs. View string concatenation as the expression combinator “combine”, and substitute the expression for eachvminAsinto the expression forvinA1s.
DefinepA¨A1
qv,mas them-th expression in the string that results. The component expressions
are consistent because DompAsq “DompA1
sq.
Proposition 5.10. For all statesq,q1 andq2, for every pair of statesS,S1, if the expression vectorsA andA1 summarize pathsL
Ď tw P Σ˚
| q Ñw q1,S
w “ Su andL1 Ď tw P Σ˚ |
q1
Ñw q2,S
w “ S1u respectively, then the expression vector A ¨A1 summarizes all strings