From: Johannes Giere To: designCPN@daimi.au.dk Date: Tue, 22 Jul 2003 16:29:18 +0200 Subject: (dCPN) Accessing values in lists of tuples I have a question concerning the use of functions with lists of tupels: A list, which is based on a tupel colorset should be used to model a system. color A = string; color B = int; color C = string; color ABC = product A*B*C; color ABClist = list ABC; var a : A; var b : B; var c : C; var abc : ABC; The following questions respectively problems occur: 1. What is the formal type of ABClist? A list or rather something like a listpair structure? The question is, which predefined functions may I use in the context of this list (e.g. list.find) ? 2. How can I construct a query based on only one element of the tuple? Example: The ABClist may contain the following initial marking [("o",2,"p"),("u",3,"m")]. Now I would like to model a decision based on the second value of the tuple, i.e. var b? The transition should only fire, i.e. the list of all tuples should only be transmitted if any of the variables b evaluates to 5. Among other functions I tried to model this problem by means of the predefined function exists, but various misunderstandings between Design/CPN and me occurred due to the fact that I do not know how to get a hold of a variable inside the tuple. 3. If the problem described before can be solved, another question arises. If I know that there exists a tuple containing for example a value b=5, it would also be of utmost interest to receive the values of the corresponding tuple, i.e. the values of a and c (for the case b=5). The problems/questions stated above are mainly based on the fact that I have no idea on how to get access to information stored within the tuple, of course only if the tuple is part of a list. Thanks a lot Johannes Giere ------------------------------------------------------------------------------ Dipl.-Ing. Johannes Giere Institut für Geotechnik // Institute of Geotechnics Technische Universität Darmstadt // Darmstadt University of Technology Petersenstraße 13 64287 Darmstadt GERMANY fon +49-6151-16 34 49 fax +49-6151-16 66 83 e-mail giere@geotechnik.tu-darmstadt.de ---------------------------------------------------------------------------- --- --- [[ Post messages and summary of replies: designCPN@daimi.au.dk ]] [[ To (un)subscribe, send "help" to: Majordomo@daimi.au.dk ]] [[ The moderator's address: designCPN-owner@daimi.au.dk ]] [[ World Wide Web URL: http://www.daimi.au.dk/designCPN/email/ ]]