ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
sos_semantics.h
Go to the documentation of this file.
1#pragma once
2
3// SOS semantic rule tags — used to annotate LdIR nodes with the rule that
4// generated them, enabling structured proof obligations in T1.2.
5// The rules are specified in docs/safe-ld-sos-semantics.md; the summaries
6// below are the rule conclusions, not the full premises.
7enum class SosRule
8{
9 // Contact rules
10 NO_Contact_True, // [NO-TRUE] IN=T, var=T => pf_out = T
11 NO_Contact_False, // [NO-FALSE] IN=T, var=F => pf_out = F
12 NC_Contact_True, // [NC-TRUE] IN=T, var=F => pf_out = T
13 NC_Contact_False, // [NC-FALSE] IN=T, var=T => pf_out = F
14
15 // Transition-sensing contacts. The operand is compared against its value at
16 // the previous scan boundary, which the scan epilogue latches.
17 Rising_Contact, // [P-EDGE] pf_out = IN and var and not prev(var)
18 Falling_Contact, // [N-EDGE] pf_out = IN and not var and prev(var)
19
20 // Coil rules
21 Output_Coil, // [COIL] var := pf
22 Set_Coil, // [SET] if pf then var := true
23 Reset_Coil, // [RESET] if pf then var := false
24
25 // Timer rules (fixed-tick model). Every timer starts with Q false: at
26 // power-up it has not run, so ET must not read as an expired interval.
27 TON_Step, // [TON] if IN and IN_prev then ET++ else ET:=0;
28 // Q := IN and IN_prev and ET >= PT
29 TOF_Step, // [TOF] if IN then {ET:=0; Q:=T}
30 // elif Q and not IN_prev then {ET++; Q := ET < PT}
31 TP_Step, // [TP] if Q then {ET++; Q := ET < PT}
32 // elif rising IN then {ET:=0; Q:=T}
33
34 // Counter rules
35 CTU_Step, // [CTU] rising CU, CV < PV => CV++; Q := (CV >= PV); R => CV:=0
36 CTD_Step, // [CTD] rising CD, CV > 0 => CV--; Q := (CV <= 0); LD => CV:=PV
37
38 // Arithmetic rules
39 Arith_Step, // [ARITH] OUT := IN1 op IN2
40};
SosRule
Definition sos_semantics.h:8
@ Reset_Coil
Definition sos_semantics.h:23
@ CTU_Step
Definition sos_semantics.h:35
@ Output_Coil
Definition sos_semantics.h:21
@ CTD_Step
Definition sos_semantics.h:36
@ TOF_Step
Definition sos_semantics.h:29
@ Set_Coil
Definition sos_semantics.h:22
@ TON_Step
Definition sos_semantics.h:27
@ NC_Contact_False
Definition sos_semantics.h:13
@ NO_Contact_True
Definition sos_semantics.h:10
@ Falling_Contact
Definition sos_semantics.h:18
@ TP_Step
Definition sos_semantics.h:31
@ NC_Contact_True
Definition sos_semantics.h:12
@ NO_Contact_False
Definition sos_semantics.h:11
@ Rising_Contact
Definition sos_semantics.h:17
@ Arith_Step
Definition sos_semantics.h:39