CHAPTER 17
SEQUENCECOMPUTATIONS
Inthischapter we’lltakea lookatsequence computations, , whicharenotconcernedwith
directlycontrollingrules,but withcomputingvalues or causingside eects,that arethen
usedtocontrolrules.
EXAMPLE(97)
Sequence computations s are typically employed d when n storages s have e to be maintained:
now:set<Node>=set<Node>{};>next:set<Node>=set<Node>{};>initializeNow(now) ;>
( processNowFillNext(now, , next) ) ;> { { now.clear(); tmp:set<Node>=now; now=next;
next=tmp; {!now.empty()} } } } )*|that t examplesequenceisusedtoimplement awave-
frontasrulecontrolstrategy.
Asetnowofcurrent nodesisprocessed,llingasetofoutputnodestobeprocessednext,
whicharethenusedinthefollowingiterationstepasinputnodes,untilallofpartsofthe
graphreachablefromtheinitialnodeshavebeenpassed,yieldinganemptyset.Thesequence
computationfor switchinginbetweenthesetsisgivenenclosedinbracesinthesequence,
thesequenceexpressiontodeterminewhetherthewavefront cametoahaltisgivenatthe
endofthecomputation,enclosedaleveldeeperinbraces. As s long asthesetis stilllled
thenalexpression,thusthecomputation,returnstrue,continuingwiththeloop{whenit
getsempty,theexpressionyieldsfalse,henceforthterminatingtheloopandthewavefront
algorithm.
Sequencecomputationsaremadeavailableinthesequencesfortasksthatbenetfromstate
changesandcomparisonsbeingembeddeddirectlyinthecontrollingsequence,esp. forvari-
ableinitializations andloopcontrol. . Butassequencesareexistingtocontrolrulesandnot
todothebulk ofthecomputationalwork,isonlyasmallsubset oftherulecomputations
languageavailableinthesequencecompuations.
17.1 SequenceStatements
RewriteComputationUsage
-
%
-
f
-
CompoundComputation
-
g
-
Thenon-computationalconstructsintroducedbeforeareusedforexecutingrules,tode-
termine whichrule to execute next t depending g on success and failure of the previous rule
applications, andwheretoapply y itnextbytransmitting atomicvariables ofnode oredge
typeinbetweentherules.Sequencecomputationsincontrastareusedformanipulatingcon-
tainervariables,evaluatingcomputationalexpressions,orforcausingsideeectslikeoutput
orelement markings. . Acomputationreturns s always true,withexceptionofanexpression
197
Change format from pdf to jpg - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
bulk pdf to jpg converter online; change format from pdf to jpg
Change format from pdf to jpg - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
convert pdf to jpg batch; best pdf to jpg converter
198
SequenceComputations
usedas a computation n (explainedbelow). . Aprepended d % attaches s a break point to the
computation.
CompoundComputation
-
Computation
-
;
-
Computation
-
Acompoundcomputationconsistsofacomputationfollowedbyanoptionallistofcom-
putations separatedby semicolons. . The e computationsare executedfromleft to right;the
valueofthecompoundcomputationisthevalueofthelastcomputation. Soyoumustgive
anexpressionatthat pointinorder toreturnavalue,whereasitispointlesstospecifyan
expressionbefore.
Computation
-
VariableDeclaration
-
Assignment
-
ProcedureMethodCall
-
ProcedureCall
-
f
-
SequenceExpression
-
g
-
Assignment
-
AssignmentTarget
-
=
-
SequenceExpression
-
Assignment
-
Avariabledeclarationdeclaresalocalvariableinthesamewayasinthesequences. An
assignmentassigns thevalue ofasequence expressionto anassignment target. . Itmay y be
chained; suchan n assignment t chainis s executedfromright t to left, , assigning the rightmost
valuetoalltheassignmenttargetsgiven. Theexpressionusedascomputation{denotedby
andenclosedinbraces{willreturnabooleanvaluebycomparingthereturnvalueof the
expressiontothedefaultvalueofthecorrespondingtype,returningfalseifequal,ortrueif
unequal.Sojustusingabooleanvariableasexpressionreturnsthevalueofthevariable.For
returninganexpressionevaluationresultvaluetoasequenceyouneedtwoopeningbraces,one
forenteringthesequencecomputations,andtheotherforenteringthesequenceexpressions.
Theformofexpressionsandassignmenttargetswillbespeciedbelow.
ProcedureMethodCall
-
(
-
Variables
-
)
-
=
-
Variable
-
GraphElement
-
.
-
Attribute
-
.
-
MethodName
-
(
-
Arguments
-
)
-
Online Convert Jpeg to PDF file. Best free online export Jpg image
try out some settings and then create the PDF files with the button at the bottom. The perfect conversion tool. JPG is the most widely used image format, but we
best pdf to jpg converter online; to jpeg
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
You can also directly change PDF to Gif image file in C# program. // Load a PDF file. Description: Convert all the PDF pages to target format images and
change pdf file to jpg; changing pdf to jpg
17.1 SequenceStatements
199
ProcedureCall
-
(
-
Variables
-
)
-
=
-
ProcedureName
-
(
-
Arguments
-
)
-
Arguments
-
SequenceExpression
,
-
Varibales
-
Variable
,
-
Amethodcallexecutesamethodonavariable,passingfurtherarguments. Themethod
maybeoneofthepredenedcontainermethods,orauser-denedmethod(cf. 16.1).
Aprocedure callexecutes a (built-inoruser dened) procedure, passingfurther argu-
ments.Inadditiontothegraphtypebasedfunctionsandprocedureswhichwillbeexplained
inmoredetailfurther below,emit,record,andexportprocedurecallscanbegivenhere:
theemitprocedurewritesadoublequotedstringorthevalueofavariabletotheemittar-
get(stdoutasdefault,oralespeciedwiththeshellcommandredirect emit;infacta
sequenceoftheformermaybegiven,whichistobepreferredoverstringconcatenationfor
performancereasons). Therecordprocedurewritesadoublequotedstringorthevalueofa
variableto thecurrently ongoingrecordings(see20.7). . Thisfeatureallowstomarkstates
reached during the transformationprocess inorder r to replay only y interesting g parts of an
recording. Itisrecommendedtowriteonly y commentlabellines,i.e. . "#",some e label,and
"\n". Theexport t procedureexports thecurrentgraphtothepathspeciedifcalledwith
oneargument,oritexportsthesubgraphspeciedasrstargumenttothepathspeciedas
secondargument. It t behaves liketheexportcommandfromtheGrShell,see20.6. Having
itavailableinthesequencesallowsforprogrammedexporting,andexportingofpartsofthe
graph,withthesubgraphcontainmentjustcomputed.
Furthermore, afunctioncanonize(g:graph):stringis s available,whichis intendedto
provideacanonicalstringrepresentationforanygraph,butcurrentlydoesnotworkforall
graphs. Thefunctioncurrentlyuses s theSMILES[Wei88]methodofproducinganequitable
partitionofgraphnodes,notacanonicalorder;whilenotoeringfull edgedgraphcanoniza-
tionthisalgorithmissucientformanypurposes.Itallowstoreducegraphcomparisonsto
stringcomparisons,atthepriceofcomputingtheWeiningeralgorithmforequitablepartitions
ofnodes.
Moreover,theproceduresfromthebuilt-inpackageDebugasexplainedindetailin21.5
may be called. . Debug::add d when n enteringandDebug::rem m whenleavinga subrulecom-
putationofinterest(alwayspairwise!),Debug::emit torecoredsomesubrulecomputation
milestones, Debug::halt to halt the debugger, and Debug::highlight t to highlight t some
graphelementsinthedebugger(haltingit).
Besidesthosepredenedprocedures(andfunctions),youmaycalluserprocedures(and
functions),denedintherulesle;cf.12.5.
Finally, an n expression(without t side eects) ) can be e evaluated, this allows to returna
(boolean)valuefromacomputation.
Online Convert PDF to Jpeg images. Best free online PDF JPEG
JPG is the most common image format on the internet. The outputs of our conversion service are always JPG files to even if pictures are saved in a PDF in other
convert pdf to jpg for; changing file from pdf to jpg
JPEG Image Viewer| What is JPEG
JPEG, JPG. enabling you to quickly convert your JPEG images into other file formats, including Bitmap, Png, Gif, Tiff, PDF, MS-Word, etc More Format Information.
convert .pdf to .jpg; convert multiple pdf to jpg online
200
SequenceComputations
AssignmentTarget
-
Variable
-
:
-
Type
-
yield
-
Variable
-
GraphElement
-
.
-
Attribute
-
Variable
-
[
-
SequenceExpression
-
]
-
GraphElement
-
.
-
Attribute
-
[
-
SequenceExpression
-
]
-
GraphElement
-
.
-
visited
-
[
-
SequenceExpression
-
]
-
Possibletargetsofassignmentsarethevariablesanddef-variablestobeyieldedto,asin
thesimpleassignmentsofthesequences. Ayieldassignmentwritestherhsvariablevalueto
thelhsvariablewhichmustbedeclaredasadef-to-be-yielded-tovariable(def-prex)inthe
patterncontainingtheexecstatement. Yieldingisonlypossiblefromcompiledsequences,it
alwayssucceeds. Furtheron,theattributesofgraphelementsmaybewrittento,thevalues
at givenpositions of array y or r deque or mapvariables may bewritten n to, andthe visited
statusofgraphelementsmaybechanged.
EXAMPLE(98)
Thesequencecomputation{ x:int=42; ; y:N; (y)=proc(x); y.meth(x); y.a=x }shows
avariabledeclarationincludinganinitialization(whichfallsoutofscopeattheclosingbrace),
avariabledeclarationofnodetypewithoutinitialization,acallofaprocedurewithoneinput
argument,assigninganoutputvalue,acallofamethodofthenodetype,andtheassignment
ofagraphelementattribute.
The example { { x:array<int>=array<int>[]; x.add(42); x[0]=1; {x.size()>0} } }
showsanarraydeclarationandinitialization,theaddingofavaluetothearray,theindexed
assignment to an array, , and d a a terminal l sequence e expressions that makes the e sequence
computation succeed if the e array is not empty (that’s the e case here) ) and fail otherwise.
Sequencecomputationsthatdon’tendwithasequenceexpressionalwayssucceed.
17.2 SequenceExpression
SequenceExpression
-
ConditionalSequenceExpression
-
BooleanSequenceExpression
-
RelationalSequenceExpression
-
ArtihemticSequenceExpression
-
PrimarySequenceExpression
-
Sequence expressions are a subset of the expressions introduced in6.2,containingthe
booleanandcomparisonoperators,butonlyplusandminusasfurtheroperators.
C# Create PDF from images Library to convert Jpeg, png images to
Batch convert PDF documents from multiple image formats, including Jpg, Png, Bmp, Gif, Tiff If you want to turn PDF file into image file format in C#
batch pdf to jpg; change file from pdf to jpg
C# Image: How to Download Image from URL in C# Project with .NET
If you want other format, you can use the image you can also save a gif, jpeg / jpg, or bmp provide powerful & profession imaging controls, PDF document, tiff
batch pdf to jpg converter online; best convert pdf to jpg
17.2 SequenceExpression
201
ConditionalSequenceExpression
-
BooleanSequenceExpression
-
?
-
SequenceExpression
-
:
-
SequenceExpression
-
Theconditionaloperatorhas lowestpriority,ifthe conditionevaluates totruetherst
expressionisevaluatedandreturned,otherwisethesecond.
BooleanSequenceExpression
-
SequenceExpression
-
&
-
^
-
|
-
&&
-
||
-
SequenceExpression
-
!
-
SequenceExpression
-
Thebooleanoperatorshavethesamesemanticsandsamepriorityasin6.2.
RelationalSequenceExpression
-
SequenceExpression
-
==
-
!=
-
<
-
<=
-
>
-
>=
-
in
-

-
SequenceExpression
-
Theequalityoperatorsworkforeverytypeandreturnwhetherthevaluestocompareare
equalorunequal. Therelationaloperatorsworkasspeciedin6.2fornumericaltypes,in13
forcontainertypes,and14forgraphtype.
ArithmeticSequenceExpression
-
SequenceExpression
-
+
-
-
-
*
-
/
-
%
-
SequenceExpression
-
VB.NET Word: Word to JPEG Image Converter in .NET Application
Word doc into high quality jpeg / jpg images; Convert a be converted into Jpeg image format and then powerful & profession imaging controls, PDF document, image
convert pdf image to jpg; reader pdf to jpeg
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
Powerful .NET control to batch convert PDF documents to tiff format in Visual C# .NET program. Also supports convert PDF files to jpg, jpeg images.
convert pdf file into jpg format; convert multiple page pdf to jpg
202
SequenceComputations
Thearithmeticoperatorplusisusedtodenoteadditionofnumericalvaluesorstringcon-
catenation,thearithmeticoperatorminusisusedtodenotesubtractionofnumericalvalues.
Furthermore,youcanmultiplyanddividenumbers,orcomputetheremainderofadivision.
Neither thearithmetic functions of package Math, , nor r thestringmethods are available in
the sequence expressions. . Use e the entities from the rule language for realcomputational
work,youcanreusethemeasily,justcallthefunctions fromthesequenceexpressions,the
proceduresfromthesequencestatements,andtherules/testsfromthesequences.
PrimarySequenceExpression
-
BasicSequenceExpression
-
SpecialSequenceExpression
-
Theatomsofthesequenceexpressionsarethebasicandthespecialsequenceexpressions.
BasicSequenceExpression
-
def
-
(
-
Variable
,
-
)
-
@
-
(
-
NameString
-
)
-
GraphElement
-
.
-
Attribute
-
Variable
-
Literal
-
Thebasicsequence expressionsare the foundationalvalue sources. . Adef f termis suc-
cessfuliallthevariablesaredened(notnull). Theatoperatorallowstoaccess s agraph
elementby its persistent name. . Theattributeaccess s clausereturnsthe attributevalue of
thegivengraphelement. The e variableandliteralbasicexpressions arethesameas inthe
SimpleOrInteractiveExpression,cf. 9.3;thismeansesp. thataVariablemaydenoteagraph
globalvariableifprexedwithadoublecolon,hereaswellasintheAssignmentTarget.
SpecialSequenceExpression
-
Variable
-
[
-
SequenceExpression
-
]
-
GraphElement
-
.
-
Attribute
-
[
-
SequenceExpression
-
]
-
GraphElement
-
.
-
visited
-
[
-
SequenceExpression
-
]
-
FunctionMethodCall
-
FunctionCall
-
Thespecialsequenceexpressionsareusedforstoragehandling,forgraph,subgraphand
visited aghandling,forrandomvaluequeries,fortypeofqueries,andforindexaccess.
Thestorageorientedonesareusedtoaccessastorageortocallamethodonastorage
(note: hereitisnotpossibletobuildmethodcallchains). Theywereintroducedinchapter
13,andaresummarizedbelowin17.4.
Thegraphandsubgraphhandlingexpressionsallowtoquerythegraphforitselements,
thevisited agsexpressionsallowtocheckwhetheravalueismarked. Theywereintroduced
inchapter14,andaresummarizedbelowin17.3.
VB.NET Image: How to Create Visual Basic .NET Windows Image Viewer
If you need a format conversion, it is also available including png, jpeg, gif, tiff, bmp, PDF, and Word from that, you are entitled to change the orientation
convert online pdf to jpg; pdf to jpg
VB.NET PDF - Convert PDF with VB.NET WPF PDF Viewer
Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. Export PDF to TIFF file format. Convert PDF to image formats, such as PNG, JPG, BMP
change pdf to jpg image; .net pdf to jpg
17.3 GraphandSubgraphBasedQueriesandUpdates
203
Therandomvaluefunctionrandombehavesliketherandomfunctionfromtheexpressions,
see6.8;i.e. ifnoteddownwithanintegerasargumentitreturnsarandomintegerinbetween
0andthatupperbound,exclusive;ifgivenwithoutanargumentitreturnsarandomdouble
inbetween0.0and1.0,exclusive.
Thetypeoffunctionreturnsthetypeasstring,foranarbitraryGrGen.NET-objectfed
asinput. Thereisnotypetypesupportingtypecomparisonsasintherulelanguageexisting,
youarelimitedtostringcomparisons.
Theindex functions allowtofetchelements basedonthenameor the unique-id,or to
retrievethe name or theunique-id. . Available e are nameof tofetchthenameofa node or
edgeorgraphanduniqueoftofetchtheuniqueidofanodeoredgeorgraph.Thefunction
nodeByNameallowstoretrieveanodebyitsname,edgeByName()doesthesameforanedge.
ThefunctionnodeByUniqueallows toretrieveanodebyitsuniqueid,edgeByUniquedoes
thesameforanedge.Youndmoreonthemin22.
EXAMPLE(99)
Thesequenceexpression{{ def(y) && y.meth(x)>=y.a || @("$1").a+1 != func(x) }}
checkswhetherthenode typedvariable yis dened,i.e. . not t null,andif so compares the
returnvalueofamethodofthattypewithanattributevalue. Ifthecomparisonsucceeds,
it denes the e return value e of the e expression; ; in n case e the e denedness s check failed or r the
comparisonyieldsfalse,isagraphelementfetchedfromthegraphbyitspersistentname$1,
anditsattributeaplus1comparedagainsttheresultofafunctioncall. Thentheresultof
thislattercomparisondenestheoutcomeoftheexpression.
17.3 GraphandSubgraphBasedQueriesandUpdates
Thegraphandsubgraphorientedpartsofthesequenceexpressionsarebuiltfromfourgroups,
theproceduresforbasicgraphmanipulation,thefunctionsforqueryingthegraphstructure,
thefunctionsandproceduresofthesubgraphoperations,andthevisited agquery,assign-
ment,andprocedures.
Therstgroupisbuiltfrombasicgraphmanipulationoperators,asdenedin12.4and
describedin12.5.2.Elementsmaybeadded,removed,orretyped,andnodesmaybemerged
or edges redirected. . Not t available e are numerical functions, they are e only oered d by y the
computationsoftherules.
EXAMPLE(100)
The sequence compuation { (::x)=add(N); (::x)=retype(::x,M); rem(::x) } adds a
newlycreatednodeoftypeNtothegraph(storingitintheglobalvariable::x),retypesit
toM,andnallyremovesitagainfromthegraph.
Thesecond groupis built t from m the operators s queryingprimarily the connectedness of
graph elements, , as s dened d in 12.5.1. You u may y ask for one for the e nodes or r edges of a
type. Youmay y query for theother for the source or target or opposite node of anedge.
Furthermore,youmayqueryforadjacentnodesandincidentedges,maybeeventransitively
forthereachability. Furthermoreyoumayaskwithapredicatewhethernodesoredgesare
adjacentorincidenttoothernodesoredges,maybeeventransitivelyforreachability.
204
SequenceComputations
EXAMPLE(101)
for{x:N in nodes(N); ; for{::y y in n outgoing(x); ; { ::z=target(::y); ::z.a = 42 } } } }
isasequencesthatsetstheattributeato42forallnodesthatareadjacentastargetstoa
sourcenode xof type N.Youwillreceivea runtimeexceptionifthetypeof ::z does not
possessanattributea.
Amorerealisticexampleistocheckwhethertwonodesreturnedbysomeruleapplications
arereachablefromeachother,carryingoutachangeonlyinthiscase:
(::x)=r() ;> (::y)=s() ) ;> if{ {{isReachable(::x,::y)}} ; ; doSomething(::x, , ::y) ) }
Thethirdgroupis dened d by y functions andprocedures that operate on n (sub-)graphs,
asdenedin12.5.1and 12.5.2. They y areespecially usefulinstate space enumeration, , cf.
19.7. Tothis s end, , parallelizedgraph isomorphy y checking with h the e equalsAny y functionis
especially of f interest. . You u may y import, , clone, , or r compute induced d subgraphs. . You u may
exportasubgraphorinsertasubgraphintothehostgraph.
EXAMPLE(102)
( doSomething() ;> > { { File::export("graph"+i+".grs") ) } } )*isasequenceschemefor
exportingagraphaftereachiterationstepinaloop,gainingaseriesofsnapshotsonthehard
drive. Inalater r step,youmaythenconditionallyaddexportedgraphstothehostgraph:
if{cond; { ::g=File::import("graph"+n.a+".grs"); ; insert(::g) ) } }
17.4 StorageHandlingintheSequences
205
EXAMPLE(103)
WhenyoumodelastatespacewithGraphrepresentativenodes (not t graphstandingfora
real(sub)graph),whichare pointingwith contains edges to the nodes containedintheir
state(i.e. subgraph),andstoreadditionallyareplicaofthesubgraphinasubattributeof
the Graph node, so it is readily available for comparisons, thenthe step of a state space
enumerationwithisomorphicstatepruningiscontrolledwithcodelikethis:
<< modifiyCurrent(gr) ;; {adj=adjacent(gr, , contains); sub=inducedSubgraph(adj)}
Insidethebacktrackingdouble angles,anewstateis computedas rst stepbymodifying
thecurrentlyfocusedstatereceivedasinputgr:Graphfromthepreviousstep.Themodied
subgraphisextractedfor comparisonbycomputingthe inducedSubgraphfromthenodes
adjacentviacontains-edgestothegr-node.
;> for{others:Graph in nodes(Graph); {{sub!=others.sub}} } } } &&
The extracted subgraph is s compared with all already enumeratedsubgraphs s that can n be
accessedbytheirGraphrepresentativenode.Onlyifnoneisisomorphictoit,dowecontinue
withmakingthestatepersistent.
/ {(ngr)=insertInduced(adj, , gr)} && link(gr,ngr) ) && & {ngr.sub=sub} /
During a a backtracking pause, , the e modied subgraph h is s cloned and inserted  atly into
the host t graph h again n with h insertInduced. . A A link is s added d from the old representative
to this s new representative, to o re ect t ancestry. . Then n the e subgraph h attribute e of f the e new
representative ngris lledwiththepreviouslycomputedsubgraphsub. . Remark: : therst
inducedSubgraph above does s not t contain n the representative node andthus s is missingall
containmentedges,too. ThisinsertInducedincludestherepresentativenodeandthusthe
containment edges. . Syntactical l remark: : inducedSubgraph h is s usedin anassignment t with
a functioncallas RHS,whereas insertInduced is employedfrom aprocedurecallwhich
requiresparenthesisaroundtheoutputarguments.
&& stateStep(ngr, level+1) ) >>
Finally,wecontinuestatespaceconstructionwiththenextstep,modifyingthejustinserted
subgraph. Afterthisstepreturns(withfalseasresult),dothebacktrackingdoubleangles
rollbackthemodication{keepingthechangeswrittenduringthepauseuntouched{and
executemodifyCurrentonthenextmatchavailableingr.
Thefourthgroupare the visited ags relatedoperations,asdescribedinchapter 14.6.
Availableisanexpressionforreadingavisited ag,anassignmentforwritingavisited ag,
andproceduresformanagingthevisited agsasdenedin12.4.
EXAMPLE(104)
Becauseoftheneedtoallocateanddeallocatethem,thevisited agsaretypicallyusedwith
codelikethis: flag:int ;> {(flag)=valloc()} } ;> r(flag) ;> {vfree(flag)}
In addition, , they y may y be read d in n the e sequence e expressions, , and d written in the sequence
computations: if{ {{!n.visited[flag]}} } ; ; { n.visited[flag] = = true } } }
Inthesequencesonlythesequenceexpressionsareavailabletocomputetheparametersfor
thefunctionsandprocedures,comparedtothefull- edgedexpressionsofthecomputations
language.
17.4 StorageHandlingintheSequences
Storagesare variables ofcontainer(set/map/array/deque)type(cf. 14.1) storingnodes or
edges. Theyareprimarilyusedinthesequences,fromwheretheyarehandedintotherules
206
SequenceComputations
viarefparameters(butadditionallycontainerattributesingraphelementsmaybeusedas
storages, esp. . for r doing data ow analyses, , cf. 19.6). They y allowtodecouple processing
phases:therstruncollectsallgraphelementsrelevantforthesecondrunwhichconsistsof
asequenceexecutedforeachgraphelementinthecontainer.Thesplittingoftransformations
intopassesmediatedbycontainervaluedglobalvariablesallowsforsubgraphcopyingwithout
modelpollution,cf. 19.5;pleasehavealookat19,19.5and19.6regardingadiscussionon
whentousewhichtransformationcombinatorsandforstorageexamples.Theywerealready
denedanddescribedin13. Hereweonly y givesome renements andexplanations of the
semantics.
Themethodsadd,rem,clearareavailableforallstoragesandallowtoaddelementsto
thecontainer,removeelementsfromthecontainer,orclearthecontainer.Theirreturnvalue
isthechangedcontainer,thustheyallowtochainmethodcallsonthecontainer.
Themethodssize,empty,peekincontrastreturnthesizeofthecontainer,whetherthe
containerisempty,oracertainelementfromthecontainerandthuscan’tbechained. The
indexedqueryv=m[k]isavailableonmapandarrayanddequetypesandreturnstheelement
atthespeciedindex,theindexedassignmenta[i]=voverwritestheelementatthespecied
index.Furtheravailablearethesequenceexpressionoperatorinformembershipquery.
Theinxoperators,themethodsspecictoacertaincontainertype(i.e.notavailablefor
allcontainertypes),andthechangeassignmentsincontrastarenotavailableinthesequence
computations,theyareonly supportedbythecomputationsintherulelanguage.
Youmayiterateinthesequenceswithaforloopovertheelementscontainedinastorage.
RewriteFactor
-
for
-
f
-
Var
-
in
-
SetVar
-
Var
-
->
-
Var
-
in
-
MapVar
-
Var
-
in
-
ArrayVar
-
Var
-
->
-
Var
-
in
-
ArrayVar
-
Var
-
in
-
DequeVar
-
Var
-
->
-
Var
-
in
-
DequeVar
-
;
-
RewriteSequence
-
g
-
Theforcommanditeratesoverallelementsinthesetorarrayordeque,orallkey-value
pairsinthemaporarrayordeque,andexecutesforeachelement/key-valuepairthenested
graphrewritesequence;itcompletessuccessfullyiallsequenceswereexecutedsuccessfully
(anemptycontainercausesimmediatesuccessfulcompletion);thekeyinthekey-valuepair
iterationofanarrayordequeistheintegertypedindex. (See18.3foranotherversionofthe
forcommand.)
Documents you may be interested
Documents you may be interested