Page 1
Lehr?undForschungseinheitf?ur
Programmier?und Modellierungssprac hen
Oettingenstra?e???D??????M?unchen
Con?uenceandSemanticsof
ConstraintSimpli?cationRules
SlimAbdennadher?ThomFr?uhwirth?HolgerMeuss
Toapp earinConstraintsJournal????
h ttp???www?pms?informatik?uni?muenchen?de?publikationen
Forschungsbericht?ResearchReportPMS?FB?????????Mai????
Page 2
fSlim?Abdennadher?Thom?Fruehwirthg?informatik?uni?muenchen?de
meuss?cis?uni?muenchen?de
http???www?pst?informatik?uni?muenchen?de?personen?fruehwir?cwg?html
?Received ?????? Accepted in?nalform??????
Abstract?
ConstraintSimpli?cationRules?CSR?isasubsetoftheConstraintHandlingRules?CHR?
language?CHR isapow erful special?purp osedeclarative programming languageforwriting
constraint solv ers? The CSR subsetof CHR forms essen tiallya committed?c hoice language
consistingofguardedruleswithmultipleheadsthatreplaceconstraintsbysimpler ones
untiltheyaresolv ed?This paper gives declarativeand operationalsemanticsaswell as
soundnessandcompletenessresultsforCSRprograms?
Inthispap er?we introduceanotionofcon?uence forCSRprograms?Con?uenceisan
essentialsyntacticalproperty ofanyconstraintsolver? Itensuresthatthe solverwill always
computethesameresultfora giv ensetofconstrain tsindependent ofwhichrulesare
applied?It alsomeans thatit do esnotmatterfortheresultinwhichorder theconstraints
arrive attheconstraintsolver?
Wegiveadecidable? su?cientandnecessarysyn tacticconditionforcon?uenceoftermi?
natingCSRprograms?Moreover?as shown inthis paper? con?uence ofaprogram implies
consistency ofitslogicalmeaning?under a mildrestriction??
Keyw ords? constraint reasoning?seman ticsofprogramminglanguages?committed?c hoice
languages? con?uence?determinism? programanalysis?
?? Intro duction
Constrain t?basedprogramminglanguages?beitconstraintlogicprogram?
ming?CLP??JL???Mah???vH???FHK
?
???JM???orcommitted?choicecon?
currentconstraintlogic?C
?
L?programming
?
?Mah???Sha???SRP???Sar???
JM????enjoybotheleganttheoreticalpropertiesandpracticalsuccess?As
itruns?aconstraint?basedprogramsuccessivelygeneratespiecesofpartial
informationcalledconstraints?Theconstraintsolverhasthetasktocollect?
combine?andsimplifytheconstraints?anddetecttheirinconsistency?Intui?
tively?constraintsrepresentelementaryrelationshipsbetweenvariablesand
values?forexampleequalityorsomeorderrelationships?Clearly?theabilities
andqualityoftheconstraintsolv erplayanessentialroleinconstraint?based
programming?
?
Thereisnoconsistentterminologyintheliteratureforthisclassofprogramming
languages?Youmaydrop?logic?andeither?committed?choice?or?concurrent??
Page 3
one lessonlearned frompracticalapplications is thatconstrain tsareoften
heterogeneousand applicationspeci?c?
Sev eralprop osals havebeenmade toallow more?exibility andcustomizati?
on ofconstraintsolvers?oftentermed?glass?bo x?approac hes?CD???vH????
The mostfar?reaching proposal isthe ?no?box? approach?ConstraintHand?
lingRules?CHR? ?Fr?u??? isa high?level languageforwritingconstraintsol?
verseitherfromscratch orbymo difyingexisting solv ers?TheCSR?Cons?
traintSimpli?cation Rules?subset ofCHR is essentiallyaC
?
Llanguage
consisting ofguarded rules withmultipleheadsthat replace?conjunctions
of?constraintsbysimpler ones untilthey aresolved? Withsingle?headed
CSR rulesalone?unsatis?ability ofconstrain tscould not alwa ysbe detected
?e?g? X?Y?Y?X??
Incon trasttot ypical general?purp oseC
?
Llanguages? CSRprograms canbe
giv enadeclarativeseman ticssincethey are onlyconcerned withde?ning
constraints?i?e??rst?orderpredicates??not procedures in theirgenerality?
Wegivesoundnessandcompletenessresults foraclassof CSRprograms?
There areC
?
Llanguagesthat sharetheir seman ticswith CSR?TheGuar ded
Rules?Smo??? correspond tosingleheaded CSR? How ever? they areonly
usedas?shortcuts??lemmata? forpredicates? notasde?nitions for user?
written constraints?Interestingly?in ?Smo???thebuilt?inconstraint system
isde?nedasaterminating and determinatereductionsystem?Hence itcould
beimplemen tedbyCSR?
Also?AKP???reliesonakind ofguardedrules?emphasizing theiruseasa
programming languageon itsown? ?AKP???shows thatguarded rulepro?
gramscanbe giv enalogicalmeaningthatisaconsistent theory?provided
thattheguardssatisfyalogicalconditioncalledcompatibilityandakindof
closed?worldassumption?SinceCSRallowsmultipleheads?itcannothave
suchaclosed?worldassumption?
Typically?morethanoneCSRruleisapplicabletoaconjunctionofcons?
traints?Itisobviouslydesirablethattheresultofacomputationinasolver
willalwaysbethesame?semanticallyandsyntactically?nomatterwhichof
theapplicableCSRrulesisapplied?Thisessentialpropertyofanyconstraint
solverwillbecalledcon?uence?Withoutcon?uence?onecomputationmay
detectinconsistencywhileanothermightjustsimplifythesameconstraints
intoamorecomplexconstraint?Con?uencealsoimpliesthatitdoesnot
matterinwhichordertheconstraintsarriveattheconstraintsolver?
paper?tex??????????????????nov??p??
Page 4
X??A??B?X??C??D ??? true?maximum?A?C?E??minimum?B?D?F??
X??E??F?
The?rst CSRrulereads? Ifthe guard A?Bholds then replacetheconstraint
X??A??Bbythe constraintfalse exhibiting itsinconsistency? The program
consisting ofthesetworules iscon?uen t?Adding theseeminglyharmless rule
thathandlesavariablewhosevalue isuniquelydeterminedby itsin terval?
X??A??A ??? true?X
?
?A?
resultsinaprogramthat isnotcon?uent anymore? Theconstrain ts X???????
X??????canbe simpli?edtoX??????by thesecondrule? Thisconstraint in
turnsimpli?es tofalsewith the?rstrule? so thattheinconsistency of the
initial constrain tsisexhibited? On theother hand?applyingthenewly added
ruleto the ?rstconstraint leadstoX
?
???X??????? No moresimpli?cation
ispossible? theinconsistency is leftimplicit?
We will introduceadecidable?su?cient andnecessary syntacticconditionfor
con?uenceof terminating CSRprograms? Thiscondition adopts thenotion of
criticalpairsaskno wnfrom termrewritingsystems ?DOS???KK???Pla????
A straigh tforwardtranslation oftheresults inthis?eldw asnotpossible?
b ecausethe CSRformalism gives risetophenomenanot appearing inthis
combination inresearch on con?uencein termrewriting systems?These
includetheway inwhichvariables canoccur inaruleand theexistence
of global knowledge? CSRprograms aremorepowerfulthan theclassical
conditionalrewriting?becausetheyuse anadditional contextwhich isthe
built?in constraint store?
Apracticalapplication of our de?nition ofcon?uencelies inprogramanaly?
sis?wherewecaniden tifynon?con?uent parts ofCSRprogramsbyexamining
theso?calledcritical pairsb etw eenrules?Programswithnon?con?uent parts
arelik elytorepresent anill?de?nedconstraintsolver?Thatadecidablecon?
?uencetest existsisaclearadv antageof CSRov erblac k?boxapproaches?
Since our testforcon?uence isdecidableforterminatingprograms? itcan
alsobeusedtoidentify thepartsofarbitraryterminatingC
?
Lprograms
that haveadeclarativeseman tics in oursense?
Onthetheoreticalsidewe alsoshowthatcon?uenceimpliesconsistencyof
thelogicalmeaning ofaCSRprogram?underamildrestriction??Further?
morewe can improve oncompleteness? ifaCSRprogram iscon?uent?and
terminating??
paper?tex??????????????????no v??p??
Page 5
This pap er isorganized asfollo ws? Thenextsection in tro ducesthesyn tax
ofConstraintSimpli?cation Rules ?CSR??theirdeclarative and operational
seman tics? Thenwe relatethedeclarative and operational semantics of CSR
programsby giving soundnessandcompletenessresults? Section?presents
ournotionofcon?uence forCSR? Insection?we show thatcon?uence
impliesconsistency of thelogicalmeaning ofaprogram? In section?we
show how con?uence leads toa strongcompleteness resultfor?nite failure?
Finally?weconclude witha summary anddirections for futurew ork? The
app endixcon tainsthe main proofs?which are quitelong?A preliminaryshort
v ersionofthispap erw aspresen tedatCP????AFM????
??Syn tax and Semantics
In thissectionwe givesyn tax and semantics asw ellassoundness and
completeness resultsforConstraintSimpli?cation Rules ?CSR??Weassume
somefamiliarity withC
?
Lprogramming ?JL???JM??? SRP???Sar??? Sha????
Constrain tsareconsidered tobe sp ecial?rst?orderpredicates?We willdistin?
guishb etw eentwo classes of constraints?Built?inconstrain ts arethosehand?
ledby analreadyexisting?prede?nedconstraint solver?User?de?nedcons?
train tsare thosede?nedbya CSRprogram?
De?nition????A CSRpro gr am isa?nite set ofconstraintsimpli?cation
rules?A ?constraint?simpli?c ation ruleis oftheform
H
?
?????H
i
?G
?
?????G
j
jB
?
?????B
k
?i???j???k? ???
where the headH
?
?????H
i
isanon?emptyconjunction
?
ofuser?de?nedcons?
train ts? theguard
?
G
?
?????G
j
isaconjunction ofbuilt?inconstrain ts andthe
bodyB
?
?????B
k
isaconjunction ofbuilt?in anduser?de?ned constraints?
Conjunctions ofbuilt?inanduser?de?nedconstrain ts arecalled go als?
Without lossofgeneralitywe assumethe rules ofthe CSR programin que?
stionto havedisjoint sets ofvariables? Inexampleswe maydisregardthis
agreement for ease ofreading?
?
F orconjunction in ruleswe usethesymb ol???instead of????
?
Thecommit symb ol?j?shouldnotbeconfusedasstandingfordisjunction as in
grammarformalismsandsomePrologdialects?
paper?tex??????????????????nov??p??
Page 6
alsob eenprop osed for guardedrules?AKP??? Smo????
Thedeclarative seman tics ofa CSRprogramP is givenbyaconjuncti?
onof universally quan ti?edlogical formulae?one foreachrule??P? anda
consistentbuilt?in theoryCT which determines themeaning ofthe built?in
constraints appearing in theprogram? Theconstraint theoryCT is expec?
tedto includeaconstraint
?
? for syntacticequality ?e?g?by Clark?sequality
theory CET ?Cla????andtheconstrain ts trueand false?
De?nition???? Thelogical meaning ofa simpli?cation ruleisa logical equi?
v alencepro videdthe guardholds
??x??y ??G
?
?????G
j
????H
?
?????H
n
???z?B
?
?????B
k
???
where?x is thesequenceofv ariableso ccuring inH
?
?????H
n
and?y arethe
othervariableso ccuringinG
?
?????G
j
and?z arethev ariableso ccuring in
B
?
?????B
k
only?
Example ???? Now letusextenda giv enconstraint solver fortheconstrain ts
? and
?
? withaconstraintmaximum?X?Y?Z?which holds? ifZ isthe maximum
ofX andY? Thefollo wingrulescouldbe partofthe CSRprogram?
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Z
?
?X?
The ?rstrulestates thatmaximum?X?Y?Z? canbereplacedbyZ
?
?Ypro vided
itholds thatX?Y?
Nowassume thereisat ypo inthebo dy ofthesecondrule?
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Y
?
?X?
Thelogicalmeaning ofthis CSRprogram is thetheory
?X?Y?Z ?X?Y??maximum?X?Y?Z??Z
?
?Y??
? X?Y?Z ?Y?X??maximum?X?Y?Z??Y
?
? X??
togetherwith anappropriateconstraint theorydescribing? as an order
relation?ThelogicalmeaningP of thisprogram isnotaconsistent theory?
This canbeexempli?edby the atomicform ula maximum????? ???which is
logicallyequivalentto?
?
???andthereforefalse?using the?rst formula? Using
the second formula? howev ermaxim um????? ??is logicallyequivalent to?
?
??
?andthereforetrue??
paper?tex??????????????????nov??p??
Page 7
seman ticssimple?we require from now on thatthoseguardconstrain tscon?
tainingv ariableswhich do app ear in thebo dybutnot in the headhave to
app ear inthebo dyagain? Thisis noreal restriction?sincea generalrule can
betranslated in toa restricted ruleby simplyrep eating theguardconstrain ts
in thebo dy?
Example????A CSR ruleoftheform p?X??Y???X?Ym ustbe
translatedtop?X??Y???X? Y?Y???
??????
?
States
al?
De?nition ????A stateisa tuple
hGs?C
U
?C
B
?Vi?
Gsisaconjunction ofuser?de?ned andbuilt?inconstrain tscalled go alstore?
C
U
isaconjunction ofuser?de?nedconstraints? likewiseC
B
isa conjunction
ofbuilt?in constrain ts?C
U
andC
B
are calleduser?de?ned and built?in ?c ons?
traint? stor es? respectiv ely?V isasequence ofvariables? Anempty goalor
user?de?ned store isrepresentedby?? Thebuilt?in store cannotbe empty?
Initsmost simpleform itconsists onlyoftrue or false?
In tuitively? Gscontains theconstrain tsthat remaintobe solv ed?C
B
andC
U
are thebuilt?inand the user?de?nedconstrain ts? respectively? accumulated
andsimpli?ed so far?
De?nition????Av ariableX app earingina statehGs?C
U
?C
B
?Vi is called
?glob al? ifXapp ears inV?
loc ifX does notapp ear inV?
?strictlyloc al?ifX appears inC
B
only?
De?nition???? Thelogic al meaning ofastateh Gs?C
U
?C
B
?Vi is theform ula
??y Gs?C
U
?C
B
?
where?y arethe localvariables of thestate?Note thattheglobalv ariables
remain freein theformula?
paper?tex? ????????????????? no v??p??
Page 8
tative state? Thenormalizationfunctionnormalizes thebuilt?in constraint
store? projects outstrictly localvariables? andpropagates impliedequations
allov er thestate? Mostbuilt?inconstraint solv ers naturallysupport this
functionality since theyw ork withnormalized forms an yway?F orthe follo?
wing theoremsand pro ofsit isimp ortant to make the requirements onthe
normalizationfunction moreprecise?
De?nition ????A functionN?S?S? whereS is the setof allstates? isa
normalization function? if it ful?llsthefollo wingconditions? Let
N?h Gs?C
U
?C
B
?Vi??hGs
?
?C
?
U
?C
?
B
?Vi?We assume that thereisa ?xed
orderonvariables appearing ina statesuc h thatglobalvariables are orde?
red as inV and precedeall lo calvariables?
? Equalitypr opagation? Gs
?
andC
?
U
derive fromGs andC
U
by replacing
allvariablesX? thatareuniquelydetermined inC
B
?JM????i?e? forwhich
CTj???C
B
?X
?
?t?
?
holds?by the corresponding termt? except ift
isav ariable thatcomesafterX inthev ariableorder?
? Pr ojection?Thefollo wingm ust hold?
CTj?? ???? xC
B
??C
?
B
??
where?x are thestrictly localvariables ofhGs
?
?C
?
U
?C
B
?Vi?
?Uniqueness? If
N?h Gs
?
?C
U?
?C
B?
?Vi??h Gs
?
?
?C
?
U?
?C
?
B?
?Vi and
N?h Gs
?
?C
U?
?C
B?
?Vi??h Gs
?
?
?C
?
U?
?C
?
B?
?Vi and
CTj????xC
B?
?????yC
B?
??
holds? where?x and?y? respectiv ely? arethestrictly localv ariables of the
twostates?then?
C
?
B?
?C
?
B?
?
Thesyntactical form ofthe result ofnormalization do es notmatter?as long
asthe threeconditions? above alluniqueness? hold?Animp ortantproperty
ofNisthatitpreservesthelogicalmeaningofstates?
?
?Fistheuniversalclosureofaform ulaF?likewiseis?FtheexistentialclosureofF?
paper?tex???????????? ?????? no v??p??
Page 9
holdsfunction do
?
UB
UB
where?x and?x
?
are thelo calvariables inS andS
?
? respectiv ely?
Pro of? Theclaim follo ws fromthefollo wing threeassertions?
?x
?
??x ???
CTj???C
B
? ??Gs?C
U
???Gs
?
?C
?
U
??? ???
CTj?????yC
B
?C
?
B
? and?y?? x? ???
where?y are thestrictly localv ariables inh Gs
?
?C
?
U
?C
B
?Vi? Assertion???
b ecausethenormalizationN esnot in tro ducenewv aria?
bles dueto the projection prop erty? ??? holds?b ecauseCT con tainsequality
andGs
?
?C
U
derive from Gs
B
?C
U
bysubstitutionsprescrib edbyC
B
? ???
follo ws fromtheuniqueness prop erty ofN???y are thestrictly lo calvariables
inh Gs
?
?C
?
U
?C
B
?Vi ?? Theclaimthendirectly follo wsfrom theassertions ????
??? and?????
The
?
uniqueness property ofN guaranteesthat there is exactlyonerepresen?
tation foreach setofequiv alent built?inconstraint stores?Thereforewe can
assumethat aninconsistent built?instore isrepresen tedby theconstraint
false and likewiseav alidbuilt?instoreby true?
A property ofN is that itwill eliminateallstrictly localvariables?
Example???? Let
N?hp?Z????X
?
?Z??X?i??hp?X????C
B
??X?i?
BecauseCTj????Z?X
?
?Z?? true?? the uniquenessconditionimpliesthe
follo wing?
N?hp?X???? true??X?i??hp?X????C
B
??X?i?
Thereforewe know thatCm ustbetrue?b ecauseN cannot introducenew
v ariables?
De?nition ???? Thepair?C
?
?C
?
??C
?
andC
?
areconjunctions of constraints?
iscalledc onne cted inthesequenceV i?allvariables that appear inC
?
and
C alsoappearinV?
paper?tex?????????????????? no v??p??
Page 10
U
of
U
P
This claim isprov enby analyzingthe strictlylo calv ariables of the states?
Theconnectednessrequirement in thelemma above re?ects thesensitivity of
N tostrictly localvariables? It guaran teesthatequality constrain ts inv olving
v ariables appearing inthe added constraintC arenotremov edbyN due to
locality?
??????Computation Steps
The aimof thecomputation is toincremen tally reducearbitrary states to
statesthat con tainno moregoalsin thegoalstore andamaximally simpli?ed
user?de?ned constraint store ?withregard toa giv enprogramP ?? Giv ena
CSRprogramPwe de?nethetransition relation ??
P
?
by in tro ducingthree
kinds ofcomputation steps?Figure ???
Transitions
Solve
C
ts
isa built?in
?
constrain
?c?s
t
?
hC? Gs?C?C
B
?Vi ??N?hGs?C?C?C
B
?Vi?
In troduce
C isa user?de?nedconstraint
hC? Gs?C
U
?C
B
?Vi ??N?hGs?C?C
U
?C
B
?Vi?
Simplify
?H?GjB? isa freshv ariant ofarule inP withthevariables?x
CTj???C
B
???x?H
?
?H
?
?G??
h Gs?H
?
?C
U
?C
B
?Vi ??N?hGs?B?C
U
?H
?
?H
?
?C
B
?Vi?
Figure??Computation Steps
Notation?Capitalletters denoteconjunctions ofconstrain ts?By equating
two constrain?c?t
?
????t
n
?
?
?
????s
n
???wemeant
?
?
?s
?
?????t
n
?
?s
n
? By
?
In therest thepap er?we willdrop forsimplicity?
paper?tex?????????????????? nov?? p??
Page 11
de?nedconstraint store?To Simplifyuser?de?nedconstrain tsH means
toreplace themby thebo dyB ofa freshvariant
?
ofasimpli?cation rule
?H?GjB? fromthe program?providedH
?
matc hes
?
theheadH andthe
resulting guardG isimpliedby the built?inconstraint store? and ?nallyto
normalize the resulting state?
De?nition ???? An initial stateforagoalG isof theform?
hG??? true?Vi?
whereV is thesequence ofthevariableso ccuringinG?
A ?nal state is eitherof theform
hG?C
U
? false?Vi?
?sucha stateis calledfailed??or of theform
h??C
U
?C
B
?Vi
withnocomputation stepp ossible anymoreandC
B
not false?sucha state
is called successful??
De?nition ????Acomputation ofa goalG isa sequenceS
?
?S
?
???? of states
withS
i
??S
i??
b eginningwiththeinitialstate forG and endingina ?nal
state ordiverging?Acomputation is ?nitelyfailed? if itis ?niteand its?nal
state isfailed?
Example ???? Rememb er thecorrect rules for maximum?
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Z
?
?X?
Acomputation of thegoalmaximum?????Z?pro ceeds asfollo ws?using the
?rstrule??
?
Twoexpressions arev ariants? if theycanbe obtained from each otherbyav ariable
renaming?A freshvariant containsonly newvariables?
?
Matc hingrather thanuni?cation is the e?ectoftheexisten tialquanti?cationov er the
headequalities?
paper?tex?????????? ?? ?????? nov?? p???
Page 12
???Solve?N?h????M????M?i??
h????M
?
????M?i
Lemma ????Normalization has noin?uence onapplication of rules?i?e?
S ??S
?
holds i?N?S? ??S
?
?
This
The
claim
follo
is sho
lemma
wnby
and
analyzing
theorem
each kind
direct
ofcomputation
consequences
step?
of
De?nition?????S ??
?
S
?
holds i?
S
?
?S orS
?
?N?S? orS ??S
?
????? ??S
n
??S
?
?n? ???
????Soundness andCompleteness
W
has
e presen
a
tresultsrelating
with
the
er
operational
constrain
and
then
declarative semantics of
CSR? These resultsare basedonw ork ofJa?ar and Lassez?JL???? Maher
?Mah??? andv an Hen tenryck ?vH????
De?nition ?????Ac omputablec onstraint ofG isthe logical meaning ofa
state which appears inacomputation ofG? Thelogical meaningofa ?nal
state is calledanswerc onstraint?
Theresultsin this sectionare relativelystraightforw ardb ecausea compu?
tationstep producesonlylogicallyequiv alent states?
wingareLemma A??
?tobe foundin the appendix??
L emma????LetPbea CSRprogram andGbea goal?Then for allcom?
putableconstrain tsC
?
andC
?
ofGthe following holds?
P?CTj?C
?
?C
?
?
Theor em ????Soundness?? LetPbea CSRprogram andGbea goal? IfG
computationanswtC
P?CTj???C?G??
paper?tex? ????????????????? no v??p???
Page 13
?A?
S
??
?
?
?
?
?
?
?
?
?
??
?
?
?
?
?
?
?
?
?
?B?
S
??
?
?
?
?
?
?
?
?
?
??
?
?
?
?
?
?
?
?
?
S
?
??
S
?
S
?
?
S
?
Figure?? LogicalRelationship ofComputable Answ ers in CLP?A? andCSR ?B?
The orem ??? ?Completeness??LetPbea CSR programandGbea goal
with at leastone ?nite computation?IfP?CTj???C?G?? thenG hasa
computation withansw erconstraintC
?
suchthat
P?CTj???C?C
?
??
Proof? G has atleast one?nitecomputation? LetC
?
be the answer constraint
ofG resulting from thiscomputation?
By thesoundness Theorem ???the followingholds?
P?CTj???C
?
?G?
F romP?CTj???C?G? follo wsP?CTj???C?C
?
???
The completenesstheorem does not hold?ifG has no?nitecomputations?
Example ????LetPbe thefollowingCSR program?
p? p?
LetGbep? ItholdsthatP?CTj?p?p? How ev er?G has only one in?nite
computation?
paper?tex? ????????????????? nov??p???
Page 14
W hav already intheprevioussection in
theresult of ofgoalwill alwa ys
Example ???? LetPbe thefollowing CSRprogram
p? q?
p? false?
P?CTj??q? butq hasno?nitely failedcomputation?We will seethat
con?uence will improve onthis situation?
?? Con?uence
ee shownthat ev eryCSR program?
acomputationa giv enhave thesamemea?
ning?How ev erit is not guaranteed that theresultis syn tactically thesame?
Inparticular?a solver maybe completewith one orderofruleapplications
butincomplete withanother one?Di?erent resultsmay also arise? if com?
binedsolv ersshareconstraint symb ols? dep endingon which solvercomes
?rst?
In the follo wingwe willadopt and extend theterminology and tec hniques
of conditional termrewriting systems ?CTRS? ?DOS???KK????A straight?
forw ardtranslation ofresultsin the?eldof CTRSw as notp ossible?because
the CSRformalismgives risetophenomena which do notapp ear in CTRS
ormakeproblems whentreatingcon?uence? Theseincludetheexistence of
global knowledge? CSR programsaremorepow erfulthan theclassical con?
ditionalrewriting?b ecausethey useanadditional con text?thebuilt?in cons?
traint store?Information about thisstorem ustbeav ailableforapplication
ofcomputation steps? Otherphenomena are?generalized?logicalconditions
for ruleapplicability ?guards??multipleoccurrences ofvariables on the left?
hand sideofa rule?lo calvariables ?v ariablesthato ccur onthe right?hand
side ofa ruleonly??
Con?uence? asillustratedin Figure ??A??guarantees that anycomputation
startingfroman arbitrarygiven initial stateresults inthe same?nalstate?
We ?rstde?newhatit means thattwocomputations have thesame result?
De?nition???? TwostatesS
?
andS
?
arecalled joinable? ifthere existstates
S
?
?
?S
?
?
suchthatS
?
??
?
S
?
?
andS
?
??
?
S
?
?
andS
?
?
andS
?
?
arevarian ts?
paper?tex??????????????????no v?? p???
Page 15
holds all statesSS
p? q?
p? false?
This program isob viously not con?uent sincep can eitherbereplacedbyq
orfalsewhich di?er?How ev er thefollo wing programis con?uent?
p? q?
p? false?
q? false?
Con?uence isundecidable ingeneral?Luc kily? Newman?s lemma?New???
for termrewriting systemsisapplicable to CSR asw ell? Ifaprogram is
terminating? it su?cestoconsider local con?uencetoguaran tee ?global?
con?uence?We will show thatlo calcon?uenceis decidable forCSR?while
termination? of course? isv erylik ely tobeundecidable??
De?nition????A CSR programis called loc al lyc on?uent? ifthe following
for S?
?
?
?
?
IfS ??S
?
?S ??S
?
thenS
?
andS
?
are joinable?
?A?
S
??
?
?
?
?
?
?
?
?
?
??
?
?
?
?
?
?
?
?
?
?B?
S
???
?
?
?
?
?
?
?
??
?
?
?
?
?
?
?
?
S
?
??
?
B
B
B
B
B
B
B
B
S
?
??
?
?
?
?
?
?
?
?
S
?
??
?
B
B
B
B
B
B
B
B
S
?
??
?
?
?
?
?
?
?
?
S
?
S
?
Figure??Con?uence ?A? andLo calCon?uence ?B?
Toanalyze con?uence ofa giv enCSR programwe have toc heck joinability
of all pairsofstates? which haveacommonancestor state?There are in??
nitelymany of thosepairs? ifthere isatleast one rule intheprogram? In
the followingwe willpresenta decidable?necessaryand su?cientcondition
paper?tex? ??????????? ??????no v?? p???
Page 16
di?erent results?
hB
?
???G?Vi
??
?
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
hB
?
??? G?Vi
vv
?
m
m
m
m
m
m
m
m
m
m
m
m
m
m
S
hB
?
? Gs?C
U
?G?C
B
?Vi
??
?
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
hB
?
? Gs?C
U
?G?C
B
?Vi
vv
?
m
m
m
m
m
m
m
m
m
m
m
m
m
m
S
?
Figure??Joinability ofCriticalP air?T op? and Extended States ?Bottom?
De?nition ???? If one ormore headconstrain tsH
i
?
?????H
i
k
ofarule
?H
?
?????H
n
?GjB? canbe equated withone ormore head constrain ts
H
?
j
?
?????H
?
j
k
ofa rule?H
?
?
?????H
?
m
?G
?
jB
?
?
?
? thenwe callthetuple
?
?
G?B?H
?
j
k ??
?????H
?
j
m
???B
?
?H
i
k ??
?????H
i
n
?V?
a criticalp airoftheserules?Here is
?
G?G?G
?
?H
i
?
?
?H
?
j
?
?????H
i
k
?
?H
?
j
k
?
whilefi
?
?????i
n
g andfj
?
?????j
m
g arepermutations off??????ng and
f??????mg?respectiv ely?and??k?min?m?n??Visthe sequence ofvaria?
blesinH
?
?????H
n
?H
?
?
?????H
?
m
?
Example????ConsidertheprogramformaximumofExample????
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Z
?
?X?
Therearetwotrivial
?
andthefollowingnontrivialcriticalpair
??
?
?
Itcanbeafreshvariantofthe?rstrule?
?
Wecallcriticalpairsoftheform?G?B???B?V?trivial?
??
Withvariablesfromdi?erentrulesalreadyidenti?edforreadability?
paper?tex??????????????????nov??p???
Page 17
Thesetwo ruleshave the nontrivialcritical pair?
?true?
imp?X?Y??X
?
???Y
?
???Z
?
?????or?X?Z?Y??X
?
???Y
?
???
?X?Y?Z??
De?nition ????Acritical pair?G?B
?
???B
?
?V? is calledjoinable if
hB
?
??? G?Vi andhB
?
??? G?Vi are joinable?
Example????The criticalpairin Example ??? isjoinable? if thebuilt?in cons?
traint solv ernormalizesX?Y?Y?X in toX
?
?Y? Thecritical pairinexample
??? isalso joinable? providedthere arethe follo wing?or similar?rules in the
CSR program?
imp?????? true? true?
or?X???Z?? true?Z
?
? ??
Withthe notionofcritical pairswe are inap osition togivea su?cient and
necessarycondition forlo calcon?uence? Thepro offor the follo wingtheorem
canbe found inapp endixB?
The or em ????A CSRprogramis lo cally con?uent i?all itscritical pairs are
joinable?
De?nition????A CSR programis calledterminating? if therearenoin?nite
computations?
The following corollary isa simpleconsequence of Theorem ???and New?
man?s lemma?New????
Cor ol lary????Aterminating CSR programiscon?uent i? itis lo callycon?
?uen t?
TheCorollary ???giv esadecidablecharacterization ofcon?uenttermina?
tingCSR programs? Joinability ofa givencritical pairisdecidable fora
terminating CSRprogram andthere areonly ?nitelymany criticalpairs?
As in termrewritingsystems? termination iscrucial togofrom localcon?u?
ence to?global?con?uence? Itmaybe the casethat theclassofterminating
paper?tex?????????? ?? ?????? nov??p???
Page 18
thenotion ofdeterminism from ALPS?Mah??? to CSR?Inadeterministic
program? notworules forthesame predicatehaveov erlapping guards?This
means that inacomputation? atmost one rule canbec hosen fora goal?
Hence anyp ossibleorder of ruleapplications results inthe same ?nal state?
It may seem thatany con?uent programcanbe translated into an equiva?
lent deterministicone? How ev er? thisisnot thecase?b ecausethe resulting
deterministicprograms maybe operationallyw eak erthantheir con?uent
counterparts? Thenotionofdeterministic programs istoostrictfor ourpur?
p oses?Theweakness ofthe notionofdeterminismappliedtoCSR hasthree
reasons?ofwhich the?rsttwoalsohold forC
?
L languages?
First?theconstraint systemm ustbe closed undernegationso thataC
?
L
program canbe transformedin to one withoutov erlappingguards?
Example???? Rememb er the?con?uent? rulesfor maximum?
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Z
?
?X?
This programcannotbetransformed in toan equiv alent one withoutov er?
lappingguards? if
?
? and? are theonlybuilt?in constraints?
Secondly? con?uentprograms cancommittoa rule earlier thandetermini?
sticonesb ecause their guardscanbe less rigidsince theymayov erlap?
Example ????Adeterministicv ersionofmaximum?
maximum?X?Y?Z??X?Y?Z
?
?Y?
maximum?X?Y?Z??Y?X?Z
?
?X?
F or the goalmaximum?A?B?C??A?B theansw er isthegoal itself?b ecause
no rule isapplicable? Inthecon?uentv ersion?Example ????the?rstrule
commitsandcomputes theansw erA?B?C
?
?B?
Third?incon trasttomostC
?
LlanguagesincludingALPS? CSR allow ?mul?
tipleheads?? i?e?conjunctions inthehead ofa rule?Wecan getintoasituati?
on? wheretworules canbeapplied todi?erentbutoverlappingconjunctions
ofconstraints?Ingeneralitisnotp ossibletoavoidcommitment toone ofthe
rules?and thus makingtheprogramdeterministic
??
?by addingconstrain ts
to theguards?
??
Weconservativelyextendthe notionofdeterministic ALPSprogramstoCSR?At
most oneruleisapplicable toanygivengoal?
paper?tex??????????????????nov??p???
Page 19
conditionto the guardof the ?rstrule thator?A?C?B? does notexist in the
currentstate? Sucha condition cannotbeexpressedbyaconstraint sinceit
ismeta?logical asit canb ecomedis?implied in thefuture?
?? Consistency and Con?uence
We nowshow thatcon?uenceimpliesconsistency of thelogical meaningofa
range?restrictedprogram?F orthiswehave to requirethe constrainttheory
tobe groundcomplete
??
? Since ourtestforcon?uenceisdecidable? itthus
canalsobe usedtoiden tifythe partsofrange?restrictedterminatingC
?
L
programsthat havea consistentdeclarative semantics in oursense?
F or theproof to gothrough? every rule hasto satisfyar ange?restriction
condition? Ev eryv ariablein thebo dy appears also inthe head?Web elieve
thattheresult holdsforgeneral CSRprograms? butto showthis? itseems
thata di?erent proof tec hnique has tobe found?
De?nition
Note
????A constrain
restriction
t theory
v
CT iscalled
the
ground
ert
c omplete?
holds
iffor
all
ev
useful
ery
groundatomicconstraintc eitherCTj?c or CTj??c holds?
The orem???? LetPbearange?restricted CSRprogram andCTa ground
completetheory? IfP is con?uen t? thenP?CT is consisten t?
The theorem follows directly fromthefollowingtwo lemmas? In order to
formulatethem?we ?rsthave to de?nethenotionofcomputational equiva?
lence?
De?nition ???? Givena CSRprogram?we de?nethecomputationale quiva?
lence?
?
?S
?
?S
?
i?S
?
??S
?
orS
?
?
S
?
?S?
?
S
?
i?thereisasequence
S
?
?????S
n
such thatS
?
isS?S
n
isS
?
andS
i
?S
i??
for alli?
Wecaneasilysee thatfor everycomputational equivalenceS?
?
S
?
there
isasequenceS
?
?T
?
?S
?
?T
?
?????T
n??
?S
n
ofthe followingform?
S
?
?
S
?
??
?
T
?
?
?S
?
??
?
?????
?
T
n??
?
?S
n
??
?
S
?
?
Thissequence ismore intuitivelyillustratedinFigure??
??
thatthisiseryweak?sincepropyforalmost
classesofconstrainttheories?
paper?tex??????????????????no v??p???
Page 20
exist?
Figure?? ComputationalEquivalence ofS andS
?
L emma???? IfP iscon?uen t? then h???? true?Vi?
?
h???? false?Vi do es
not hold?
Proof?LetbeS
T
?h???? true?Vi andS
F
? h????false?Vi?Weshowby
inductiononthelengthofthecomputationalequivalencenthatthere are
nostatesS
?
?T
?
?????T
n??
?S
n
such that
S
T
?
?
S
?
??
?
T
?
?
???? ??
?
T
n??
?
?S
n
??
?
go
S
F
Basecase?S
T
?
?
S
?
??
?
S
F
cannot exist?b ecauseS
T
andS
F
aredi?erent
?nal statesandP iscon?uent?
Induction step?We assume thatthe inductionh yp othesis holds forn? i?e?
S
T
?
?
S
?
??
?
T
?
?
???? ??
?
T
n??
?
?S
n
??
?
S
F
does notWe prove
theassertionforn??by con tradiction?
We assumethata sequenceofthe form
S
T
?
?
S
?
??
?
T
?
?
????
?
?S
n
??
?
T
n
?
?S
n??
??
?
S
F
exists?We willlead
thisassumption toa contradiction?
P iscon?uen t?henceS
F
andT
n
arejoinable?SinceS
F
isa ?nal state?
there isacomputation ofT
n
that resultsinS
F
?i?e?T
n
??
?
S
F
?? andhence
S
n
??
?
S
F
?Thereforethere isasequence oftheform
S
T
?
?
S
?
??
?
T
?
?
????
?
?S
n??
??
?
T
n??
?
?S
n
??
?
S
F
?
which isa contradiction to theinductionhypothesis??
Somenotationsandde?nitionsarenecessarybeforewefurther?Weuse
thenotation???forassignments?orvaluations?toa setofvariables?For
an interpretationIandavariablevaluation?wedenotethe factthatthe
formulaorsetofformulasFissatis?edbyI and? as?I??j?F ??The
factthataclosedformulaissatis?edbyaninterpretationIisdenotedas
?Ij?F??
AninterpretationofP? CTisastructurethatexpandstheHerbrandmodel
ofCTtoincludeanin terpretationofthesetoftheuser?de?nedconstraints
appearinginthe CSRprogramP?Amodelofa?set of?rule?s? is aninter?
pretationmodelingtherule ?theset??
paper?tex?????????? ????????nov??p???
Page 21
I
?
??ffC
?
??????C
n
?gjh?C
?
?????C
n
????? true?Vi?
?
h???? true?Vig?
LetbeI ???
S
I
?
??
??
Becauseofthe consistenceand the groundcompleteness CThasa single
Herbrandmo del
CM ??fcj CTj?c andc isgroundg
LetIbeI? CM?We know thatfalse??I?b ecausehfalse??? true?Vi
?
?
h???? true?Vi do esnothold?ThereforeI isaHerbrand interpretati?
onofP? CT?We showIj?P?
Let?H
?
?????H
n
?G
?
?????G
j
jB
?
?????B
k
?bea CSR rule fromP?We
showIj?? ??G
?
?????G
j
???H
?
?????H
n
???B
?
?????B
k
????Since
the rules arerange?restricted?we have to showIj?? ??G
?
?????G
j
??
?H
?
?????H
n
?B
?
?????B
k
??
ToshowthatIj???G
?
?????G
j
???H
?
?????H
n
?B
?
?????B
k
??which
is equiv alent toIj?? ??H
?
?????H
n
?G
?
?????G
j
???B
?
?????B
k
?G
?
?
????G
j
????wehave toshow thatI??j??H
?
?????H
n
?G
?
?????G
j
?
B
?
?????B
k
?G
?
?????G
j
?for anyvariablevaluation??
Forallformulas?H
?
?????H
n
?G
?
?????G
j
?B
?
?????B
k
?G
?
?????G
j
?
andforanyv ariablevaluation?the followingequivalenceshold?
I??j?H
?
?????H
n
?G
?
?????G
j
i?fH
?
??????H
n
??G
?
??????G
j
?g?I
i?h?H
?
?????H
n
?G
?
?????G
j
?????true?Vi?
?
h????true?Vi
i?h?B
?
?????B
m
?G
?
?????G
j
?????true?Vi?
?
h????true?Vi
i?fB
?
??????B
m
??G
?
??????G
j
?g?I
i?I??j?B
?
?????B
m
?G
?
?????G
j
?
ThereforeI??j?H
?
?????H
n
?G
?
?????G
j
?B
?
?????B
m
?G
?
?????G
j
foranyvariablevaluation?andforallformulasinP?
ThenIj????G
?
?????G
j
???H
?
?????H
n
?B
?
?????B
k
??forall
formulasfromP??
??
This operatordenotestheunionofallmembersofI
?
?
paper?tex?????????? ????????nov??p???
Page 22
a goal?Thenthe followingareequiv alen t?
a?P?CTj???C?G??
b?Ghasa computationwithansw er constraintC
?
suchthatP?CTj?
??C?C
?
??
c? Every computationofGhasan answerconstraintC
?
such thatP?CTj?
??C?C
?
??
Pro of??a?? b?? holdsaccordingtocompletenessof CSRcomputations?
Theorem????
?b??c?? is implied directlybycon?uenceandtermination?
?c?? a?? holdsaccording tosoundness ofCSRcomputations? Theorem
?????
The follo wing theoremgivesacondition forexistence of?nitelyfailed com?
putations? providedthe goals have the following property?
De?nition????A goalisdata?su?cient? ifithasa computation witha ?nal
statecontaining anemptyuser?de?ned store?
Thisprop erty guaranteesthatthere isacomputation of the goal withanans?
w erconstraint containing onlybuilt?inconstrain ts? The prop erty is exactly
thesame as theone usedin ?Mah???? butwe usea moreexplicitde?nition
??
?
The or em???? LetPbearange?restricted andcon?uent CSRprogram? CT
a groundcomplete theory? andGadata?su?cient goal?IfP?CTj? ??G
thenG hasa ?nitely failedcomputation?
Pro of?G hasacomputation with answerconstraintC containing onlybuilt?
inconstraints?becauseG isdata?su?cien t?
ByTheorem ???thefollowing doeshold?
P?CTj???C?G??
P?CTj? ??G impliesP?CTj?? ?false?G??Therefore
P?CTj???C?false??
??
Personalcommunication withM?Maher?Email? Jan uary?????
paper?tex?????????? ?? ??????nov??p???
Page 23
The following corollaryisa soundness andcompleteness result for?nite
failure? Itisaconsequence ofTheorems???????and ????
Corol lary???? ?SoundnessandCompleteness ofFiniteFailure? LetPbe
arange?restricted?terminating and con?uent CSRprogram?CTa ground
completetheory? andGadata?su?cient goal?
Thefollowingare equivalen t?
a?P?CTj? ??G
b?G hasa?nitely failedcomputation?
c? EverycomputationofGis?nitelyfailed?
TheseresultsaresimilartothoseforALPS?Mah????even thoughALPS
hasadi?erentdeclarativesemantics?basedonClark?scompletion?anda
di?erentoperationalsemantics?rulescancommitmoreoften??
Asaconclusionofthissectionwepresenta comparisonofthevariouscom?
pletenessandsoundness results forsuccessfulcomputations?SC? and?nite
failure?FF?forC
?
Llanguages
??
aspresentedin?JM???andCSRinFigure
??
C
?
LCSRDeterm?C
?
LCon??CSR
Soundness?SC?yesyesyesyes
Completeness?SC?noyesyesyes
Soundness?FF?yesyesyesyes
Completeness ?FF? no noy esy es
Figure?? SoundnessandCompleteness ResultsforC
?
L and CSR
??
Thus? the proofalsogo es throughforconsistent programs?
??
Note thatthe declarative semantics ofthese languages is di?erentfromCSR?s?based
onClark?scompletion??
paper?tex??????????????????no v??p???
Page 24
We in troducedthe notionofcon?uenceforConstraint Simpli?cation Rules
?CSR??Con?uenceguaran tees thata CSR programconsisting onlyof sim?
pli?cationruleswill always compute thesame resultfora giv ensetofuser?
de?nedconstraints independent of which rules areapplied?
Basedon classicalnotions intermrewriting systems?we have givenac ha?
racterizationof con?uenceforterminatingCSR programsthrough joinabi?
lity ofcriticalpairs? yieldinga decidable?su?cient and necessarycondition
and syntacticallybased testforcon?uence?We havesho wn thatcon?uence
impliesconsistency ofthelogicalmeaning of CSRprograms?
Wealso gavev arioussoundnessandcompleteness results forCSR programs?
Ourtheorems are strongerthanwhatholdsfor therelated familiesofC
?
L
programming languages?Our approach complements recentw ork in pro?
gram analysisas in ?MO???CFMW???? wherea di?eren t? lessrigid notion
of con?uenceisde?ned?Acommitted?c hoice program iscon?uent? if di?e?
rent process schedulings give rise tothe samesetofp ossibleoutcomes? The
idea of ?MO??? CFMW???istoin tro duceanon?standard seman tics? which
iscon?uent forallcommitted?c hoiceprograms?
We have develop eda to ol?Mar??? inECL
i
PS
e
?ECRC Constraint Logic Pro?
gramming System?A CD
?
????which testscon?uence of CSRprograms? Our
tests show thatmostexistingconstraint solvers writteninCSRare indeed
con?uent?A solverperformingGaussianeliminationw as not con?uent? It
can easilybe madecon?uentby addinga conditiontothe guard?inthis
case?at the expenseofe?ciency?? Currentw ork ?Abd??? integrates thetwo
otherkindsofCHR rules? thepropagation and thesimpagationrules?in to
ourcondition forcon?uence? The ideais toextendstatesbyacomp onent
thatk eepstrack of whichpropagation ruleshave alreadyb eenappliedand
inthiswayav oidstrivialnontermination?
Asintermrewritingsystems?termination iscrucialtogofrom localcon?u?
ence to?global? con?uence? Th usinvestigations intotermination areneces?
sary?
We alsow ant toinv estigatefurther therelationshipof CSR togeneral?
purp oseC
?
L languages?Weplan to studycompletionmetho dstomakea
non?con?uent CSR programcon?uen t?Likein termrewritingsystems?the
ideaistoturncriticalpairsintorules?
Finally?wewouldlike tothank theanonymousreferees?who havepointed
outsomeerrorsandomissionsinpreliminaryv ersionsofthis paper?
paper?tex?????????????????? nov??p???
Page 25
CFMW???hi? K?Marriott? and
ney? M?Maier? D? Miller? B?P erez?E?vanRossum? J? Schimpf?P?Tsahageas?
andD? de Villeneuve?ECL
i
PS
e
??? UserManual? ECRC MunichGermany?
July?????
AFM??? S?Ab dennadher?T?Fr? uhwirth?and H?Meuss? Oncon?uence ofconstraint
handlingrules? InE?F reuder?editor? Procee dingsofthe Sec ondInternational
Conference onPrinciples andPr actice ofConstraint Pro gramming?CP????
LNCS ?????Springer?August ?????
AKP??? HassanA? ?t?Kaciand AndreasPo delski?Functions aspassiveconstrain ts
inLIFE?A CMTr ansactions on Pro gr ammingL anguages andSystems?
???????????????? July?????
CD??? Philippe Co dognet andDanielDiaz? Bo olean constraint solving using
clp?FD?? InDaleMiller? editor?Lo gic Pro gramming? Procee dings ofthe
????Internation al Symposium? pages????????V ancouver?Canada? ?????
TheMITPress?
M? Codish? M?F alasc W?Winsborough?A con?uent
semantic basisfor the analysis ofconcurrent constraint logicprograms? Jour?
nal ofLo gicPro gr amming????????????? ?????
Cla??? K? Clark?Lo gicandDatabases?c hapterNegation asFailure?pages ????????
Plenum Press? NewY ork? ?????
DOS???N? Dershowitz? N? Ok ada?and G? Sivakumar?Con?uence ofconditional rewri?
tesystems?In J??P? JouannaudandS? Kaplan? editors?Procee dingsof the?st
InternationalWorkshop onConditionalTermR ewritingSystems? LNCS????
pages ???????????
FGMP??? M?Falaschi? M?Gabbriell i?K?Marriott? andC?P alamidessi?Con?uence in
concurrentconstraintprogramming? InV?S?Alagar andM?Nivat? editors?
Procee dingsofAMAST ????LNCS ????Springer??????
FHK
?
??? T?Fr? uhwirth?A?Herold?V?K?uchenho?? T? LeProv ost?P?Lim? E?Monfroy?
and M?W allace?Constraintlogicprogramming?Aninformalintro duction?
InG?Com yn?N?E?Fuc hs?and M?J?Ratcli?e?editors?Lo gic Pro gramming in
A ction? LNCS????pages ?????Springer? ?????
Fr?u??? T?Fr? uhwirth?Constrainthandling rules?In A?Podelski? editor?Constraint
Pro gramming? BasicsandTrends?LNCS????Springer? ?????
JL??? J?Ja?arand J??L?Lassez?Constraintlogicprogramming?InConference
RecordoftheFourteenthAnnualA CM SymposiumonPrinciplesofProgram?
mingLanguages?pages???????? ?????
JM??? J?Ja?ar andM? J?Maher?Constraintlogicprogramming?Asurvey?Journal
ofLo gicProgramming?????????????????
KK???C?Kirchner andH?Kirc hner?Rewriting?The oryandApplications?North?
Holland??????
Mah???M?J?Maher?Logicsemantics foraclass ofcommitted?choiceprograms? In
J??L? Lassez?editor?Proceedings oftheFourthInternational Conferenceon
LogicProgramming?pages????????TheMIT Press?May?????
Mar???M?Marte?ImplementationeinesKon?uenz?Testsf?urCSR?Programme?
Advancedpracticalthesis?InstituteofComputerScience? Ludwig?
Maximilians?UniversityMunich??????
Meu???H?Meuss?Kon?uenzvonConstraint?Handling?Rul es?Programmen?Master?s
thesis?Institutf?urInformatik?Ludwig?Maximilians?Universit? atM?unchen?
?????
paper?tex?????????????????? no v??p???
Page 26
A?Pro forSection ???
inArti?cial Intel ligence andLo gicPro gramming?v olume??c hapter?? pages
???????? OxfordUniv ersity Press? Oxford? ?????
Sar???V?A?Sarasw at?Concurr ent Constraint Pro gr amming? MITPress? Cam bridge?
?????
Sha???E? Shapiro?Thefamilyofconcurrent logicprogramming languages?A CM
ComputingSurveys? ??????????????Septemb er ?????
Smo???G? Smolk a?Residuation and guardedrules for constraint logicprogramming?
InDigitalEquipment ParisR ese ar chL ab oratoryR esear chR ep ort?F rance?
June ?????
SRP??? V?A?Saraswat? M? Rinard?andP?Panangaden? Theseman ticfoundations of
concurrent constraintprogramming? In Confer enceRec ord of the??thA nnual
A CM Symp osiumon Principles ofPro grammingL anguages? pages ????????
A CM Press?Jan uary?????
vH???P?v an Hentenryck?Constraint logicprogramming? The Knowle dge Engine e?
ringR eview? ?????????? ?????
App endix
ofs
Lemma A???LetPbeaCSR program?Gbeagoal? IfC isacomputable
constraint ofG?then
P?CTj???C?G??
Pro of?We provetheclaimbystructuralinductionov er thecomputations?
Base case? Notransitionis appliedto theinitialstatehG???true?Vi?i?e?
C?G? andthestate ispossiblynormalizedbyN? Thenthe followingholds?
P?CTj???C?G??
Induction step?We have the followingcomputation
h G???true?Vi ??
?
hGs
?
?C
?
U
?C
?
B
?Vi??hGs
??
?C
??
U
?C
??
B
?Vi?
Inordertoprove thatthelastcomputationsteppreserveslogicalequiv a?
lence?weprovethat eachtransitionof theoperationalsemanticspreserv es
logical equiv alence?
??? Solve?ThenGs
?
isofthe formC?Gs?whereCisabuilt?inconstrain t?
Thetransitionapplied tothestatehC? Gs?C
?
U
?C
?
B
?Vileadstothenew
statehGs
??
?C
??
U
?C
??
B
?Vi?N?hGs?C
?
U
?C
?
B
?C?Vi ??
paper?tex?????????????????? nov?? p???
Page 27
P?CTj?????x
?
?C? Gs?C
?
U
?C
?
B
????x
?
?Gs
??
?C
??
U
?C
??
B
???
where?x
?
are thelo calv ariablesofhGs
??
?
?C
??
U
?C
??
B
?Vi?
Therefore
P?CTj?????x
?
?Gs
??
?C
??
U
?C
??
B
??G??
??? Intro duce? Then Gs
?
isofthe formC? Gs? whereC isa user?de?ned
constrain t? Introduce appliedto thestatehC? Gs?C
?
U
?C
?
B
?Vi leads tothe
new stateh Gs
??
?C
??
U
?C
??
B
?Vi?N?h Gs?C?C
?
U
?C
?
B
?Vi ??
Let?x
?
be thelocalv ariablesofhC? Gs?C
?
U
?C
?
B
?Vi? Bytheinductionh ypo?
thesis thefollo wing holds?
P?CTj?????x
?
?C? Gs?C
?
U
?C
?
B
??G??
?x
?
arealso thelo calvariables ofthestatehGs?C?C
B
?
U
?C
?
B
?Vi? Thefollowing
equivalenceholds?
P?CTj?????x
?
?Gs?C?C
?
U
?C
?
B
??G??
SinceN does notchangethe statehGs?C?C
?
U
?C
?
B
?Vi?x
?
arealso thelocal
variablesof thestateh Gs
??
?C
??
U
?C
??
B
?Vi
P?CTj?????x
?
?Gs
??
?C
??
U
?C
??
B
??G??
???Simplify? ThenC
?
U
is of theformH
?
?C
U
?where?H?CjB? isa
freshCSR rulefromPandCTj???C
?
B
???y?H??H
?
?C???
Thetransitionapplied tothestatehGs
?
?H
?
?C
U
?C
?
B
?Vileads tothe new
statehGs
??
?C
??
U
?C
??
B
?Vi?N?hGs
?
?B?C
U
?H??H
?
?C
?
B
?Vi??
Let?x
?
bethe lo calvariables ofhGs
?
?H
?
?C
U
?C
?
B
?Vi?Bytheinduction
h ypothesisthefollo wingholds?
P?CTj????x
?
?Gs
?
?H
?
?C
U
?C
?
B
??G?????
Theentailmentcondition sa ysthat thecon textC
?
isequivalent toits con?
junctionwiththeinstan tiated guard?
CTj???C
?
B
?C
?
B
???y?H??H
?
?C??
paper?tex??????????????????nov??p???
Page 28
P? CTj????x
?
?Gs
?
?H
?
?C
U
???y?C
?
B
?H??H
?
?C ???G??
Thev ariables?y are thev ariablesoccurring onlyinH? then thefollo wing
holds?
P? CTj????x
?
??y?Gs
?
?H
?
?C
U
?C
?
B
?H??H
?
?C??G?? ???
According tothefactthat CTj?H??H
?
??H?H
?
?we obtain?
P? CTj????x
?
??y?Gs
?
?C
U
?C
?
B
?H??H
?
?H?C??G?? ???
F romP? CTj?? ??C??H???y
?
B ???we deduce?
P? CTj?? ??H?C????y
?
?B?C ??
ByreplacingH?Cby??y
?
?B?C? inequation???we obtain?
P? CTj????x
?
??y?Gs
?
?C
U
?C
?
B
?H??H
?
???y
?
?B?C ???G?? ???
Thev ariables?y
?
arethevariablesoccurringonly inB? thenthe following
holds?
P? CTj????x
?
??y??y
?
?Gs
?
?C
U
?C
?
B
?H??H
?
?B?C??G??
The entailmentcondition sa ys thatC isen tailedby thecontextC
?
B
?then
the followingholds?
P? CTj????x
?
??y??y
?
?Gs
?
?C
U
?C
?
B
?H??H
?
?B??G??
Thev ariables?y
?
?resp??y?are thevariablesoccurring only inB ?resp?
H??H
?
??then?x
?
??x
?
??y
?
??y arethe localvariablesofthestate
hGs
?
?B?C
U
?H??H
?
?C
?
B
?Vi?
P? CTj?????x
?
?Gs
?
?B?C
U
?H??H
?
?C
?
B
??G??
paper?tex?????????? ???????? no v??p???
Page 29
follo wing
P? CTj?????x
?
?Gs?C
U
?C
B
??G?
holds??
B? Pro ofs forSection?
We ?rstgive the lemmaswhich areused inthe proofof Theorem???? Com?
pletepro ofs forthelemmas areomitted forspace reasons?they canbe found
in ?Meu????
The ?rst lemmastateswhenjoinability iscompatible withc hangingthe
globalv ariable stores?
LemmaB??? LethGs
?
?C
U?
?C
B?
?Vi andhGs
?
?C
U?
?C
B?
?Vibejoinable?
Then theholds?
a?IfV
?
?V? thenhGs
?
?C
U?
?C
B?
?V
?
i andh Gs
?
?C
U?
?C
B?
?V
?
i arejoinable?
b? IfV
?
con tains only freshv ariables?thenhGs
?
?C
U?
?C
B?
?V?V
?
i and
hGs
?
?C
U?
?C
B?
?V?V
?
i are joinable??denotesconcatenation??
Pro ofsketch?a?Ifwereduce then umb erof globalvariables? theremaybe
one e?ect onthe computation steps?Variables that haveb eenglobalb efo?
re? arestrictly localnow? Thesev ariableswillbeeliminatedbyN?Built?in
constrain tscontaining thesevariableswillbechangedtoarepresen tation
withoutthesevariables? Butthe loss ofinformation ab outthesev ariables
does not a?ectcomputationsteps?becausestrictlylo calvariablesby de?ni?
tiondo notapp earan ywhereelse in thestate?This issho wnbyinduction
overthen umb er ofcomputationsteps?
b? This is sho wnbystraightforwardstructuralinductionov ercomputations?
The nextlemmastatesthatadditionofconstrain ts tothestoresdoes not
changejoinability of thestates? Itisaconsequence ofmonotonicity of logical
consequence and ofLemma ????
L emmaB??? If?C
?
?C
?
?C
?
? Gs?C
U
?C
B
?isconnected inVand
hGs?C
U
?C
B
?Vi ??
?
hGs
?
?C
?
U
?C
?
B
?Vi?
paper?tex?????????? ???????? nov??p???
Page 30
The nextlemma statesthat atoms canbe mov ed fromthegoal store to the
user?de?ned store withoutlosingjoinability?
L emmaB??? If
hGs
?
?G
?
???C
B?
?Vi andh Gs
?
?G
?
???C
B?
?Vi
arejoinable? andG
?
andG
?
areuser?de?ned constrain ts?then
hGs
?
?G
?
?C
B?
?Vi andh Gs
?
?G
?
?C
B?
?Vi
are alsojoinable?
Pro of?We divide Gs
?
?G
?
intothe built?inconstrain tsG
C?
? theuser?de?ned
constrain tsG
ST AT?
? which arenot touched during thejoin? i?e? which remain
inthe goal store?andtheuser?de?ned constrain tsG
MOVE?
? which aretou?
c hed inthe pro cessof joining?Analogously?we divideGs
?
?G
?
in toG
C?
?
G
ST AT?
andG
MOVE?
?
Ina ?rst step?we show that? provided therequirement ismet?
hG
C?
?G
MOVE?
?G
ST AT?
?C
B?
?Vi andhG
C?
?G
MOVE?
?G
ST AT?
?C
B?
?Vi
are alsojoinable?
The onlyoperationaccessing the goalstorewith user?de?nedconstrain ts is
Introduce? Hence?all constraintsG
MOVE?
andG
MOVE?
? respectively? are
mov edto theuser?de?nedstoreswithIntro ducesteps during the process
ofjoining?We canapply theseIn troduce steps inthebeginningof the
respectivecomputation andapp end theremainingstepsthereafterwithout
c hanging theoutcomes?ThereforehG
C?
?G
ST AT?
?G
MOVE?
?C
B?
?Vi and
hG
C?
?G
ST AT?
?G
MOVE?
?C
B?
?Vi arealso joinable?i?e?there are compu?
tationsequencesforb oth statesresulting inhG?G
ST AT?
?C
U
?C
B
?Vi and
hG
?
?G
STAT?
?C
?
U
?C
?
B
?Vi?respectively?withthesetwostatesbeingvariants?
Thesame sequence ofcomputation stepscanbeapplied to thestates
hG
C?
?G
MOVE?
?G
STAT?
?C
B?
?Vi andhG
C?
?G
MOVE?
?G
ST AT?
?C
B?
?Vi?
resulting inthestateshG?C
U
?G
STAT?
?C
B
?Vi and
hG
?
?C
?
U
?G
ST AT?
?C
?
B
?Viwhicharevariants?Thismeansthat
hG
C?
?G
MOVE?
?G
STAT?
?C
B?
?ViandhG
C?
?G
MOVE?
?G
STAT?
?C
B?
?Vi
arejoinable?
paper?tex??????????????????nov??p???
Page 31
G
?
?G
DIFF?
?G
MOVE?
?G
ST AT?
? ?Rememb er that theconjunction is
asso ciative and comm utativ e??Analogously?we cande?neG
DIFF?
?
We can deducethathG
C?
?G
DIFF?
?G
?
?C
B?
?Vi and
hG
C?
?G
DIFF?
?G
?
?C
B?
?Vi arejoinable? Ifwea applya seriesofIn tro?
ducesteps to thesestates?we resultinhG
C?
?G
MOVE?
?G
ST AT?
?C
B?
?Vi
andhG
C?
?G
MOVE?
?G
ST AT?
?C
B?
?Vi? respectively? which arejoinable?
BecauseG
C?
?G
DIFF?
? Gs
?
? andG
C?
?G
DIFF?
? Gs
?
?we?nally conclude?
that
hGs
?
?G
?
?C
B?
?Vi andh Gs
?
?G
?
?C
B?
?Vi
arejoinable??
We are now inap ositionto provethe maintheorem?
Proof ofTheor em???? ????direction?LetPbea locally con?uent CSR pro?
gram?We proveby contradictionthatallcriticalpairsarejoinable? Assume
that?G
?
?G
?
?B
?
?H
?
???B
?
?H
?
?V? isacritical pairthat isnotjoinable?
We willconstructacommonancestor stateand thenusethelocalcon?uence
tocontradicttheassumption?Withreordering theheadconstrain tswe can
assumethatthis pairderiv esfromthetworules
R
?
?H
?
?H
?
?G
?
jB
?
R
?
?H
?
?H
?
?G
?
jB
?
?
whereH
?
andH
?
canbe equated
??
?Then
hB
?
?H
?
???G
?
?G
?
?Viand
hB
?
?H
?
???G
?
?G
?
?Vi
are notjoinable andtherefore
hB
?
?H
?
?G
?
?G
?
?Viand
hB
?
?H
?
?G
?
?G
?
?Vi
arenotjoinable?
Leth??H
?
?
?H
?
?
?H
?
?
?G
?
?
?G
?
?
?V
?
ibea freshv ariant of
h??H
?
?H
?
?H
?
?G
?
?G
?
?Vi?
??
Rememberthatthroughoutthewholepaper?theH
i
denoteconjunctionsofatoms?
paper?tex???????????? ??????nov??p???
Page 32
????
H
??
?
?H
??
?
?G
??
?
jB
??
?
? Becauseof the localcon?uence these statesarejoinable?
We knowthatN propagates the equalitiesH
??
?
?
?H
?
?
?H
??
?
?
?H
?
?
andH
??
?
?
?H
?
?
?
H
??
?
?
?H
?
?
in to therespective goal store? This impliesthatwe cansubstitute
thev ariables in question?i?e?replaceB
??
?
andB
??
?
byB
?
?
andB
?
?
?resp ectiv ely?
withoutc hanging the outcomeofN?
Ifthere arevariables inB
??
?
orB
??
?
whic
?
h donot
?
o ccur inH
??
?
?H
??
?
orH
??
?
?H
??
?
?
resp ectiv ely?i?e?v ariables whosev aluesarenotgov ernedby theequalities
H
??
?
?
?H
?
?
?H
??
?
?
?H
?
?
andH
??
?
?
?H
?
?
?H
??
?
?
?H
?
?
?we doreplacethembynewv aria?
bles? which doesnotin?uence theoutcome ofjoinability?
Therefore
N?hB
?
?
?H
?
?
?G
?
?
?G
?
?
?H
??
?
?
?H
?
?
?H
??
?
?
?H
?
?
?V
?
i? and
N?hB
?
?
?H
?
?
?G
?
?
?G
?
?
?H
??
?
?
?H
?
?
?H
??
?
?
?H
?
?
?V
?
i?
arejoinable? too?
Thefollowingtwostateshavethesamenormalized formasthe upperstates?
and are asasimpleconsequence ofLemma???alsojoinable?
hB
?
?
?H
?
?
?G
?
?
?G
?
?
?V
?
i and
hB
?
?
?H
?
?
?G
?
?
?G
?
?
?V
?
i?
This isacontradictiontotheclaimthat thevariantstates
hB
?
?H
?
?G
?
?G
?
?Vi and
hB
?
?H?G
?
?G?Vi
arenotjoinable?
????direction?LetPbea CSRprogramwhereallcriticalpairsarejoinable?
Wewill show thatPislo callycon?uent?AssumethatweareinstateS
??
wherethere areatleasttwodi?erentpossibilities ofcomputation?
S ??S
?
andS??S
?
?
WehavetoshowthatS
?
andS
?
arejoinable?We investigateallpairsS??
S
?
andS??S
?
andshowthatS
?
andS
?
arejoinable?Thejoinabilityof
criticalpairswillplaya centralroleinthecaseSimplifyvs?Simplifyonly?
??
BecauseofLemma???wecanassumethatSisnormalized?
paper?tex?????????? ????????nov??p???
Page 33
hC
?
?
B
C
?
? Gs?C
U
?C
B
?Vi ??N?hC
?
? Gs?C
U
?C
B
?C
?
?Vi?
?hC
?
?
? Gs
?
?C
U?
?C
B?
?Vi?
It is easy tosee thatwe can applythe other Solve stepon toeach resulting
state?It isob viousthat theresultingstates willbe identical?
N?h Gs
?
?C
U?
?C
B?
?C
?
?
are
?Vi??N?hGs
?
?C
U?
?C
B?
?C
?
?
?Vi??
Solve vs?Simplify?S isofthe formhC? Gs?H
?
?C
U
?C
B
?Vi? whereC
isabuilt?in constrain t? andH
?
isaconjunction ofuser?de?ned constraints
matchingwith the head ofarule?H?GjB?and theguardG ofthe rule
is impliedbyC
B
?
Application ofSimplifyresults inS
SIMP
?hB
?
?C
?
? Gs
?
?C
?
U
?C
?
B
?Vi?
N?hB?C? Gs?C
U
?
?C
B
?H
?
?H
?
?Vi ??whereasapplication ofSolve leadsto
S
SO LVE
?h Gs
??
?H
??
?C
??
U
?C
??
B
?Vi?N?h Gs?H
?
?C
U
of
?C?C
B
?Vi ??
Of course? Solveisapplicable onS
SIMP
? resulting inS
END
?
N?hB
?
?Gs
?
?C
?
U
?C
?
?C
?
B
?Vi ??
ApplicationofSimplify onS
SO
kno
LVE
w
isp ossible?b ecauseCTj?
C
??
B
????x?C?C
B
?
???xstrictly lo cal inhGs
??
?H
??
?C
??
U
?C?C
B
?Vi?and
CTj???C???y?G?H
?
?H
?
????yare thevariables in?H?GjB???
thereforeCTj???C
??
B
???y?G?H
?
?H
??
?? holds? Thisresults inS
?
END
?
N?hB? Gs
??
?C
??
U
?C
??
B
?H
?
?H
??
?Vi ?? which isinfact identical toS
END
?
CTj????z
?
C
?
?C
?
B
?????z
?
C
??
B
?H
?
?H
??
??where?z
?
and
?z
?
arethestrictlylocalvariablesinhB
?
?Gs
?
?C
?
U
?C
?
?C
?
B
?Viand
hB? Gs
??
?C
??
U
?C
??
B
?H
?
?H
??
?Vi?respectively?musthold?b ecauseof thefol?
lowingtwoequivalenceswhichguaranteedbytheprojectionpropertyof
N?
CTj???C
?
B
???x
?
C
B
?H
?
?H
?
?
CTj???C
??
B
???xC
B
?C??
?AnalysisofthestrictlylocalvariablesoftherespectivestatesleadstoCTj?
???z
?
C
?
?C
?
B
????z
?
C
??
B
?H
?
?H
??
???
BecauseoftheuniquenessofN?thebuilt?instatesS
END
andS
?
END
are
iden tical?AccordingtoequalitypropagationofN?S
END
andS
?
END
have
identicalgoal anduser?de?nedstores?
Introducevs?Introduce?WethatSmustbeoftheform
hC
?
?C
?
?Gs?C
U
C
B
?ViwhereC
?
andC
?
areuser?de?nedconstraints?
paper?tex??????????????????nov??p???
Page 34
In tro duce?S
?
?N?h Gs?C?H?C
U
?C
B
?Vi?
?hGs?C?H?C
U
?C
B
?Vi and
Simplify?S
?
?N?hC? Gs?B?C
U
?C
B
?H?H
?
?Vi?
?hC
?
? Gs
?
?B
?
?C
?
U
?C
?
B
?Vi?
The secondof thefour equations holds?b ecausewe assumed thatSw as nor?
malized?We canapply the othercomputationstep on toS
?
andS
?
resulting
in?
S
?
?
?N?h Gs?B?C?C
U
?C
B
?H?H
?
?Vi?
?hGs
?
?B
?
?C
?
?C
?
U
?C
?
B
?Vi and
S
?
?
?N?h Gs
?
?B
?
?C
?
?C
?
U
?C
?
B
?Vi?
?hGs
?
?B
?
?C
?
?C
?
U
?C
?
B
?Vi?
The secondequationfollows from thefourthequation intheequations abo?
v e? Thefourthequation holds?b ecauseS
?
w asnormalized?
Thismeans thatS
?
?
?S
?
?
? i?e?S
?
andS
?
arejoinable?
Introducevs? Solve? Thissituation is analogousto thecaseIn tro duce
vs?Simplify?
Simplify vs? Simplify?Letbe
R?H
?
?????H
n
?GjB
R
?
?H
?
?
?????H
?
n
?
?G
?
jB
?
therules
??
b eingappliedto thestateS?We haveto show thatapplication
ofRorR
?
onto thestateS resultsin joinable states?We knowthat the
built?in storeC
B
ofS issatis?able?otherwise norulecouldbeapplied?We
candistinguishtwo di?erentsubcases?
DisjointP eak? NoconstraintH
i
of thehead of theruleR canbeequated
withaconstraintH
j
ofthe headoftheotherruleR
?
? Ob viouslythetwo
rules canbeappliedinany order?sincetheyreplace di?erentconjuncts?
CriticalPeak?In ordertoshowjoinability ofS
?
andS
?
?wewillusethe
??
RandR
?
canbefreshv ariantsofthesamerule?
paper?tex?????????? ????????nov?? p???
Page 35
?rstatomsoftherulescanbeequated?i?e?CTj???H
?
?H
?
?????H
i
?H
i
?
where??i?n andi?n
?
??
LetS?h Gs?G
?
?????
n??
G
m
?C
B
?Vib
n?n
e the
?i??
actual state?on which the rules
R andR
?
areapplicable? Inordertobeapplied? theconditions ofSimplify
m ustbe ful?lled?i?e?CTj???C
B
???xC
?
? andCTj???C
B
???yC
?
??
whereC
?
andC
?
are theconjunctions of therespectiveguard withthe
equalityconstraints derivedfrom thematching? i?e?thefollo wingconjunction
ofconstrain ts?
C
?
?G?G
?
?
?H
?
?????G
i
?
?H
i
?G
i??
?
?H
i??
?????G
n
?
?H
n
?
C
?
?G
?
?G
?
?
?H
?
?
?????G
i
?
?H
?
i
?G
n??
?
?H
?
i??
?????G
n?n
?
?i
?
?H
?
n
?
We useabbreviations torepresent the atomsinquestion?
?
H?H
?
?????H
n
?
?
H
?
?H
?
?
?????H
?
n
?
?
?
G?G
?
?????G
n
?
?
G
?
?G
?
?????G
i
?G
n??
?????G
n?n
?
?i
?
?
H
?
?H
?
?????H
i
?
?
H
?
?
?H
?
?
?????H
?
i
?
?
G
R
?G?????G
?
?????G
m
?
?
G
?
R
?G
i??
?????G
n
?G
n?n
?
?i??
?????G
m
?
?
H and
?
H
?
are theheads ofRandR
?
?
?
G?resp?
?
G
?
?arethematchingcons?
traintsoftheuser?de?nedstore inS withH?resp?H
?
??
?
H
?
and
?
H
?
?
are
thecommonparts of
?
Hand
?
H
?
?i?e?theoverlappingconstraints ofthe rule
heads??and
?
G
R
and
?
G
?
R
representthecon tentsof the user?de?nedstoreafter
removingthematchingconstrain ts
?
Gand
?
G
?
?respectively?
TheapplicationofR andR
?
?respectively? ontheactualstate willresultin
thefollowingtwostates?
S
?
?N?hGs?B?
?
G
R
?C
B
?
?
G
?
?
?
H?Vi?
S
?
?N?hGs?B
?
?
?
G
?
R
?C
B
?
?
G
?
?
?
?
H
?
?Vi?
Wewillshowinthe followingthatS
?
andS
?
arejoinable?
WecanseethattherulesRandR
?
have thecriticalpair
?G?G
?
?
?
H
?
?
?
?
H
?
?
?B?H
?
i??
?????H
?
n
?
???B
?
?H
i??
?????H
n
?V
?
??
paper?tex??????????????????nov??p???
Page 36
n
?
We canapplyLemma B??b? here andaddV totheglobalvariables stores?
b ecauseby ourassumptionV shares nov ariables withthetwo states?
N?hB?H
?
i??
?????H
?
n
?
???C
JOIN
?V
?
?Vi? and
N?hB
?
?H
i??
?????H
n
???C
JOIN
?V
?
?Vi?
arejoinable?
ByLemma B??we can addthebuilt?inconstrain tsC
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
and
the user?de?nedconstrain tsG
n?n
?
?i??
?????G
m
to theconstraint stores
of each state withoutlosingjoinability? Therequiremen tsofthe lemma are
metb ecausethevariables in
?
H and
?
H
?
are containedinV
?
andC
B
?
?
G?
?
G
?
and?byassumption?G
n?n
?
?i??
?????G
m
share novariableswith thegoal?
user?de?ned and built?instores ofthe previousstates?
N?h Gs?B?H
?
G???C
JOIN
?C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?V
?
?Vi? and
N?h Gs?B
?
?H G???C
JOIN
?C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?V
?
?Vi?
arejoinable?HereH
?
G standsforH
?
i??
?????H
?
?
?
?
G
n?n
?
?i??
?????G
m
andHG standsforH
i??
?????H
n
?G
n?n
?
?i??
?????G
m
?
Nowwe canremove the globalvariablesV
?
fromthevariablestoresbyapp?
lyingLemma B?? a? andk eepjoinability of
N?hGs?B?H
?
G???C
JOIN
?C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi? and ???
N?h Gs?B
?
?H G???C
JOIN
?C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi?????
Becauseb othRandR
?
areapplicabletothestateS?weknowthat?
CTj???C
B
???x??y?G?G
?
?
?
H
?
?
?
?
H
?
?
??
implyingthat
CTj???C
B
???x??y?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?
?C
B
???x??y?G?G
?
?
?
H
?
?
?
?
H
?
?
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
??
TheuniquenesspropertyofNimpliesthat
N?hGs?B?H
?
G???C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi? and
N?hGs?B
?
?H G???C
B
?
?
G
?
?
?
H?G
?
?
?
H
?
?Vi?
paper?tex?????????? ????????nov??p???
Page 37
??hGs???C?V
??
N?h Gs?B?G
R
???C
B
?G?H?G?H?Vi? and
N?h Gs?B
?
?
?
G
?
R
???C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi??
Let?xbe thev ariablesof
?
H
?
? By ourassumption thev ariables?x in
hGs?B?
?
G
R
???C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi are strictlylo cal? andthe follo?
wing holds ?b ecausethe constraint
?
G
?
?
?
?
H
?
meansthat
?
G
?
is aninstanceof
?
H
?
??
CTj?????x?C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
???C
B
?
?
G
?
?
?
H ???
The uniquenessprop erty ofN anda lik ewisereasoning for thev ariablesof
?
H then leadto?
N?hGs?B?
?
G
R
???C
B
?
?
G
?
?
?
H?
?
G
?
?
?
?
H
?
?Vi?
NB
?
G
R
??
B
?
G
?
?
?
H?i?
and
N?hGs?B
?
?
?
G
?
R
???C
B
?
?
G?
?
H?
?
G
?
?
?
H
?
?Vi?
?N?hGs?B
?
?
?
G
?
R
???C
B
?
?
G
?
?
?
?
H
?
?Vi??
Thisimplies that thestates
N?hGs?B?
?
G
R
???C
B
?
?
G
?
?
?
H?Vi?and
N?hGs?B
?
?
?
G
?
R
???C
B
?
?
G
?
?
?
?
H
?
?Vi?
arejoinable? Byapplying LemmaB??we ?nallyknow that
N?hGs?B?
?
G
R
?C
B
?
?
G
?
?
?
H?Vi?and
N?hGs?B
?
?
?
G
?
R
?C
B
?
?
G
?
?
?
?
H
?
?Vi?
arejoinable??
paper?tex?????????? ????????nov??p???
Download full-text