LOCKSUIT - I have done a small experiment.
You may download it from
http://www.pawelbiernacki.net/programmer.zip. It contains three files:
programmer_initial.perkun
programmer.prolog
programmer_final.perkun
Now build Perkun and execute:
perkun programmer_final.perkun
It will enter the interactive mode:
loop with depth 3
I expect the values of the variables: program_command_1 program_command_2 it_works
perkun>
Now type "instruction_if_then instruction_if_then none" and press Enter. Perkun will choose action:
action=execute_the_program which_instruction_to_change=oneLet us assume the program is wrong. We must type "instruction_if_then instruction_if_then false".
Now Perkun wishes to modify the first command to "print":
action=change_instruction_to_print which_instruction_to_change=oneSo we must type: "instruction_print instruction_if_then none". Now Perkun chooses:
action=execute_the_program which_instruction_to_change=oneLet us assume the program was wrong again. Type "instruction_print instruction_if_then false". Now it will say:
action=change_instruction_to_print which_instruction_to_change=two
So it wants to change to "print" the second instruction. Now the program is "print print". Let us confirm it: "instruction_print instruction_print none". It responds with:
action=execute_the_program which_instruction_to_change=oneNow let us assume this program is correct. Let us type "instruction_print instruction_print true". Now Perkun will want it executed again!
action=execute_the_program which_instruction_to_change=oneNow maybe it is the time to take a look at the programmer_initial.perkun. In the "variables" section it contains the following variables:
variables
{
input variable program_command_1:{instruction_if_then, instruction_print};
input variable program_command_2:{instruction_if_then, instruction_print};
input variable it_works:{false, true, none};
output variable action:{change_instruction_to_if_then, change_instruction_to_print, execute_the_program};
output variable which_instruction_to_change:{one, two};
hidden variable does_if_then_if_then_work:{false, true};
hidden variable does_if_then_print_work:{false, true};
hidden variable does_print_if_then_work:{false, true};
hidden variable does_print_print_work:{false, true};
}
And the model (the one you will see in programmer_final.perkun) has been created automatically with a little help from Prolog. In short - I have made a simple Perkun session in which it searches through all the four combinations:
"if_then if_then"
"if_then print"
"print if_then"
"print print"
And tries to figure out which one works. This is a very primitive programming, I admit. But even for this simple case the model is huge (just take a look at programmer_final.perkun).