archive-org.com » ORG » C » CPNTOOLS.ORG

Total: 415

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Color sets << CPN Tools Homepage
    from your book Show modify book 32 page s Help Color sets A color set is compound if it is constructed from other color sets otherwise it is simple Simple color sets Unit color sets Boolean color sets Integer color sets Large Integer color sets Real color sets Time color sets String color sets Enumerated color sets Index color sets Compound color sets using previously declared color sets Product color

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/colorsets/start (2016-04-26)
    Open archived version from archive


  • Variables << CPN Tools Homepage
    to the transition There can be multiple bindings simultaneously active on different transitions These bindings can exist simultaneously because they have different scopes The extent of a CPN variable binding is the firing of a particular transition They provide arc inscriptions with the ability to reference different values If a variable is from a color set with less than 100 elements the simulator is always able to bind a value to it Declaration Syntax var id1 id2 idn cs name where idi must be an CPN ML identifier is the syntactic separator between the identifier s cs name is the name of a previously declared color set Declaration Examples var i j k INT var intList IntList Reference variables A reference variable is similar to a pointer in C The scope of a reference variable is the entire CPN Reference variables must never be used in any way that affects the enabling of transitions To illustrate the problems that could arise if this rule were broken consider the following example A reference variable refvar is used in arc inscriptions for input arcs of two different transitions transition A and transition B Both are enabled and transition A fires Transition A changes the value of refvar in such a way that transition B is no longer actually enabled However the simulator has no way of knowing this since enabled transitions are not rechecked before they are fired to recheck each time a transition is chosen for firing would degrade performance to the point of unusability Attempting to fire transition B results in unpredictable system errors Reference variables may be read and updated in code segments Reference variables may be read in Output arc inscriptions on output arcs from transitions Arc delay inscriptions on output arcs from transitions Time inscriptions for transitions

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/variables (2016-04-26)
    Open archived version from archive

  • Functions, declarations, and control structures << CPN Tools Homepage
    function It is a function with two parameters a constant and a list and it multiplies each entry in the list with the constant returning the result fun listMult c x xs c x listMult c xs listMult nil nil To turn a function f with two parameters into an infixed operator write infix f Two additional examples of functions are described under Example declarations Local declarations The let construct permits the declaration of locally scoped variables within a function definition In addition let may be used within a code segment Syntax let val pat1 exp1 val pat2 exp2 val patn expn in exp end Examples let val file id TextIO openOut tmp outputfile txt val theString The transition occurred again n val TextIO output file id theString in TextIO closeOut file id end This let statement could be used in a code segment to save a string in a file each time the corresponding transition occurs Control structures Two control structures are available if then else and case Syntax if bool exp then exp1 else exp2 where exp1 and exp2 have the same type case exp of pat1 exp1 pat2 exp2 patn expn where exp1 exp2 expn all have the same type Examples if x 3 then x is less than three else x is greater than or equal three This expression checks whether the value bound to x is less than three and returns an appropriate string as a response if x p then 1 e else 2 e This expression checks whether the value bound to x is equal to p If x is equal to p then the expression evaluates to the multi set consisting of one e otherwise it returns the multi set consisting of 2 instances of e case day of Mon Today is

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/functions (2016-04-26)
    Open archived version from archive

  • Value declaration << CPN Tools Homepage
    CPN ML identifier and exp is a CPN ML expression including multiset expressions The expression represents the value to be associated with the identifier Declaration Examples Value declarations expressions may use any value representation that is syntactically unique without a prior color set declaration These include unit bool int real string tuple list record val buffer size 10 val string val A string constant val listVal 1 2 5 val

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/values (2016-04-26)
    Open archived version from archive

  • CPN ML identifier << CPN Tools Homepage
    book Book creator Remove this page from your book Show modify book 32 page s Help CPN ML identifier The CPN ML identifiers are alphanumeric sequences of letters digits primes apostrophes and underscores starting with a letter They are used for Color sets Record color set field labels Value constructors Variables Operators and function symbols Prefixes of place transition and page names when using the state space tool Examples These

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/identifiers (2016-04-26)
    Open archived version from archive

  • Reserved identifiers << CPN Tools Homepage
    names new values for unit in Unit color set new values for true and false in Boolean color set identifiers in Enumeration color set Index color sets Record color sets or Union color sets The following identifiers are reserved Arc abstype action all and andalso as bool by case color colorset colset datatype declare do else empty end EntireGraph eqtype exception Fair false fn fun functor globref handle if Impartial

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/reserved_identifiers (2016-04-26)
    Open archived version from archive

  • Loading declarations from file << CPN Tools Homepage
    creator Remove this page from your book Show modify book 32 page s Help Loading declarations from file Declarations can be loaded from text files using the use declaration Declaration Syntax use filename where filename is a string indicating the name of the file to be loaded Example use models HierarchicalProtocol functions sml use valueDeclarations sml The file name can contain either absolute or relative paths For additional details about

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/loading_declarations_from (2016-04-26)
    Open archived version from archive

  • Example declarations << CPN Tools Homepage
    i d j where i and j are integers between 1 and 4 For example the value d 1 d 4 is an element in PR but the value d 1 d 10 is not an element in PR fun diff x y x y Declares a function named diff which has two formal parameters x and y The function returns true if the values bound to x and y are not equal otherwise returns false colset MES subset PR by diff Declares a subset color set named MES which is a subset of the color set PR The color set MES consists of the values of PR that are mapped to true by the function diff For example the value d 1 d 2 is in MES but the value d 3 d 3 is not in MES colset E with e Declares an enumerated color set named E The only element in E is the value e fun Mes s PR mult 1 s DBM all 1 s Declares a function named Mes which has one formal parameter s The function Mes returns a multiset of elements from the color set PR The multiset that is returned by Mes is generated using the function PR mult The function mult is one of the color set functions that is available for product color sets The two arguments for the function PR mult are multisets of elements from the color set DBM The first argument consists of the multiset 1 s i e the multiset consists of a single element and the value of the element is determined by the binding of the parameter s The second multiset is generated using the DBM all function and multiset subtraction Evaluating the color set function DBM all will result in the multiset

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/example_declarations (2016-04-26)
    Open archived version from archive



  •