This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de (internal network only) to import your old projects to the new GitLab platform 📥

WeakStepAdder.scala 701 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package de.bbisping.coupledsim.algo

import scala.annotation.migration
import de.bbisping.coupledsim.ts.TransitionSystem
import de.bbisping.coupledsim.util.FixedPoint
import de.bbisping.coupledsim.util.Relation
import de.bbisping.coupledsim.util.LabeledRelation

class WeakStepAdder[S, A, L] (
    ts: TransitionSystem[S, A, L],
    transitiveSteps: Set[A]
    ) {
  
  def compute() = {
    val newTrans = for {
      s0 <- ts.nodes
      tau1 <- transitiveSteps
      s1 <- ts.post(s0, tau1) + s0
      (a, ss2) <- ts.post(s1)
      s2 <- ss2
      tau2 <- transitiveSteps
      s3 <- ts.post(s2, tau2) + s2
    } yield (s0, a, s3)
    
    new LabeledRelation(ts.step.tupleSet ++ newTrans)
  }
  
}