/Microsoft.Research/CodeAnalysis/IFrameworkLogOptions.cs

https://github.com/Microsoft/CodeContracts · C# · 456 lines · 260 code · 110 blank · 86 comment · 0 complexity · a4931c3e81174606c6eaca2b144ee426 MD5 · raw file

  1. // Copyright (c) Microsoft. All rights reserved.
  2. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Diagnostics.Contracts;
  7. namespace Microsoft.Research.CodeAnalysis
  8. {
  9. public partial interface IFrameworkLogOptions
  10. {
  11. /// <summary>
  12. /// Print tracing information during DFA steps
  13. /// </summary>
  14. bool TraceDFA { get; }
  15. /// <summary>
  16. /// Trace the heap analysis phase of the framework
  17. /// </summary>
  18. bool TraceHeapAnalysis { get; }
  19. /// <summary>
  20. /// Trace the expression analysis phase of the framework
  21. /// </summary>
  22. bool TraceExpressionAnalysis { get; }
  23. /// <summary>
  24. /// Trace the egraph operations of the framework
  25. /// </summary>
  26. bool TraceEGraph { get; }
  27. /// <summary>
  28. /// Trace assumptions of the framework
  29. /// </summary>
  30. bool TraceAssumptions { get; }
  31. /// <summary>
  32. /// Trace weakest precondition paths
  33. /// </summary>
  34. bool TraceWP { get; }
  35. /// <summary>
  36. /// Emit the WP formula we cannot prove in the SMT-LIB format
  37. /// </summary>
  38. bool EmitSMT2Formula { get; }
  39. bool TraceNumericalAnalysis { get; }
  40. /// <summary>
  41. /// Trace the execution of the partition analysis
  42. /// </summary>
  43. bool TracePartitionAnalysis { get; }
  44. bool TraceInference { get; }
  45. bool TraceChecks { get; }
  46. /// <summary>
  47. /// Trace, for each transfer function, its cost
  48. /// </summary>
  49. bool TraceTimings { get; }
  50. /// <summary>
  51. /// Trace, for each transfer function, its memory usage
  52. /// </summary>
  53. bool TraceMemoryConsumption { get; }
  54. bool TraceMoveNext { get; }
  55. bool TraceSuspended { get; }
  56. /// <summary>
  57. /// True if analysis framework should print IL of CFGs
  58. /// </summary>
  59. bool PrintIL { get; }
  60. /// <summary>
  61. /// If true, try to prioritize the warning messages
  62. /// </summary>
  63. bool PrioritizeWarnings { get; }
  64. /// <summary>
  65. /// Controls whether or not to print suggestions for requires
  66. /// </summary>
  67. bool SuggestRequires { get; }
  68. /// <summary>
  69. /// Suggest turning assertions into contracts
  70. /// </summary>
  71. bool SuggestAssertToContracts { get; }
  72. /// <summary>
  73. /// Controls whether or not to print suggestions on arrays
  74. /// - Eventually this will be merged with SuggestRequires, now we keep it separate for debugging/development
  75. /// </summary>
  76. bool SuggestRequiresForArrays { get; }
  77. /// <summary>
  78. /// Controls whether or not should output the suggestion for [Pure] for arrays
  79. /// </summary>
  80. bool SuggestRequiresPurityForArrays { get; }
  81. /// <summary>
  82. /// Controls whether or not to print ensures suggestions
  83. /// </summary>
  84. bool SuggestEnsures(bool isProperty);
  85. /// <summary>
  86. /// Control whether or not to print return != null suggestions
  87. /// </summary>
  88. bool SuggestNonNullReturn { get; }
  89. bool InferPreconditionsFromPostconditions { get; }
  90. bool PropagateObjectInvariants { get; }
  91. bool InferAssumesForBaseLining { get; }
  92. /// <summary>
  93. /// True if we should try to propagate inferred pre-conditions for the method <code>m</code>
  94. /// </summary>
  95. /// <param name="isGetterOrSetter">Is the current method a getter or a setter</param>
  96. bool PropagateInferredRequires(bool isCurrentMethodGetterOrSetter);
  97. /// <summary>
  98. /// True iff we should try to propagate the inferred postconditions for the method <code>m</code>
  99. /// </summary>
  100. /// <param name="isGetterOrSetter">Is the current method a getter or a setter</param>
  101. bool PropagateInferredEnsures(bool isCurrentMethodGetterOrSetter);
  102. /// <summary>
  103. /// True iff we want to propagate the ensures != null inferred for a method
  104. /// </summary>
  105. bool PropagateInferredNonNullReturn { get; }
  106. bool PropagateInferredSymbolicReturn { get; }
  107. bool PropagateRequiresPurityForArrays { get; }
  108. bool PropagatedRequiresAreSufficient { get; }
  109. bool CheckFalsePostconditions { get; }
  110. /// <summary>
  111. /// When printing CS files with contracts, limit output to visible items.
  112. /// </summary>
  113. bool OutputOnlyExternallyVisibleMembers { get; }
  114. /// <summary>
  115. /// The timeout, expressed in minutes, to stop the analysis
  116. /// </summary>
  117. int Timeout { get; }
  118. /// <summary>
  119. /// How many joins before widening ?
  120. /// </summary>
  121. int IterationsBeforeWidening { get; }
  122. /// <summary>
  123. /// How many variables before giving up the inference of Octagons?
  124. /// </summary>
  125. int MaxVarsForOctagonInference { get; }
  126. int MaxVarsInSingleRenaming { get; }
  127. bool IsAdaptiveAnalysis { get; }
  128. /// <summary>
  129. /// Enforce the fair join
  130. /// </summary>
  131. bool EnforceFairJoin { get; }
  132. bool TurnArgumentExceptionThrowsIntoAssertFalse { get; }
  133. bool IgnoreExplicitAssumptions { get; }
  134. /// <summary>
  135. /// True iff we want to show the analysis phases
  136. /// </summary>
  137. bool ShowPhases { get; }
  138. bool SufficientConditions { get; }
  139. }
  140. #region IFrameworkLogOptions contract binding
  141. [ContractClass(typeof(IFrameworkLogOptionsContract))]
  142. public partial interface IFrameworkLogOptions
  143. {
  144. }
  145. [ContractClassFor(typeof(IFrameworkLogOptions))]
  146. internal abstract class IFrameworkLogOptionsContract : IFrameworkLogOptions
  147. {
  148. #region IFrameworkLogOptions Members
  149. public bool TraceDFA
  150. {
  151. get { throw new NotImplementedException(); }
  152. }
  153. public bool TraceHeapAnalysis
  154. {
  155. get { throw new NotImplementedException(); }
  156. }
  157. public bool TraceExpressionAnalysis
  158. {
  159. get { throw new NotImplementedException(); }
  160. }
  161. public bool TraceEGraph
  162. {
  163. get { throw new NotImplementedException(); }
  164. }
  165. public bool TraceAssumptions
  166. {
  167. get { throw new NotImplementedException(); }
  168. }
  169. public bool TraceWP
  170. {
  171. get { throw new NotImplementedException(); }
  172. }
  173. public bool TraceNumericalAnalysis
  174. {
  175. get { throw new NotImplementedException(); }
  176. }
  177. public bool TracePartitionAnalysis
  178. {
  179. get { throw new NotImplementedException(); }
  180. }
  181. public bool TraceTimings
  182. {
  183. get { throw new NotImplementedException(); }
  184. }
  185. public bool PrintIL
  186. {
  187. get { throw new NotImplementedException(); }
  188. }
  189. public bool PrioritizeWarnings
  190. {
  191. get { throw new NotImplementedException(); }
  192. }
  193. public bool SuggestRequires
  194. {
  195. get { throw new NotImplementedException(); }
  196. }
  197. public bool SuggestAssertToContracts
  198. {
  199. get { throw new NotImplementedException(); }
  200. }
  201. public bool SuggestRequiresForArrays
  202. {
  203. get
  204. {
  205. throw new NotImplementedException();
  206. }
  207. }
  208. public bool SuggestRequiresPurityForArrays { get { throw new NotImplementedException(); } }
  209. public bool SuggestEnsures(bool isProperty)
  210. {
  211. throw new NotImplementedException();
  212. }
  213. public bool SuggestNonNullReturn
  214. {
  215. get { throw new NotImplementedException(); }
  216. }
  217. public bool OutputOnlyExternallyVisibleMembers
  218. {
  219. get { throw new NotImplementedException(); }
  220. }
  221. public bool InferPreconditionsFromPostconditions
  222. {
  223. get { throw new NotImplementedException(); }
  224. }
  225. public int Timeout
  226. {
  227. get
  228. {
  229. Contract.Ensures(Contract.Result<int>() >= 0);
  230. throw new NotImplementedException();
  231. }
  232. }
  233. public int IterationsBeforeWidening
  234. {
  235. get { throw new NotImplementedException(); }
  236. }
  237. public int MaxVarsForOctagonInference
  238. {
  239. get { throw new NotImplementedException(); }
  240. }
  241. public bool EnforceFairJoin
  242. {
  243. get { throw new NotImplementedException(); }
  244. }
  245. #endregion
  246. #region IFrameworkLogOptions Members
  247. public bool TraceChecks
  248. {
  249. get { throw new NotImplementedException(); }
  250. }
  251. public bool InferRequiresPurityForArrays
  252. {
  253. get { throw new NotImplementedException(); }
  254. }
  255. public bool TraceInference
  256. {
  257. get { throw new NotImplementedException(); }
  258. }
  259. public bool TraceSuspended
  260. {
  261. get { throw new NotImplementedException(); }
  262. }
  263. #endregion
  264. #region No interesting contract
  265. public bool PropagateInferredRequires(bool isCurrentMethodGetterOrSetter)
  266. {
  267. throw new NotImplementedException();
  268. }
  269. public bool PropagateSimpleRequires
  270. {
  271. get { throw new NotImplementedException(); }
  272. }
  273. public bool PropagateInferredEnsures(bool isCurrentMethodGetterOrSetter)
  274. {
  275. throw new NotImplementedException();
  276. }
  277. public bool PropagateInferredNonNullReturn
  278. {
  279. get { throw new NotImplementedException(); }
  280. }
  281. public bool PropagateRequiresPurityForArrays
  282. {
  283. get { throw new NotImplementedException(); }
  284. }
  285. public bool PropagatedRequiresAreSufficient
  286. {
  287. get { throw new NotImplementedException(); }
  288. }
  289. public bool EmitSMT2Formula
  290. {
  291. get { throw new NotImplementedException(); }
  292. }
  293. public bool IgnoreExplicitAssumptions
  294. {
  295. get { throw new NotImplementedException(); }
  296. }
  297. public bool ShowPhases
  298. {
  299. get { throw new NotImplementedException(); }
  300. }
  301. public bool TraceMemoryConsumption
  302. {
  303. get { throw new NotImplementedException(); }
  304. }
  305. public bool CheckFalsePostconditions
  306. {
  307. get { throw new NotImplementedException(); }
  308. }
  309. public bool PropagateObjectInvariants
  310. {
  311. get { throw new NotImplementedException(); }
  312. }
  313. public bool InferAssumesForBaseLining
  314. {
  315. get
  316. {
  317. throw new NotImplementedException();
  318. }
  319. }
  320. #endregion
  321. #region IFrameworkLogOptions Members
  322. public bool TurnArgumentExceptionThrowsIntoAssertFalse
  323. {
  324. get { throw new NotImplementedException(); }
  325. }
  326. #endregion
  327. public bool PropagateInferredSymbolicReturn
  328. {
  329. get { throw new NotImplementedException(); }
  330. }
  331. public bool SufficientConditions
  332. {
  333. get { throw new NotImplementedException(); }
  334. }
  335. public bool TraceMoveNext { get { return default(bool); } }
  336. public int MaxVarsInSingleRenaming
  337. {
  338. get { Contract.Ensures(Contract.Result<int>() >= 0); return 0; }
  339. }
  340. public bool IsAdaptiveAnalysis
  341. {
  342. get { throw new NotImplementedException(); }
  343. }
  344. }
  345. #endregion
  346. }