module complex:

input rt_methane,hi_methane,hw_level,lw_level;
output alarm, strt_pump,stop_pump;

loop
   abort
      loop
        abort
           loop 
              await hw_level;
              emit strt_pump;
              await lw_level;
              emit stop_pump
           end
        when [not rt_methane];
        emit stop_pump;
        await rt_methane; 
      end
   when hi_methane;
   emit stop_pump;
   emit alarm;
   await rt_methane
end

end module


module simple1:

input hw_level,lw_level;
output strt_pump, stop_pump;

loop

   await hw_level;
   emit strt_pump;
   await lw_level;
   emit stop_pump

end

end module


module simple2:

input rt_methane, hi_methane,hw_level,lw_level;
output alarm, strt_pump,stop_pump;

loop
   abort
           loop 
              await hw_level;
              emit strt_pump;
              await lw_level;
              emit stop_pump
           end
   when hi_methane;
   emit stop_pump;
   emit alarm;
   await rt_methane
end

end module
