object TS {
abstract class Node
case class TaskSet(tasks: Set[Task]) extends Node
case class Task(id: Int) extends Node
}
I want to specify the execution of this TaskSet as rewriting rules with non-determinism. A Task is selected randomly from the TaskSet and executed (= removed from the set). Alternatively, it can be described with set notation as:
TaskSet(s \in S) -> TaskSet(S\s)
or
--
You received this message because you are subscribed to the Google Groups "kiama" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kiama+un...@googlegroups.com.
To post to this group, send email to ki...@googlegroups.com.
Visit this group at https://groups.google.com/group/kiama.
For more options, visit https://groups.google.com/d/optout.
--
Hi Tony,OK. I had a feeling that such patterns were not supported, but I wanted make sure that I was not missing something. Thank you for your quick responses!Your suggestion does work for my example. Unfortunately, my original problem before simplification is a bit more involved. Only a subset of the taskset can be selected for removal depending on other state information. You can think of it as a task graph where a task may only fire when its dependences are satisfied. Checking for these dependences requires more complex pattern matching that would ultimately require one of the two forms of pattern in the example.Thanks,Tomofumi Yuki
2018年4月3日火曜日 0時12分06秒 UTC+2 Tony Sloane: