Skip to content

Commit 57d6866

Browse files
committed
Add prototypical examples
1 parent e239065 commit 57d6866

File tree

4 files changed

+350
-2
lines changed

4 files changed

+350
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ To give a sense of the flavour of the language, here are two examples.
2525
First, from a set of instructions guiding staff of what to do when an incident
2626
occurs:
2727

28-
![Don't Panic](examples/screenshots/DontPanic.png)
28+
<a href="examples/prototype/DontPanic.tq">
29+
<img width=890 src="examples/screenshots/DontPanic.png">
30+
</a>
2931

3032
Second, shows using Technique to describe a much larger procedure, in his case
3133
the entire process of doing systems engineering on a software project. This
3234
pushes the limits of what Technique is for, but nevertheless illustrates that
3335
it can be used for very large structures as well as very detailed ones:
3436

35-
![Systems Engineering Process](examples/screenshots/SystemsEngineeringProcess.png)
37+
<a href="examples/prototype/SystemsEngineeringProcess.tq">
38+
<img width=900 src="examples/screenshots/SystemsEngineeringProcess.png">
39+
</a>
3640

3741
Detailed examples can be found in the _examples/_ and _tests/_ directories.
3842

examples/prototype/DontPanic.tq

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
% technique v1
2+
! CC BY 4.0; © 2020 Athae Eredh Siniath, and Others
3+
4+
emergency_procedure : Incident -> Calm
5+
6+
# Instructions
7+
8+
Don't Panic!
9+
10+
In the event of an incident, clear thinking is key. Challenge yourself to form
11+
more than one hypothesis, and generate multiple options. The first solution
12+
you think of is rarely the best one.
13+
14+
As you consider options available, think of our values. Never forget the needs
15+
of our customers and the trust they have placed in us.
16+
17+
1. <ensure_safety>
18+
2. <communicate>
19+
3. { repeat <incident_action_cycle> }
20+
21+
ensure_safety : Available -> Ready
22+
23+
# Safety First
24+
25+
Ensure your physical environment is free from danger, take measures to
26+
maximize digital security, and establish reliable connectivity.
27+
28+
- Ensure physical and digital safety
29+
- Establish connectivity
30+
31+
communicate : Ready -> Leader
32+
33+
# Communicate
34+
35+
Escalate quickly. Do not assume your manager or your team lead is aware of
36+
what is happening.
37+
38+
Write down everything, with timestamps.
39+
40+
- Tell colleagues you are taking charge
41+
42+
incident_action_cycle(s) : Situation -> Done
43+
44+
# ORDeAL
45+
46+
You are the leader now. Act like it.
47+
48+
@leader
49+
1. Observe { <observe>(s) ~ e }
50+
2. Reflect { <reflect>(e) ~ os }
51+
3. Decide { <decide>(os) ~ d }
52+
4. Act { <act>(d) ~ r }
53+
5. Learn { <learn>(e, r) }
54+
55+
observe : Situation -> Context
56+
57+
# Observe
58+
59+
Ask these questions: "What is happening? What is not happening?" Rapidly begin
60+
gathering information and sharing context. Information becomes intelligence
61+
only when it influences the thinking of the leader.
62+
63+
- Gather information and share context
64+
65+
reflect : Context -> Options
66+
67+
# Reflect
68+
69+
Ask yourself: "What can I do to influence the situation?" Interpret the data
70+
you have. Identify threats. Deduce opportunities, alternatives, options, and
71+
courses of action.
72+
73+
1. Think!
74+
2. Courses of action?
75+
76+
decide : Options -> Decision
77+
78+
# Decide
79+
80+
Determine your tasks, roles of key colleagues. Identify constraints, and
81+
establish limits. Communicate your intent upwards.
82+
83+
1. Determine your tasks
84+
2. Communicate your intent upwards
85+
86+
act(d) : Decision -> Context
87+
88+
# Act
89+
90+
Execute the decision.
91+
92+
1. Execute { d }
93+
94+
learn : Context, Outcome -> Situation
95+
96+
# Learn
97+
98+
Relate the outcomes of the decision and action taken to the environment. Did
99+
the system actually change? In the way you expected? Ask yourself and your
100+
team, "If we knew then what we know now, what would we do differently?"
101+
102+
1. Consider outcome. Did action result in change?
103+
2. What is the situation now? ~ situation
104+
105+
Now go back to step 1.
106+
107+
journal(e) : Event -> JournalEntry
108+
109+
# Journal
110+
111+
Record everything, with timestamps. As soon as a second person joins you in
112+
responding to the incident, start verbalizing your actions to them and get
113+
them to act as journalist; if you hand over to them, you take the notes.
114+
115+
- Record event as it happens ~ msg
116+
@journalist
117+
{
118+
[
119+
"timestamp" = now()
120+
"message" = msg
121+
"context" = "Details about { e }"
122+
]
123+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
% technique v1
2+
! CC BY-NC-SA 3.0 IGO; © 2009 World Health Organization
3+
4+
surgical_safety_checklist :
5+
6+
# Surgical Safety Checklist
7+
8+
The checklist is designed to be read out loud by a team member, with the
9+
Surgeon, the Anaesthetist, and the Nurse all confirming that the step has been
10+
completed.
11+
12+
The checklist has three sections. Each section should take no longer than a
13+
minute.
14+
15+
I. Before induction of anaesthesia <before_anaesthesia>
16+
17+
II. Before skin incision <before_incision>
18+
19+
III. Before the patient leaves the operating room <before_leaving>
20+
21+
before_anesthesia :
22+
23+
# Before induction of anaesthesia
24+
25+
1. Has the patient confirmed his/her identity, site, procedure, and
26+
consent?
27+
'Yes'
28+
2. Is the site marked?
29+
'Yes' | 'Not Applicable'
30+
3. Is the anaesthesia machine and medication check complete?
31+
'Yes'
32+
4. Is the pulse oximeter on the patient and functioning?
33+
'Yes'
34+
5. Does the patient have a:
35+
- Known allergy?
36+
'No' | 'Yes'
37+
- Difficult airway or aspiration risk?
38+
'No' | 'Yes' and equipment/assistance available
39+
- Risk of blood loss > 500 mL?
40+
'No' | 'Yes' and two IVs planned and fluids available
41+
42+
before_incision :
43+
44+
# Before skin incision
45+
46+
1. Confirm all team members have introduced themselves by name and role
47+
'Introduced'
48+
2. Confirm the patient's name, procedure, and where the incision will be
49+
made.
50+
'Confirmed'
51+
3. Confirm antibiotic prophylaxis have been given within the last 60
52+
minutes.
53+
'Yes' | 'Not Applicable'
54+
5. Review anticipated critical events.
55+
@surgeon
56+
a. What are the critical or non-routine steps?
57+
b. How long will the case take?
58+
c. What is the blood loss expected?
59+
@anaesthetist
60+
d. Are there any patient-specific concerns?
61+
@nursing_team
62+
e. Has sterility (including indicator results) been confirmed?
63+
f. Has the equipment issues been addressed?
64+
6. Is essential imaging displayed?
65+
'Yes' | 'Not Applicable'
66+
67+
before_leaving :
68+
69+
# Before patient leaves operating room
70+
71+
1. Verbally confirm:
72+
- The name of the surgical procedure(s).
73+
- Completion of instrument, sponge, and needle counts.
74+
- Specimen labelling
75+
{ foreach specimen in specimens }
76+
@nursing_team
77+
a. Read specimen labels aloud, including patient name.
78+
- Whether there are any equipment problems to be addressed.
79+
2. Post-operative care:
80+
@surgeon
81+
a. What are the key concerns for recovery and management of this
82+
patient?
83+
@anesthetist
84+
b. What are the key concerns for recovery and management of this
85+
patient?
86+
@nursing_team
87+
c. What are the key concerns for recovery and management of this
88+
patient?
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
% technique v1
2+
! MIT; © 2018 Roy Kalawsky and Andrew Cowie
3+
4+
systems_engineering_process :
5+
6+
I. Define Goals and Objectives
7+
8+
establish_product_concept : () -> Concept
9+
10+
1. Establish Product Concept
11+
12+
II. Requirements Definition and Architecture
13+
14+
requirements_and_architecture : Concept -> Requirements, Architecture
15+
16+
2. Define Requirements <define_requirements>(concept)
17+
3. Determine Architecture <determine_architecture>(concept)
18+
19+
define_requirements : Concept -> Requirements
20+
21+
determine_architecture : Concept -> Architecture
22+
23+
III. Implementation
24+
25+
design_and_build : Requirements -> System
26+
27+
# Engineering Design, Build, and Verification
28+
29+
4. Engineering Design <engineering_design>(requirements) ~ designs
30+
5. Software Development
31+
{ foreach design in designs }
32+
a. <implement>(design) ~ component
33+
6. Integration Testing
34+
{ foreach (design, component) in zip(designs, components) }
35+
a. <integration_testing>(design, component)
36+
37+
engineering_design : Requirements -> [Design]
38+
39+
# Engineering Design
40+
41+
Given a set of requirements the engineering profession can undertake detailed
42+
analysis and turn the _idea_ into a technical _design_ for how the problem
43+
will be approached and what is actually to be built.
44+
45+
implement : Design -> Component
46+
47+
# Build and Test
48+
49+
1. Prototypes and explorations <prototypes>(design)
50+
2. Software Development <build_software>
51+
3. Local Testing and Experimentation <local_experiments>
52+
53+
build_software : Design -> Component
54+
55+
# Software Development
56+
57+
1. Define Interfaces and Types
58+
@programmers
59+
a. <define_interfaces> ~ types
60+
2. Write Program code
61+
@programmers
62+
a. <writing_code>(design, types) ~ component
63+
3. Unit Testing
64+
@programmers
65+
a. <unit_tests>(component)
66+
67+
define_interfaces : Design -> Interfaces
68+
69+
writing_code : Design, Interfaces -> Component
70+
71+
unit_tests : Component -> Component
72+
73+
local_experiments : Component -> Component
74+
75+
# Local Testing and Experimentation
76+
77+
7. Local Testing
78+
79+
integration_testing : Design, Component -> SubSystem
80+
81+
# System Verification
82+
83+
8. Integration Testing
84+
85+
IV. System Validation
86+
87+
functional_testing : [SubSystem] -> System
88+
89+
9. Functional Testing
90+
91+
validate_system : Requirements, System -> Product
92+
93+
10. Agree requirements have been met
94+
@leadership
95+
- <acceptance_decision>(requirements, system) ~ product
96+
11. Product Launch
97+
@marketing + @sales
98+
- <product_release>(product)
99+
100+
acceptance_decision : Requirements, System -> Product
101+
102+
product_release : Product -> Product
103+
104+
V. Production
105+
106+
operations : Product -> Product
107+
108+
12. Ongoing Operations
109+
@operators + @users + @management
110+
111+
changes_upgrades : Product, ChangeRequest -> Product
112+
113+
13. Changes and Upgrades
114+
@management
115+
a. Identify new requirements
116+
@engineering
117+
b. Assess impact on system architecture
118+
c. Create a design for the both
119+
- the change, and
120+
- the resultant changed component
121+
d. Implement the change
122+
e. Test the updated component
123+
f. Re-integrate System
124+
@management
125+
g. Validate its functionality ~ product2
126+
@leadership
127+
h. Release the updated system <operations>(product2)
128+
129+
VI. Retirement or Replacement
130+
131+
decommissioning : System -> ()
132+
133+
14. Decommission System

0 commit comments

Comments
 (0)