Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. from random import *
  2. p1 = 0.750000
  3. p2 = 0.250000
  4. m = 0
  5.  
  6.  
  7. Axiom: _(1)[f(50)+90f(10)]-(90)P(1,0)
  8. derivation length: 60
  9.  
  10. # A = branching state
  11. # B = non-branching state
  12.  
  13. def Start():
  14. global m
  15. m = 0
  16.  
  17. production:
  18.  
  19. P(x,t) :
  20. if t <= 1 : produce T[G(x)]+(180)P(x,t+1)
  21. else :
  22. global m
  23. m = 1
  24. produce *
  25.  
  26. G(x) :
  27. if m==1 :
  28. produce +(90)S(x)
  29.  
  30. S(x) :
  31. if random() <= 0.5: produce A(x)
  32. else: produce B(x)
  33.  
  34. A(x) :
  35. if random() <= p1: produce I[M(x)]A(1-x)
  36. else: produce I B(1-x)
  37.  
  38. B(x) :
  39. if random() <= p2: produce IB(1-x)
  40. else: produce I[M(x)]A(1-x)
  41.  
  42. homomorphism:
  43.  
  44. T : produce ;(1)f(0);(1)@c(1)
  45. M(x) :
  46. if x==0 : produce ;(2)+F(0)
  47. elif x==1 : produce ;(2)-F(0)
  48.  
  49. I : produce ;(1)F(2)
  50.  
  51.  
  52. endlsystem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement