## Appendix A Algorithms (Pseudocode and Explanations)  
```
1 begin
2y: Set of Frames // A new empty set of frames is created
3 begin
4 whilenot(end_file)// Rows of the log file are processed in the next buck
5 do
6 Row[]=Read-Next-Line(Trace)// Here, a new line is read (information needed for each frame)
7V.insert(Create-Slide(row[]))// A new frame is automatically generated and the result is inserted in the list of frames)
8 end
9 planning(V)// Frames are organized using a plan
10 storyelling(V)// Storytelling is incorporated
11 Vmp4=convert(V,mp4)// Video is created and stored in MP4 file
12 end
13 returnVmp4// The video is returned and it can be shown to the users
```  
**Algorithm A1**Video Generation (Execution Trace T) returns a video in mp4. ```
1 begin
2y graphics = createFrameBackGround-Style()// Empty slide is created /* visual representations and texts are generated */
3 rfo=first-order-representations(info)// First-order-representations are created and stored in rfo
4 efo=explanations-NL-for(rfo)// Explanations are generated from the variable rfo
5 rso=second-order-representations(rfo)// Second-order representations are created from rfo and stored in the variable rso
6 eso=explanations-NL-for(rso)// Explanations are generated from the variable rso
7 updatePositions(graphics,[rfo,efo,rso,eso])// visual representations and texts are positioned in graphics
8 paint(graphics,[rfo,efo,rso,eso])// visual representations and texts are painted
9 end
```  
**Algorithm A2**create-Slide(row-trace []). ```
1 begin
2/* The first element of the list (info[0]) determines which type of frame will be generated using the function images-text (type, info)*/
3 switch info[0]do
4 case \"initialization\"do
5 images-text(initialization,info)// initialization frames are created
6 case \"neurons\"do
7 images-text(neurons,info)// neurons frames are created
8 end
9 case \"connections\"do
10 images-text(connections,info)// connection frames are created
11 end
12 case \"pattern\" do
13 images-text(pattern,info)// pattern frames are created
14 end
15 case \"iterations\"do
16 images-text(iterations,info)// iterations frames are created
17 end
18 case \"conclusions\" do
19 images-text(conclusions,info)// conclusions frames are created
20 end
21 end /* In this current version, several alternatives are possible (neurons, connections, pattern, iterations and conclusions). Please note that depending on the type, the rest of the elements (info[i]) will be used to create an appropriate frame */
22 end
```  
**Algorithm A3**First-order-representation(info[]). ```
1 begin /* The information is assigned to the corresponding variables (title, message1, message2, message3 */
2 title=info[1]
3 message2=info[2]
4 message2=info[3]
5 message3=info[4] /* Variables are painted using 2D primitives. The values (20, 60, so on) will depend on each type of frame */
6 setFont(fontTitle) drawString(title,20,60) setFont(fontBody);
7 setColor(Color.black) drawString(message1,20,200) drawPattern(false,false,100,300,150) drawString(message2,20,600) drawString(message3,20,800) drawString(message4,10,000) drawPattern(true,false,100,1200,150)
8 end
```  
**Algorithm A4**images-text-pattern(info[]). ```
1 begin /* A visual pattern has three important variables: x, y and size, i.e., where is painted and how (size) xcell=x
3 ycell=y size=s for\(i=0\)to pattern.lengthdo /* visual matrix with indexes is painted */
4 ifwi=truethen
5 drawString(\"\"+i,xcell+15,y+size+20);
6 end /* red cell is painted if pattern[i] is -1.0.