Mobiusi commited on
Commit
6568fa2
·
verified ·
1 Parent(s): bf8cf5e

sync sample package

Browse files
Files changed (1) hide show
  1. data.jsonl +3 -0
data.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {"source_code": "#include <stdbool.h>\n#include <stdint.h>\n\n#define OC_TRIP_MA 18000\n\n// pack_current_ma is signed. Requirement: assert overcurrent when its magnitude exceeds OC_TRIP_MA.\nbool detect_pack_overcurrent(int32_t pack_current_ma)\n{\n if (pack_current_ma > OC_TRIP_MA) {\n return true;\n }\n return false;\n}", "faulty_branch": "if (pack_current_ma > OC_TRIP_MA)", "defect_root_cause": "The logic detects only positive current above the threshold and does not detect discharge current whose negative magnitude exceeds the threshold.", "protection_category": "overcurrent", "verification_rationale": "Because pack_current_ma is signed and the requirement applies to its magnitude, the positive-only comparison leaves the negative overcurrent direction unprotected.", "boundary_condition_description": "A positive current of 18000 mA is not flagged, consistent with the strict exceeds condition, but a current of -18001 mA is also not flagged even though its magnitude exceeds the threshold.", "protection_condition_satisfied": false}
2
+ {"source_code": "#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n\n#define OV_TRIP_MV 4200U\n\n// Requirement: assert the overvoltage condition when any cell is at or above OV_TRIP_MV.\nbool detect_cell_overvoltage(const uint16_t *cell_mv, size_t count)\n{\n for (size_t i = 0; i < count; ++i) {\n if (cell_mv[i] > OV_TRIP_MV) {\n return true;\n }\n }\n return false;\n}", "faulty_branch": "if (cell_mv[i] > OV_TRIP_MV)", "defect_root_cause": "The comparison is strict, so a cell voltage equal to OV_TRIP_MV does not assert the overvoltage condition despite the at-or-above requirement.", "protection_category": "overvoltage", "verification_rationale": "The loop checks each cell, but the strict greater-than comparison excludes the specified trip threshold itself.", "boundary_condition_description": "A cell at 4200 mV is not flagged; a cell above 4200 mV is flagged. The required boundary is inclusive.", "protection_condition_satisfied": false}
3
+ {"defect_root_cause": "", "source_code": "#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n\n#define UV_TRIP_MV 2800U\n\n// Requirement: assert the undervoltage condition when any monitored cell is at or below UV_TRIP_MV.\nbool detect_cell_undervoltage(const uint16_t *cell_mv, size_t count)\n{\n for (size_t i = 0; i < count; ++i) {\n if (cell_mv[i] <= UV_TRIP_MV) {\n return true;\n }\n }\n return false;\n}", "faulty_branch": "", "protection_category": "undervoltage", "verification_rationale": "The function examines every monitored cell and returns true as soon as a voltage is less than or equal to the stated threshold, matching the requirement.", "boundary_condition_description": "A cell at 2800 mV or below is flagged; a cell at 2801 mV does not satisfy the undervoltage condition.", "protection_condition_satisfied": true}