Following Core Elements Unit Safety Program Exceptions

admin

Creating a culture of safety can be difficult, but there are five key elements that must be present for a safety and health program to get off the ground. Employee Training and Empowerment Before you can expect employees to follow best practices, you must educate them and empower them to hold each other accountable. Continue reading on this topic in, Core Elements for a Safety & Health Management Program, Part 2. For more detailed information, or to download the full guidelines, visit www.osha.gov. A1 is a leading expert on the latest technology in life safety. To find out more information or to ask a question, click here or call us at 1-800-859-6198.

< Ada Programming
Computing » Computer Science » Computer Programming » Ada Programming

Robustness[edit]

Robustness is the ability of a system or system component to behave “reasonably” when it detects an anomaly, e.g.:

  • It receives invalid inputs.
  • Another system component (hardware or software) malfunctions.

Take as example a telephone exchange control program. What should the control program do when a line fails? It is unacceptable simply to halt — all calls will then fail. Better would be to abandon the current call (only), record that the line is out of service, and continue. Better still would be to try to reuse the line — the fault might be transient. Robustness is desirable in all systems, but it is essential in systems on which human safety or welfare depends, e.g., hospital patient monitoring, aircraft fly-by-wire, nuclear power station control, etc.

Modules, preconditions and postconditions[edit]

A module may be specified in terms of its preconditions and postconditions. A precondition is a condition that the module’s inputs are supposed to satisfy. A postcondition is a condition that the module’s outputs are required to satisfy, provided that the precondition is satisfied.What should a module do if its precondition is not satisfied?

Follow these easy steps to turn a PDF into a JPG, PNG or TIFF image file with the Acrobat image converter: Click the Select a file button above, or drag and drop a file into the drop zone. Select the PDF you want to convert to an image with the online converter. Pdf Assistant free download - PDF Download, AOMEI Partition Assistant Standard Edition, Soda PDF, and many more programs. Apple Mac M1 lineup. Edit, print, and convert Adobe PDF files. Nuance PDF Converter for Mac provides a host of affordable features regarding PDF conversion for Mac users. This PDF Converter for Mac is designed for increased productivity and effortless conversion of. Mac Automator App. Automator, one of Mac’s pre-installed apps, is originally developed to build. Best way to convert your MAC to PDF file in seconds. 100% free, secure and easy to use! Convertio — advanced online tool that solving any problems with any files.

  • Halt? Even with diagnostic information, this is generally unacceptable.
  • Use a global result code? The result code can be set to indicate an anomaly. Subsequently it may be tested by a module that can effect error recovery. Problem: this induces tight coupling among the modules concerned.
  • Each module has its own result code? This is a parameter (or function result) that may be set to indicate an anomaly, and is tested by calling modules. Problems: (1) setting and testing result codes tends to swamp the normal-case logic and (2) the result codes are normally ignored.
  • Exception handling — Ada’s solution. A module detecting an anomaly raises an exception. The same, or another, module may handle that exception.

The exception mechanism permits clean, modular handling of anomalous situations:

  • A unit (e.g., block or subprogram body) may raise an exception, to signal that an anomaly has been detected. The computation that raised the exception is abandoned (and can never be resumed, although it can be restarted).
  • A unit may propagate an exception that has been raised by itself (or propagated out of another unit it has called).
  • A unit may alternatively handle such an exception, allowing programmer-defined recovery from an anomalous situation. Exception handlers are segregated from normal-case code.

Predefined exceptions[edit]

The predefined exceptions are those defined in package Standard. Every language-defined run-time error causes a predefined exception to be raised. Some examples are:

  • Constraint_Error, raised when a subtype’s constraint is not satisfied
  • Program_Error, when a protected operation is called inside a protected object, e.g.
  • Storage_Error, raised by running out of storage
  • Tasking_Error, when a task cannot be activated because the operating system has not enough resources, e.g.

Ex.1

Ex.2

Ex.3 Compare the following approaches:

A negative argument to Compute_Sqrt causes OK to be set to False. Triangle uses it to determine its own status parameter value, and so on up the calling tree, ad nauseam.

versus

A negative argument to Sqrt causes Constraint_Error to be explicitly raised inside Sqrt, and propagated out. Triangle simply propagates the exception (by not handling it).

Alternatively, we can catch the error by using the type system:

A negative argument to Sqrt now raises Constraint_Error at the point of call. Sqrt is never even entered.

Safety

Input-output exceptions[edit]

Some examples of exceptions raised by subprograms of the predefined packageAda.Text_IO are:

  • End_Error, raised by Get, Skip_Line, etc., if end-of-file already reached.
  • Data_Error, raised by Get in Integer_IO, etc., if the input is not a literal of the expected type.
  • Mode_Error, raised by trying to read from an output file, or write to an input file, etc.
  • Layout_Error, raised by specifying an invalid data format in a text I/O operation

Ex. 1

Exception declarations[edit]

Exceptions are declared similarly to objects.

Ex.1 declares two exceptions:

However, exceptions are not objects. For example, recursive re-entry to a scope where an exception is declared does not create a new exception of the same name; instead the exception declared in the outer invocation is reused.

Ex.2

Exception handlers[edit]

When an exception occurs, the normal flow of execution is abandoned and the exception is handed up the call sequence until a matching handler is found.Any declarative region (except a package specification) can have a handler.The handler names the exceptions it will handle. By moving up the call sequence, exceptions can become anonymous; in this case, they can only be handled with the others handler.

Exceptions raised in the declarative region itself (1) cannot be handled by handlers of this region (3); they can only be handled in outer scopes. Exceptions raised in the sequence of statements (2) can of course be handled at (3).

