# An Empirical Study of the Code Generation of Safety-Critical Software Using LLMs
## Appendix D The Standardized XML for Generalized Requirements  
(1) The standardized XML template for generalized requirements is shown in Listing A8. ```
<requirements> <input_signals> <l-. Input signals -> <signals> <req_id</req_id> <source></source> </signals> </input_signals> <input_signal_types> <l-. Input signal types -> <signal_type> <req_id</req_id> <type></type> <channels> <channel></channel> </channel> </signal_type> </input_signal_types> <input_signal_ranges> <l-. Input signal ranges -> <signal_range> <req_id</req_id> <limits> <lower_limit</lower_limit> <upper_limit</upper_limit> </limit> </channels> <channel></channel> </signal_range> </input_signal_ranges> <output_signals> </input_signal_types> </input_signal_type> <req_id</req_id> <type></length_type> </output_signal_types> </output_signal_types> <signal_range> <req_id></req_id> </input_signal_types> </output_signal_types> </input_signal_ranges> <signal_range> <req_id></req_id> <* [2] The standardized XML generalized requirements of the NucRate algorithm are shown in Listing A9. ``` <requirements> <input_signals> <signal> <req_id>RNI_INR_01</req_id> <source>Positive rate of change of neutron flux from four measurement channels, RNII1, RNI2, RNI3, RNI4-</source> </signal> <signal> <req_id>RNI_INR_03</req_id> <source>External reset signal, RNI_RST.</source> </signal> </input_signals> <input_signal_types> <signal_type> <req_id>RNI_INR_03</req_id> <type>Analog</type> <channels> <channel>RNI1</channel> <channel>RNI2</channel> <channel>RNI3</channel> <channel>RNI4</channel> </channels> </signal_type> <signal_type> <req_id>RNI_INR_05</req_id> <type>Digital</type> <channels> <channel>RNI_RST</channel> </channels> </signal_type> </input_signal_types> <input_signal_ranges> <signal_range> <req_id>RNI_INR_06</req_id> <limits> <lower_limit>10</lower_limit> <upper_limit>10000</upper_limit> </limit> <channels> <channel>RNII</channel> <channel>RNI2</channel> <channel>RNI3</channel> <channel>RNI4</channel> </channels> </signal_range> </input_signal_ranges> <output_signals> <signal> <req_id>RNI_OUTR_01</req_id> <destination>Dedicated location A</destination> </signal> <signal> <req_id>RNI_OUTR_02</req_id> <destination>Shutdown circuit breaker</destination> </signal> </output_signals>* <output_signal_types> <signal_type> <req_id>RNI_OUTR_01</req_id> <type>Digital</type> </signal_type> <signal_type> <req_id>RNI_OUTR_02</req_id> <type>Digital</type> </signal_type> </output_signal_types> <output_signal_ranges> <signal_range> <-No output_signal_ranges> </signal_range> </output_signal_ranges> <program_parameters> <<-No program parameters> </program_parameters> <functional_requirements> <requirement> <req_id>RNI_FUNR_01</req_id> <description>High signals of positive rate of change of neutron flux from the four channels are first checked against the signal range. Signals that exceed the range will have their corresponding quality bits set to bad.</description> </requirement> <requirement> <req_id>RNI_FUNR_02</req_id> <description>High signals of positive rate of change of neutron flux from the four channels are compared with a hysteresis threshold comparator to generate action signals.</description> </requirement> <requirement> <req_id>RNI_FUNR_03</req_id> <description>The hysteresis threshold comparator is a threshold comparator with hysteresis function. The hysteresis high threshold is 100, and the hysteresis low threshold is 95.</description> </requirement> <requirement> <req_id>RNI_FUNR_04</req_id> <description>The action signal is input to the S terminal of an RS flip-flop, and the external reset signal is input to the R terminals of the four flip-flops.</description> </requirement> <requirement> <req_id>RNI_FUNR_05</req_id> <description>The RS flip-flop has S priority.</description> </requirement> <req_id>RNI_FUNR_06</req_id> <description>The output signals of the four RS flip-flops are input to a 4-to-2 voter. After the voting process, two shutdown signals are output.