PageRenderTime 48ms CodeModel.GetById 7ms RepoModel.GetById 0ms app.codeStats 1ms

/E/development_tools/do_dp_plots.py

#
Python | 406 lines | 214 code | 109 blank | 83 comment | 6 complexity | fa7c13185fddeba34b8f72ab19808c4a MD5 | raw file
Possible License(s): LGPL-2.1
  1. #!/usr/bin/env python2.7
  2. # ----------------------------------
  3. """
  4. Usage: do_dp_plots.py [Options]
  5. Create a number of plots from test data on the theory of arrays. This
  6. is rather specialized code. To change the number or contents of the
  7. plots, edit the code below.
  8. Plots can be displayed on the screen or written as eps files.
  9. Options:
  10. -h
  11. Print this information and exit.
  12. -f
  13. Create result files (default is to display graphs via X)
  14. -d<directory>
  15. Point to the directory where the result files can be found. This
  16. overrides the hard-coded default.
  17. Copyright 2004, 2005 Stephan Schulz, schulz@eprover.org
  18. This code is part of the support structure for the equational
  19. heorem prover E. Visit
  20. http://www.eprover.org
  21. for more information.
  22. This program is free software; you can redistribute it and/or modify
  23. it under the terms of the GNU General Public License as published by
  24. the Free Software Foundation; either version 2 of the License, or
  25. (at your option) any later version.
  26. This program is distributed in the hope that it will be useful,
  27. but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. GNU General Public License for more details.
  30. You should have received a copy of the GNU General Public License
  31. along with this program ; if not, write to the Free Software
  32. Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33. MA 02111-1307 USA
  34. The original copyright holder can be contacted as
  35. Stephan Schulz (I4)
  36. Technische Universitaet Muenchen
  37. Institut fuer Informatik
  38. Boltzmannstrasse 3
  39. Garching bei Muenchen
  40. Germany
  41. or via email (address above).
  42. """
  43. import re
  44. import sys
  45. import os.path
  46. from os import system
  47. import pylib_io
  48. import pylib_graphs
  49. cvc_sc_pat = re.compile("storecomm_[^i].*nf_ai")
  50. cvc_scf_pat = re.compile("storecomm_[^i].*sf_ai")
  51. e_sc_pat = re.compile("storecomm_[^i].*sf_ai")
  52. e_sc_ni_pat = re.compile("storecomm_[^i].*sf_ni")
  53. cvc_si_pat = re.compile("storeinv_[^i].*nf_ai")
  54. cvc_sif_pat = re.compile("storeinv_[^i].*sf_ai")
  55. e_si_pat = re.compile("storeinv_[^i].*sf_ai")
  56. cvc_sw_pat = re.compile("swap_[^i].*nf_ai")
  57. cvc_swf_pat = re.compile("swap_[^i].*sf_ai")
  58. e_sw_pat = re.compile("swap_[^i].*sf_ai")
  59. cvc_scinv_pat = re.compile("storecomm_invalid.*nf_ai")
  60. cvc_scfinv_pat = re.compile("storecomm_invalid.*sf_ai")
  61. e_scinv_pat = re.compile("storecomm_invalid.*sf_ai")
  62. e_scinv_ni_pat = re.compile("storecomm_invalid.*sf_ni")
  63. cvc_siinv_pat = re.compile("storeinv_invalid.*nf_ai")
  64. cvc_sifinv_pat = re.compile("storeinv_invalid.*sf_ai")
  65. e_siinv_pat = re.compile("storeinv_invalid.*sf_ai")
  66. cvc_swinv_pat = re.compile("swap_invalid.*nf_ai")
  67. cvc_swfinv_pat = re.compile("swap_invalid.*sf_ai")
  68. e_swinv_pat = re.compile("swap_invalid.*sf_ai")
  69. cvc_ios_pat = re.compile("ios_t1_ios_bia_np_sf_ai.*cvc")
  70. e_ios_pat = re.compile("ios_t1_ios_np_sf_ai.*tptp")
  71. #cvc_circqueue_pat = re.compile("circular_queue_t1_record_ios_mod_np_sf_ai.*cvc");
  72. #cvc_queue_pat = re.compile("queue_t1_record_ios_np_sf_ai.*cvc");
  73. #e_circqueue_pat = re.compile("circular_queue_t1_record_ios_mod_np_sf_ai.*tptp");
  74. #e_queue_pat = re.compile("queue_t1_record_ios_np_sf_ai.*tptp");
  75. cvc_circqueue_pat = re.compile("circular_queue_t1_native_record_ios_mod_np_sf_ai.*cvc");
  76. cvc_queue_pat = re.compile("queue_t1_native_record_ios_np_sf_ai.*cvc");
  77. e_circqueue_pat = re.compile("circular_queue_t1_native_record_ios_mod_np_sf_ai.*tptp");
  78. e_queue_pat = re.compile("queue_t1_native_record_ios_np_sf_ai.*tptp");
  79. dir = "/Users/schulz/SOURCES/Projects/VERONA/dp/array/TEST_RESULTS/"
  80. files = False
  81. options = pylib_io.get_options()
  82. for o in options:
  83. if o == "-f":
  84. files = True
  85. if o[0:2] == "-d":
  86. dir = o[2:]
  87. if o=="-h":
  88. print __doc__
  89. sys.exit()
  90. if dir[-1]!="/":
  91. dir = dir + "/"
  92. dir = os.path.expanduser(dir)
  93. plot_list = []
  94. sd = {
  95. "CVC" : 1,
  96. "CVC Lite" : 2,
  97. "CVC (flattened)" : 3,
  98. "CVC Lite (flattened)" : 4,
  99. "E (sts11), built-in index type" : 5,
  100. "E (sts11), axiomatized indices" : 6,
  101. "E (sts11)" : 6, # Intentional reuse!
  102. "E (good-lpo), built-in index type" : 5,
  103. "E (good-lpo), axiomatized indices" : 6,
  104. "E (good-lpo)" : 6, # Intentional reuse!
  105. "E (sts28)" : 7,
  106. "E (std-kbo)" : 7,
  107. "E (auto)" : 8
  108. }
  109. pylib_graphs.style_dict = sd
  110. # All systems with system-specific input - T1
  111. # Storecomm
  112. data = [
  113. ("CVC" , dir+"protokoll_CVC_Auto", cvc_sc_pat),
  114. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_sc_pat),
  115. ("E (good-lpo), built-in index type" , dir+"protokoll_E_sts11_t1", e_sc_ni_pat),
  116. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_sc_pat)
  117. ]
  118. plot = pylib_graphs.plot("Storecomm, T1, Native", data)
  119. plot_list.append(plot)
  120. # Storecomm_invalid
  121. data = [
  122. ("CVC" , dir+"protokoll_CVC_Auto", cvc_scinv_pat),
  123. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_scinv_pat),
  124. ("E (good-lpo), built-in index type", dir+"protokoll_E_sts11_t1", e_scinv_ni_pat),
  125. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_scinv_pat)
  126. ]
  127. plot = pylib_graphs.plot("Storecomm_invalid, T1, Native", data)
  128. plot_list.append(plot)
  129. #Storeinv
  130. data = [
  131. ("CVC" , dir+"protokoll_CVC_Auto", cvc_si_pat),
  132. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_si_pat),
  133. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_si_pat)
  134. ]
  135. plot = pylib_graphs.plot("Storeinv, T1, Native", data)
  136. plot_list.append(plot)
  137. #Storeinv_invalid
  138. data = [
  139. ("CVC" , dir+"protokoll_CVC_Auto", cvc_siinv_pat),
  140. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_siinv_pat),
  141. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_siinv_pat)
  142. ]
  143. plot = pylib_graphs.plot("Storeinv_invalid, T1, Native", data)
  144. plot_list.append(plot)
  145. #Swap
  146. data = [
  147. ("CVC" , dir+"protokoll_CVC_Auto", cvc_sw_pat),
  148. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_sw_pat),
  149. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_sw_pat)
  150. ]
  151. plot = pylib_graphs.plot("Swap, T1, Native", data)
  152. plot_list.append(plot)
  153. #Swap_invalid
  154. data = [
  155. ("CVC" , dir+"protokoll_CVC_Auto", cvc_swinv_pat),
  156. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_swinv_pat),
  157. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_swinv_pat)
  158. ]
  159. plot = pylib_graphs.plot("Swap_invalid, T1, Native", data)
  160. plot_list.append(plot)
  161. # All systems with flattend input - T1
  162. # Storecomm
  163. data = [
  164. ("CVC (flattened)" , dir+"protokoll_CVC_Auto", cvc_scf_pat),
  165. ("CVC Lite (flattened)" , dir+"protokoll_CVCL_Auto", cvc_scf_pat),
  166. ("E (good-lpo), built-in index type" , dir+"protokoll_E_sts11_t1", e_sc_ni_pat),
  167. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_sc_pat),
  168. ]
  169. plot = pylib_graphs.plot("Storecomm, T1, Flat", data)
  170. plot_list.append(plot)
  171. # Storecomm_invalid
  172. data = [
  173. ("CVC (flattened)" , dir+"protokoll_CVC_Auto", cvc_scfinv_pat),
  174. ("CVC Lite (flattened)" , dir+"protokoll_CVCL_Auto", cvc_scfinv_pat),
  175. ("E (good-lpo), built-in index type", dir+"protokoll_E_sts11_t1", e_scinv_ni_pat),
  176. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_scinv_pat),
  177. ]
  178. plot = pylib_graphs.plot("Storecomm_invalid, T1, Flat",data)
  179. plot_list.append(plot)
  180. #Storeinv
  181. data = [
  182. ("CVC" , dir+"protokoll_CVC_Auto", cvc_sif_pat),
  183. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_sif_pat),
  184. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_si_pat)
  185. ]
  186. plot = pylib_graphs.plot("Storeinv, T1, Flat", data)
  187. plot_list.append(plot)
  188. #Storeinv_invalid
  189. data = [
  190. ("CVC" , dir+"protokoll_CVC_Auto", cvc_sifinv_pat),
  191. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_sifinv_pat),
  192. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_siinv_pat)
  193. ]
  194. plot = pylib_graphs.plot("Storeinv_invalid, T1, Flat", data)
  195. plot_list.append(plot)
  196. #Swap
  197. data = [
  198. ("CVC" , dir+"protokoll_CVC_Auto", cvc_swf_pat),
  199. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_swf_pat),
  200. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_sw_pat)
  201. ]
  202. plot = pylib_graphs.plot("Swap, T1, Flat", data)
  203. plot_list.append(plot)
  204. #Swap_invalid
  205. data = [
  206. ("CVC" , dir+"protokoll_CVC_Auto", cvc_swfinv_pat),
  207. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_swfinv_pat),
  208. ("E (good-lpo)" , dir+"protokoll_E_sts11_t1", e_swinv_pat)
  209. ]
  210. plot = pylib_graphs.plot("Swap_invalid, T1, Flat", data)
  211. plot_list.append(plot)
  212. # All systems with system-specific input - T3 on swap
  213. #Swap
  214. data = [
  215. ("CVC" , dir+"protokoll_CVC_Auto", cvc_sw_pat),
  216. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_sw_pat),
  217. ("E (good-lpo)" , dir+"protokoll_E_sts11_t3", e_sw_pat)
  218. ]
  219. plot = pylib_graphs.plot("Swap, T3, Native", data)
  220. plot_list.append(plot)
  221. data = [
  222. ("CVC" , dir+"protokoll_CVC_Auto", cvc_swf_pat),
  223. ("CVC Lite" , dir+"protokoll_CVCL_Auto", cvc_swf_pat),
  224. ("E (good-lpo)" , dir+"protokoll_E_sts11_t3", e_sw_pat)
  225. ]
  226. plot = pylib_graphs.plot("Swap, T3, Flat", data)
  227. plot_list.append(plot)
  228. # IOS
  229. data = [
  230. ("CVC" , dir+"protokoll_CVC_Auto_ios", cvc_ios_pat),
  231. ("CVC Lite" , dir+"protokoll_CVCL_Auto_ios", cvc_ios_pat),
  232. ("E (good-lpo)" , dir+"protokoll_E_sts11_ios", e_ios_pat),
  233. ("E (std-kbo)" , dir+"protokoll_E_sts28_ios", e_ios_pat),
  234. ]
  235. plot = pylib_graphs.plot("IOS", data)
  236. plot_list.append(plot)
  237. data = [
  238. ("CVC" , dir+"protokoll_CVC_Auto_ios", cvc_ios_pat),
  239. ("CVC Lite" , dir+"protokoll_CVCL_Auto_ios", cvc_ios_pat),
  240. ("E (std-kbo)" , dir+"protokoll_E_sts28_ios", e_ios_pat)
  241. ]
  242. plot = pylib_graphs.plot("IOS_opt", data)
  243. plot_list.append(plot)
  244. # Queues
  245. data = [
  246. ("CVC" , dir+"protokoll_CVC_Auto_ios", cvc_queue_pat),
  247. ("CVC Lite" , dir+"protokoll_CVCL_Auto_ios", cvc_queue_pat),
  248. ("E (good-lpo)" , dir+"protokoll_E_sts11_ios", e_queue_pat),
  249. ]
  250. plot = pylib_graphs.plot("Queues", data)
  251. plot_list.append(plot)
  252. # Circular queues
  253. data = [
  254. ("CVC Lite" , dir+"protokoll_CVCL_Auto_ios", cvc_circqueue_pat),
  255. ("E (good-lpo)" , dir+"protokoll_E_sts11_ios", e_circqueue_pat),
  256. ]
  257. plot = pylib_graphs.plot("Circular queues", data)
  258. plot_list.append(plot)
  259. # E for IWIL
  260. data = [
  261. ("CVC (flattened)" , dir+"protokoll_CVC_Auto", cvc_scf_pat),
  262. ("CVC Lite (flattened)" , dir+"protokoll_CVCL_Auto", cvc_scf_pat),
  263. ("E (good-lpo), built-in index type" , dir+"protokoll_E_sts11_t1", e_sc_ni_pat),
  264. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_sc_pat)
  265. ]
  266. plot = pylib_graphs.plot("Storecomm, Flat, IWIL", data)
  267. plot_list.append(plot)
  268. data = [
  269. ("CVC (flattened)" , dir+"protokoll_CVC_Auto", cvc_scfinv_pat),
  270. ("CVC Lite (flattened)" , dir+"protokoll_CVCL_Auto", cvc_scfinv_pat),
  271. ("E (good-lpo), built-in index type", dir+"protokoll_E_sts11_t1", e_scinv_ni_pat),
  272. ("E (good-lpo), axiomatized indices" , dir+"protokoll_E_sts11_t1", e_scinv_pat)
  273. ]
  274. plot = pylib_graphs.plot("Storecomm_Invalid, Flat, IWIL", data)
  275. plot_list.append(plot)
  276. # Create files
  277. for i in plot_list:
  278. print "Title: "+i.title+ " (linear)";
  279. i.gnuplot(files, None);
  280. print "Title: "+i.title+ " (log)";
  281. i.gnuplot(files, True);