## 5 Results and Discussion  
The method proposed was practically implemented, and several experiments were performed to demonstrate method reliability and applicability. For method implementation, the ATES tool, which converts AT to ES knowledge base rules, was developed. Later, automatically generated ES knowledge base rules and facts were imported into the created ES (based on JESS), which allows us to perform risk analysis using the generated knowledge base. Figure 11 provides details on the path that the attack tree passes through in the ATES program. Figure 11: Conceptual model of ATES. The ATES was written in Python version 3.8 and should be compatible with any Python version greater than 3. Below the short description of functions implemented in ATES is provided:  
* **Preparing attack tree data (data pre-processing). ** The creation of an attack tree in one of the various formats accepted by ATTop or direct creation of a UATS XML file must be done by the user. Once the UATS file is returned from ATTop, the ATES program is ready to accept the file for translation. Successful transformation to UATS via ATTop is demonstrated in Figure 12.
* **Add file. ** Once the UATS file is returned from ATTop, the ATES program is ready to accept the file for translation. ATES has a simple GUI created using the Tkinter package in Python. * **Translatev1/2. ** This function is wholly encased in a \"try-except\" block which is a built-in function of Python which is designed for error handling. Any errors from any of the functions within this block result in the deletion of the data and, because of how this \"try-except\" block is configured, an error message gets displayed on the screen. * **Ates. ** The ates function first takes the files in input and retrieves the filename; then sends the files to the inputter function for parsing; then sends the parsed data to the inputter function to extract the necessary node information into lists, before finally sending the lists to the printer function which will write the files. The ates function will also take the value sent with file data from the translate functions, called pvalue, and will modify the new file name to differentiate between version one and version two if the pvalue is 2. * **Inputter. ** The inputter function parses the XML file using the defused XML ElementTree package built into Python. Using the defused XML package prevents code execution from maliciously crafted XML files. The function returns an XML document object model, or DOM, for use by the lister function. * **Lister. ** The lister function takes the XML DOM from the inputter function and extracts the necessary data from it. It does this by first creating empty lists, then finding the attributes to fill each list. It then returns the full lists to the ates function to be sent to the printer function. * **Printer. ** The printer function has a \"try-except\" block for creating a directory to store the output files from the conversion process. The files created by this function will also expect this directory to exist and will provide the user with the command to run if the files are in this directory. Next, the function will open the new.clf file in write mode, or create it in write mode if it does not exist, and write the JESS program code which has been written. If pvalue is 1 then the function will write necessary JESS code and the list data from lister into the same file, but, if pvalue is 2, then it will write an additional JESS code and create a new.dat file for containing the attack tree's node data. All the files will be named automatically based upon the original input file name. Once these processes have been completed, the files will be saved and closed. Successful attack tree conversion to JESS expert system knowledge base is demonstrated in Figure 13. Converted files are automatically exported to the directory \"Attack_trees/JESS\" in CLP format. Figure 12: Successful transformation via ATTop.