Esempio n. 1
0
 class main(model.Module):
     v = model.Var(model.Boolean())
     i = model.IVar(model.Boolean())
     INIT = [model.Case(((model.Trueexp(),
                          model.Comment(~v, "Initially FALSE")),))]
     TRANS = [model.Case(((v,
                           model.Comment(
                           model.Comment(v.next(), "Stay true"),
                           "when v is already true")),
                          (~i, model.Comment(v.next() == v,
                                             "Stay the same")),
                          (~v & i, v.next()),
                          (v & i, model.Comment(~v.next(),
                                                "Change to false"))))]
 class agent(md.Module):
     v = md.Var(md.Boolean())
     a = md.IVar(md.Boolean())
     INIT = v
     TRANS = (v.next() == a)
Esempio n. 3
0
 class main(model.Module):
     run = model.IVar(model.Boolean())
     c1 = model.Var(Counter(run))