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???
Download full-text