جميع الكتب

مهني

1 Markets I: The Ecosystem and Exchange-Traded Marketsالأسواق عبر الإنترنت 2 Markets II: Rates, FX and Creditالأسواق عبر الإنترنت 3 Markets III: Commodities, Energy and Cryptoالأسواق عبر الإنترنت 4 Quantitative Methodsالأساليب عبر الإنترنت 5 Derivatives and Volatilityالمشتقات عبر الإنترنت 6 Rates, Credit, XVA and Riskالفائدة والائتمان والمخاطر عبر الإنترنت 7 Research Craft: Predictors, Backtests, Measurement, Portfoliosالبحث عبر الإنترنت 8 Strategies I: Equities and Futuresالاستراتيجيات عبر الإنترنت 9 Strategies II: Volatility, Relative Value, Macro and the Bank Desksالاستراتيجيات عبر الإنترنت 10 Microstructure and Executionالتنفيذ عبر الإنترنت 11 Market Making and High-Frequency Tradingصناعة السوق عبر الإنترنت 12 Machine Learning for Marketsتعلم الآلة عبر الإنترنت 13 Low-Latency Softwareالتكنولوجيا عبر الإنترنت 14 Networks, Hardware and Trading Infrastructureالتكنولوجيا عبر الإنترنت 15 Research, Data and Risk Platformsالتكنولوجيا عبر الإنترنت 16 The Desk and the Firmالشركة عبر الإنترنت 17 The Industry: Firms, Roles and Careersالمسارات المهنية عبر الإنترنت 18 Interviews I: Maths, Probability and Speedالمسارات المهنية عبر الإنترنت 19 Interviews II: Markets, Trading Games and the Final Roundالمسارات المهنية عبر الإنترنت 20 Interviews III: Codeالمسارات المهنية عبر الإنترنت
التطبيقات حول المدرب تسجيل الدخول ابدأ القراءة

Computer Science · المسرد

ما معنى Hoare triple, Hoare logic, assignment axiom, rule of consequence؟

يُعرف أيضًا باسم: Hoare triple · Hoare logic · assignment axiom · rule of consequence

Definition 20.1 University Computer Science — Year 3 · الفصل 20 — Program Verification: Hoare Logic and Model Checking

A Hoare triple {P} S {Q}\{P\}\,S\,\{Q\} is valid when every run of SS from a state satisfying PP that terminates ends in a state satisfying QQ. Hoare logic derives triples by the rules below, where Q[e/x]Q[e/x] is QQ with ee substituted for xx.

  • The assignment axiom: {Q[e/x]}  x=e  {Q}\{Q[e/x]\}\; x = e\; \{Q\}.
  • Sequence: from {P} S1 {R}\{P\}\,S_1\,\{R\} and {R} S2 {Q}\{R\}\,S_2\,\{Q\}, derive {P} S1;S2 {Q}\{P\}\,S_1; S_2\,\{Q\}.
  • If: from {P∧b} S1 {Q}\{P \wedge b\}\,S_1\,\{Q\} and {P∧¬b} S2 {Q}\{P \wedge \neg b\}\,S_2\,\{Q\}, derive {P}\{P\} if b: S1 else: S2 {Q}\{Q\}.
  • While: from {I∧b} S {I}\{I \wedge b\}\,S\,\{I\}, derive {I}\{I\} while b: S {I∧¬b}\{I \wedge \neg b\}.
  • The rule of consequence: from P⇒P′P \Rightarrow P', {P′} S {Q′}\{P'\}\,S\,\{Q'\} and Q′⇒QQ' \Rightarrow Q, derive {P} S {Q}\{P\}\,S\,\{Q\}.
A derivation as a proof tree: each line follows from the one above the bar by the rule named on its right. The two consequence steps need x 10 x < 10 ℝightarrow x + 1 10, which holds for 8-bit integers since x < 10 rules out the wrap, and x 10 (x < 10) ℝightarrow x = 10.
A derivation as a proof tree: each line follows from the one above the bar by the rule named on its right. The two consequence steps need x≤10∧x<10⇒x+1≤10x \le 10 \wedge x < 10 \Rightarrow x + 1 \le 10, which holds for 8-bit integers since x<10x < 10 rules out the wrap, and x≤10∧¬(x<10)⇒x=10x \le 10 \wedge \neg (x < 10) \Rightarrow x = 10.
اقرأ في الفصل →