I'm trying to do a pattern-matching function in CPN Tools using SML.
I have defined a colorset EVENT: colset EVENT = product EVENTTYPE * EVENTTIME timed;
When comparing lists, I am only interested in the Event Type, so I'm trying to compare e.g. [a,b]
to [ (a,0), (b,1) ]
to - so I wrote the following SML-function which compares two lists:
fun pattern_match _ [] = true
| pattern_match [] [x] = false
| pattern_match (x::xs) (y::ys) =
if #1 x = y
then pattern_match xs ys
else pattern_match xs (y::ys)
which only gives me an unspecified compiler error in evalloop.sml Since I'm fairly new to SML, my guess is the CPN-Tools #-operator is not supported by SML. Unfortunately I have no idea how to extract only the part of the tuple from the first list that I'm actually interested in. Any help on this?