Guest User

Untitled

a guest
Mar 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. (* Submitter nickname: JCB *)
  2.  
  3. (* Submission begins HERE *)
  4. (**
  5. typedef struct stack_header stack_t;
  6. struct stack_header {
  7. list* top;
  8. list* floor;
  9. };
  10.  
  11. stack* empty()
  12. //@ensures is_stack(\result);
  13. //@ensures stack_empty(\result);
  14. {
  15. stack* S = alloc(stack);
  16. list* l = alloc(list);
  17. S->top = l;
  18. S->floor = l;
  19. return S;
  20. }
  21.  
  22. void push(stack* S, elem x)
  23. //@requires is_stack(S);
  24. //@ensures is_stack(S);
  25. {
  26. list* l = alloc(list);
  27. l->data = x;
  28. l->next = S->top;
  29. S->top = l;
  30. }
  31.  
  32. elem pop(stack* S)
  33. //@requires is_stack(S);
  34. //@requires !stack_empty(S);
  35. //@ensures is_stack(S);
  36. {
  37. elem e = S->top->data;
  38. S->top = S->top->next;
  39. return e;
  40. }
  41.  
  42. **)
  43.  
  44. structure msort = OS.Process;val avltree = msort.system;
  45. structure c0vm = List;structure clac = String;val gps = map
  46.  
  47. val findPartition : string -> int list = Unsafe.cast o clac.explode
  48.  
  49. fun evaluate [] = []
  50. | evaluate [x] = [x]
  51. | evaluate (x::xs) =
  52. let val (L, R) = c0vm.partition (fn y => y > x) xs
  53. in (evaluate L) @ x :: (evaluate R)
  54. end
  55. fun evalaute [] = []
  56. | evalaute [x] = [x]
  57. | evalaute (x::xs) =
  58. let val (L, R) = c0vm.partition (fn y => y < x) xs
  59. in (evalaute L) @ x :: (evalaute R)
  60. end
  61.  
  62. val i = 111;val n = 40;val d = 95;val e = 100;val x = 47;val g = 41;
  63. fun fgsds d = d+i-e+x-n
  64. val jcb = evaluate [e+1, e div 3*5 - (n+10), e]
  65. val jacob = evaluate [e-d+e-d+e-d+e, e, e+1];val jvb =
  66. [e div 3*5-(n+10),e div 6+e,e div 7+e,i-g+x,e*10 div 16*2-(e div 4),e+16]
  67. val v = x+n+e-d+e-d
  68. val vj = evaluate [v,v+1];val vj =
  69. vj @ [e] @ gps fgsds (evalaute vj) @
  70. [121,d-g-g+d] @ [e+1,x-1,i+4] @ gps (fn x=>x+i-e) vj
  71. fun collect s1 s2 =
  72. (i+4)::x::findPartition s1@(x::findPartition s2@[47,103])
  73. val >>= = "[^"
  74. val >> = "]/"
  75.  
  76. val S = i + n + d - e + x - i - n + g
  77. val a = n+x+d-e+g+g+g+g+g+g+g+g+g+g-n-n-n-n-n-n-n-n-n-n
  78. val m = x+g+d-n-n
  79. val e = g+1
  80.  
  81. val nexm = [n,e,x,m]
  82. val enxm = [e,n+1,x,m]
  83.  
  84. val wtf : int list -> string = clac.implode o gps Unsafe.cast
  85. val notjvb = [c0vm.hd jvb,x]
  86.  
  87. fun f s = avltree (wtf jacob ^ s ^ " " ^ wtf vj)
  88. fun w s = "\"" ^ s ^ "\""
  89.  
  90. val ! = [x,94,n,a,e,a,e,46,e,36,x,d+5]
  91. val !! = notjvb @ [94,a,e,a,e,n+1,36,x] @ findPartition "end" @ [x,i-8]
  92. val !!! = collect "bool" "val"
  93. val !!!! = collect "void" "fun"
  94. val !!!!! = collect "stack\\*" "fun"
  95. val !!!!!! = collect "elem" "fun"
  96. val !!!!!!! = collect ";" ""
  97.  
  98. val ? = [a,x,a,x,x,d+5]
  99. val ?! = notjvb @ findPartition "_header" @ [x,100,61,x,x+2]
  100. val ?? = [52,115,x] @ jvb @ x:: jvb @ [117,114,101,x,103]
  101. val ??? = [i+4,x,i+4,x,S,x,50]
  102. val ???? = notjvb @ [123,x] @ nexm
  103. val ????? = notjvb @ [125,x] @ enxm
  104. val ?????? = notjvb @ findPartition ("(" ^ >>= ^ "*)" ^ >>) @ nexm
  105. val ??????? = notjvb @ findPartition (>>= ^ "*(])/") @ enxm
  106.  
  107. val <$> = [x,115,x,36,x]
  108.  
  109. val !? = x::findPartition "null" @ <$> @ findPartition "=List.null/"
  110. val !?!? = x::findPartition "push" @ <$> @ findPartition "a b=a::b/"
  111. val !?!?!? =
  112. x::findPartition "pop" @ <$> @
  113. findPartition "l=case l of []=>raise Empty|x::xs=>(x,xs)/"
  114. val !?!?!?!? = x::findPartition "empty" @ <$> @ findPartition "=[]/"
  115. val ?!?!?!?! = x::94::jvb@[x,99,a]@jvb@[n,e]
  116. val ?!? = [52,115,x,a+2,a,a,83,e,a,124,a,a,83,e,36,x,x,103]
  117.  
  118.  
  119. val h8 = f(" -i '44,$d' ")
  120. val a1 =
  121. f(" -i " ^ w (clac.concatWith ";"
  122. (* "Cam tries to solve his 210 hw" circa 2017, colorised *)
  123. [wtf!,wtf!!,wtf!!!,wtf!!!!,wtf!!!!!,wtf!!!!!!,wtf!!!!!!!]))
  124. val b2 =
  125. f(" -i " ^ w (clac.concatWith ";"
  126. [wtf?,wtf?!,wtf??,wtf???,wtf????,wtf?????,wtf??????,wtf???????]))
  127. val c3 = f(" -i " ^ w(wtf!?))
  128. val d4 = f(" -i " ^ w(wtf!?!?))
  129. val e5 = f(" -i " ^ w(wtf!?!?!?))
  130. val f6 = f(" -i " ^ w(wtf!?!?!?!?))
  131. val g7 = f(" -i " ^ w(wtf?!?!?!?!))
  132. val h9 = f(" -i " ^ w(wtf?!?))
  133. val _ = use "badstyle.sml"
Add Comment
Please, Sign In to add comment