The reason for this rule is so that the handler can assume that any items declared in the declarative region (1) are well defined and may be referenced.If the handler at (3) could handle exceptions raised at (1), it would be unknown which items existed and which ones didn't.

Raising exceptions[edit]

The raise statement explicitly raises a specified exception.

Ex. 1

Elements

Exception handling and propagation[edit]

Exception handlers may be grouped at the end of a block, subprogram body, etc. A handler is any sequence of statements that may end:

  • by completing;
  • by executing a return statement;
  • by raising a different exception (raise e;);
  • by re-raising the same exception (raise;).

Suppose that an exception e is raised in a sequence of statements U (a block, subprogram body, etc.).

  • If U contains a handler for e: that handler is executed, then control leaves U.
  • If U contains no handler for e: e is propagated out of U; in effect, e is raised at the 'point of call” of U.

So the raising of an exception causes the sequence of statements responsible to be abandoned at the point of occurrence of the exception. It is not, and cannot be, resumed.

Ex. 1

Information about an exception occurrence[edit]

Ada provides information about an exception in an object of type Exception_Occurrence, defined in Ada.Exceptions along with subprograms taking this type as parameter:

  • Exception_Name: return the full exception name using the dot notation and in uppercase letters. For example, Queue.Overflow.
  • Exception_Message: return the exception message associated with the occurrence.
  • Exception_Information: return a string including the exception name and the associated exception message.

For getting an exception occurrence object the following syntax is used:

The exception message content is implementation defined when it is not set by the user who raises the exception. It usually contains a reason for the exception and the raising location.

The user can specify a message using the procedure Raise_Exception.


Starting with Ada 2005, a simpler syntax can be used to associate a string message with exception occurrence.

The Ada.Exceptions package also provides subprograms for saving exception occurrences and re-raising them.

See also[edit]

Wikibook[edit]

Ada 95 Reference Manual[edit]

  • Section 11: Exceptions(Annotated)
  • 11.4.1: The Package Exceptions(Annotated)

Ada 2005 Reference Manual[edit]

  • Section 11: Exceptions(Annotated)
  • 11.4.1: The Package Exceptions(Annotated)

Ada Quality and Style Guide[edit]

  • Chapter 4: Program Structure
    • 4.3 Exceptions
  • Chapter 5: Programming Practices
    • 5.8 Using Exceptions
  • Chapter 7: Portability
    • 7.5 Exceptions
Retrieved from 'https://en.wikibooks.org/w/index.php?title=Ada_Programming/Exceptions&oldid=3359251'

Health and safety programs are aimed at ensuring workers are protected, risks are minimized, and a healthy and safe workplace is maintained. All employers must establish some form of health and safety program at the workplace. The type of program you need depends on the number of workers you have and the risks associated with their work.

  • What an effective health and safety program looks like
  • Formal versus less formal health and safety programs
  • Determining if you need a joint health and safety committee
  • Resources

What an effective health and safety program looks like

An effective program will:

  • Identify and control hazards in the workplace.
  • Help prevent injuries and disease.
  • Limit an organization's financial losses resulting from injuries and disease.
  • Promote a positive health and safety culture.
  • Outline the importance of, and provide guidance on, health and safety processes such as workplace inspections, investigations, safe work procedures, management meetings for health and safety, joint health and safety committee requirements, and the tracking and trending of OHS records and statistics.
  • Include sub-programs focused on health and safety issues pertinent to your site. For example, your site may have a specific lockout program, a fall protection program, or a confined space entry program.

Formal versus less formal health and safety programs

You must have a formal health and safety program if you have either of the following:

  • A workforce of 20 or more workers and at least one workplace where there is a moderate or high risk of injury
  • A workforce of 50 or more workers

See OHS Guideline G3.1 for information on formal health and safety programs.

Small businesses or employers with fewer than 20 workers need a health and safety program too. These programs can be simpler. We refer to them as 'less formal' health and safety programs. See OHS Guideline G3.2 for information about the contents of a less formal health and safety program.

If you're not sure if you need a formal or informal program, follow these steps:

  1. Determine how many workers are regularly employed in your workplace. Include all workers, supervisors, and managers who have worked for at least one month.
  2. Determine if your workplace is classified as low (L), moderate (M), or high (H) risk. Reviewing OHS Guideline G3.16 or talking to one of our prevention officers can help you understand the level of risk in your workplace.
  3. Use the table below to identify the type of program required for your workplace. Keep in mind that in certain situations we may require smaller workplaces to update a program from informal to formal. This may happen if or when your workplace includes high-risk work, has had a high number of injury claims, or has had multiple serious injuries or fatalities.
Number of workers Program for workplace with low hazard ratingProgram for workplace with moderate hazard ratingProgram for workplace with high hazard rating
Fewer than 20 Informal Informal Informal
20 or more but fewer than 50 Less formal Formal Formal
50 or more Formal Formal Formal

Determining if you need a joint health and safety committee

If your workplace is large enough, you may need to have a joint health and safety committee. In smaller workplaces, a worker health and safety representative may be enough. The joint committee or worker representative can help you in rolling out and maintaining your workplace health and safety program.

Use the following table to see whether you need a joint committee or a worker health and safety representative at your workplace.

Number of workersRequired representation for workplaces (regardless of hazard rating)
9 or fewer None
More than 9, fewer than 20 Worker health and safety representative
20 or more Joint health and safety committee
Following core elements unit safety program exceptions designed

Resources

How to Implement a Formal Occupational Health and Safety Program

This booklet will help employers, workers, and joint health and safety committees develop and maintain an effective occupational health and safety (OHS) program.

Program

It has been updated to include..

Following Core Elements Unit Safety Program Exceptions Examples

More related resources