PSG Run-File Environment implementation, see Formal Problem Statement:

 

Problem 1
Problem 2