****** Example1: ******
Global Variable Declaration
-/* Include the header files first
-** This declaration will be written into a header file
-*/
-/* @file _spec_sequential_generated.h */
-/* @brief automatically generated file */
-#ifndef __SPEC_SEQUENTIAL_GENERATED_H
-#define __SPEC_SEQUENTIAL_GENERATED_H
-#include <specannotation.h>
-#include <spec_tag.h>
/* Include all the header files that contains the interface declaration */
#include <iostream>
#include <memory>
#include <assert.h>
+/* Other necessary header files */
+#include <specannotation.h>
+#include <spec_tag.h>
+
/* All other user-defined functions */
ALL_USER_DEFINED_FUNCTIONS
} Get_info;
/* End of info struct definition */
+/* ID functions of interface */
+static id_t Put_id() {
+ id_t id = PUT_ID;
+ return id;
+}
-/* All function of action and check of interfaces */
-bool Put_check_action(void *info) {
+static id_t Get_id() {
+ id_t id = GET_ID;
+ return id;
+}
+/* End of ID functions */
+
+/* Initialization of interface<->function_ptr table */
+#define INTERFACE_SIZE 2
+void* func_ptr_table[INTERFACE_SIZE * 2] = {
+ CLASS
+
+/* Check_action function of interfaces */
+bool Put_check_action(void *info, id_t __ID__) {
bool check_passed;
Put_info *theInfo = (Put_info) info;
shared_ptr<TypeV> __RET__ = theInfo->__RET__;
TypeK & key = theInfo->key;
TypeV & value = theInfo->value;
+ // __COND_SAT__
+ bool __COND_SAT__ = PUT_CONDITION;
+
// Check
check_passed = PUT_CHECK_EXPRESSION;
if (!check_passed)
PUT_POST_ACTION
}
-id_t Put_id() {
- id_t id = PUT_ID;
- return id;
+
+bool Get_check_action(void *info, id_t __ID__) {
+ //...
}
+/* End of check_action function definitions */
/* Beginning of other user-defined variables */
cdsannotate(SPEC_ANALYSIS, &hb_init0);
}
-#endif
-
+#endif /* End of
****** Example2: ******