SlideShare a Scribd company logo
Temporal Engineering
with Delphi
A New Technology Changing the Game
By
Gordon Morrison, Author
Breaking the Time Barrier
Agenda
1. Open Software
2. The Challenge
3. Traditional Approaches
4. The Bread Crumb Problem
5. My Solution
6. Implementation
7. Quantification
8. Why Time is Important
9. Questions
www.vsmerlot.com
2
1. Open Software
• This presentation is based on technology in
my patent
– I have made this patented work freely available
– Anyone can use this technology, go for it!
– The patent is U.S. Patent #6,345,387
• Issued Feb 2002
• Download from the patent office
– This technology is described in my book
• Reads easier and better than my patent
• Title: Breaking the Time Barrier
www.vsmerlot.com
3
www.vsmerlot.com
2. The Challenge
• Using your traditional spatial If-Then-Else
(ITE) approach
– Produce a five-function calculator
– add, subtract, multiply, divide, and percent
• The specification is at: www.vsmerlot.com
• Count the number of ITE and Case/Default
Statements
– Count every logic decision point
– Don’t use my temporal approach
4
The Challenge Test
• Conform to the specification
• Successfully complete the test matrix
• Final Test is:
– Enter ‘-3.14159 - -2.14159=‘
– There are eighteen entries
– How many logic test will your code make?
www.vsmerlot.com
5
3. Traditional Approaches
• Using the traditional state machine
– Expect ninety plus logic tests
• If – then – else
• Switch – case – default
• Case – value
• How well will you do?
www.vsmerlot.com
6
www.vsmerlot.com
Proper State Machine(1)
• In a proper state machine, the state transitions are all
complete and orthogonal.
– Complete Transitions: a transition is defined for every
possible situation.
– Orthogonal Transitions: none of the transitions have
overlapping conditions.
• With a proper state machine
– a next state is defined for every possible condition
– the designated next state is unique
• My comment:
– The proper state machine is spatial using If-Then-Else (ITE)
– The proper state machine doesn’t know where it’s working
(1)- © 2005 Carnegie Mellon University – PSP II Designing and Verifying State Machines- page 41
7
www.vsmerlot.com
Spatial Calculator Statechart
• The author’s
implementation:
– 112 ITE / Case
– 1,000+ LOC
• Arrows are ambiguous
– -> Transitions
– -> Events
– -> States
• Minus is an ambiguous
transition
• Begin to negate1
• subtract
• opEntered to negated2
“Practical Statecharts in C/C++, © CMP Books, Miro Samek, Ph.D.
8
www.vsmerlot.com
Spatial Calculator Call Diagram
• This diagram
has no calls to
trace display
• It’s very
complex
9
www.vsmerlot.com
Spatial With Debugging
• Spatial trace
– Red lines …
• Trace debug
– Each function
– Embedded
– Side effects
10
4. The Bread Crumb Problem
• Edsger Dijkstra once asked, "Why has elegance
found so little following?"
• Imagine a CPU without a program counter (PC)
– The hardware would need to save states continually
• Dropping bread crumbs
– After an interrupt determine where it was executing
• Look for the trail of bread crumbs
– Massive amounts of logic as administrative overhead
• Bread crumb support built in
– This is spatial logic
www.vsmerlot.com
11
PC -> Pointer
• The program counter is a temporal pointer
– Hardware is temporal (mostly)
• Spatial application software does not have
an equivalent PC
• Traditional state machines were created to
treat the symptom of no software PC
– Solution drop bread crumbs
– We call these ‘state machines’
www.vsmerlot.com
12
5. My Solution
• Create an application pointer (temporal)
– One ‘time pointer’ for every Engine/Table
– The time pointer keeps track of application
logic
– The time pointer is always available for
progressive protocol based application
– The time pointer eliminates most bread
crumb logic
www.vsmerlot.com
13
www.vsmerlot.com
Temporal State Machine (TSM)
• Event or non-event driven applications
• States are true or false
– Transitions are next true or next false
• Three fundamental parts
– Engine (time, logic test, trace, and control)
– Logic-Flow / Rule Table (class)
– Data-Flow / Reusable Members
• Logic-flow is orthogonal to data-flow
– No control flow in data manipulation
– No data manipulation in control flow
14
www.vsmerlot.com
TSM Structure
• Engine/Table relationship
– iTime is the pointer into array of rule/step
– Table contains 1 or more rules
– Each rule has a single entry point
• Rules are like basic blocks
• Array of rules consist of steps
– Every step is a binary state
• Each step has a test condition
• Each step has a True Behavior
• Each step has a Next Rule/Step (iTime pointer)
• Each step has a False Behavior
• Each step has a Next Rule/Step (iTime pointer)
• Each step has a Trace (tied to the specification)
15
www.vsmerlot.com
TSM Pattern
Data-Flow
…On…
…Off…
…On…
…Off…
Logic-Flow
Engine
T-Trace
F-Trace
temporal• iTime pointer
• Dynamically
binds
• Tracing
– True Trace
– False Trace
16
Table
www.vsmerlot.com
Temporal vs. Spatial ITE
• Temporal domain
– Time Indexed
• Reduces complexity
– State diagrams
– Call diagrams
– Models
• Reduces code size
• Increases reuse
• Includes trace
• Preemptable
• Spatial domain
– Test bread crumbs
• Increases complexity
– State diagrams
– Call diagrams
– Models
• Increases code size
• Decreases reuse
• Manual trace
• ~Not Preemptable
17
www.vsmerlot.com
Engine / Table Relationship
Engine
• Engine is temporal (iTime)
• Preemption control (while)
– Test condition (if – state)
• Dynamic bind True Behavior
– Next True Rule/Step iTime
– True Trace
• Dynamic bind False Behavior
– Next False Rule/Step iTime
– False Trace
– End if – logic
– End while – control loop
Table
• Each row is a temporal
sequence
– Rule/Step (name)
– Test condition (state)
• True Behavior
– Next True Rule/Step
• False Behavior
– Next False Rule/Step
– Trace (unique to app)
18
www.vsmerlot.com
6. Implementation
procedure TCOSAFrame.Run(intState integer);
begin
bEngineLocal := TRUE;
iState := intState;
while bEngineLocal AND bEngineGlobal do
begin
if iState = rRule[iTime].iState then
begin
rRule[iTime].pTrueRule;
True_Trace(iTime);
iTime := rRule[iTime].iTrueRule;
end else
begin
rRule[iTime].pFalseRule;
False_Trace(iTime);
iTime := rRule[iTime].iFalseRule;
end;
end;
end;
iTime is temporal
Determined by logic
19
Dynamically Bind-True
Dynamically Bind-False
Delphi Structure Setup
// ************** Temporal Rules Definition ******************
pProcedureType = procedure of Object; // Dynamic Bind Definition
TCOSARules = class
public // the logic test can also be defined as a Boolean function
private
iTime : integer;
iState : integer; // logic test // Static State Definition
pTrueRule : pProcedureType; // Dynamic Bind True
iTrueRule : integer;
pFalseRule : pProcedureType; // Dynamic Bind False
iFalseRule : integer;
iTrace : integer;
end;
www.vsmerlot.com
20
Delphi Logic Table Setup
rRule : Array [0..24] of TCOSARules; // logic table allocation
procedure pBRT(iTime : integer; iState : integer;
pTrueRule : pProcedureType; iTrueRule : integer;
pFalseRule : pProcedureType; iFalseRule : integer;
iTrace : integer); // prototype fill logic array
www.vsmerlot.com
21
Implementation Logic
procedure TCOSAcalc.pBRT(iTime : integer; iState : integer;
pTrueRule : pProcedureType; iTrueRule : integer;
pFalseRule : pProcedureType; iFalseRule : integer;
iTrace : integer);
begin
rRule[iTime] := TCOSARules.Create; // create row
rRule[iTime].iTime := iTime; // fill in row
rRule[iTime].iState := iState;
rRule[iTime].pTrueRule := pTrueRule;
rRule[iTime].iTrueRule := iTrueRule;
rRule[iTime].pFalseRule := pFalseRule;
rRule[iTime].iFalseRule := iFalseRule;
rRule[iTime].iTrace := iTrace;
end;
www.vsmerlot.com
22
Dynamic Calls Build Logic
// Next Next
// Rules Static True True False False
// Steps State Behavior Rule Behavior Rule Trace
pBRT(rOpr1, iNeg44, Negate, rOpr1+1,Clr_Buf, rOpr1+1,100);
pBRT(rOpr1+1,iDigit, Any_Number,rOpr1+1,Ignore, rOpr1+2,101);
pBRT(rOpr1+2,iDot59, One_Period,rOpr1+3,Ignore, rOpr1+4,102);
pBRT(rOpr1+3,iDigit, Any_Number,rOpr1+3,Ignore, rOpr1+4,103);
www.vsmerlot.com
23
23-Steps of Calculator Logic
www.vsmerlot.com
24
www.vsmerlot.com
The User Perspective
(tends to be temporal)
• Calculator
– Enter Operand 1 (optional sign)
– Enter Operation ( + - * / )
– Enter Operand 2 (optional sign)
– Select Result Type ( = % ( + - * / ))
• The user perspective is generally temporal
• Let’s look at entering
– ‘-’ ‘3’ ‘.’ ‘1’ ‘4’ ‘1’ ‘5’ ‘9’
– Followed by the Subtract Operation
25
Entered -
temporal
True Behavior
Entered 3
temporal
False BehaviorEntered .
temporal
Entered 1
temporal
Entered 4
temporal
Entered 1
temporal
Entered 5
temporal
Entered 9
Count Step Trace Eng Static Dynamic Behavior Value
1 +T= 0; 100 Off; 44; 44; Negate; N=-
2 +T= 1; 101 Off; 1; 1; Any_Number N=-3
3 ĞF= 1; 101 On; 1; 59; Ignore; N=
4 +T= 2; 102 Off; 59; 59; One_Period; N=-3.
5 +T= 3; 103 Off; 1; 1; Any_Number N=-3.1
6 +T= 3; 103 Off; 1; 1; Any_Number N=-3.14
7 +T= 3; 103 Off; 1; 1; Any_Number N=-3.141
8 +T= 3; 103 Off; 1; 1; Any_Number N=-3.1415
9 +T= 3; 103 Off; 1; 1; Any_Number N=-3.14159
Trace
temporal
Enter Operation (‘-’)
temporal
Not a
Number
temporal
Not CE or C
temporal
Not
Addition
temporal
10 ĞF= 3; 103 On; 1; 44; Ignore; N=
11 ĞF= 4; 104 On; 12; 44; Ignore; N=
12 ĞF= 5; 105 On; 11; 44; Ignore; N=
13 ĞF= 6; 106 On; 1; 44; Push_Disp; N=
14 ĞF= 7; 500 On; 43; 44; Ignore; N=
15 +T=8; 501 On; 44; 1; Subtraction; N=-3.14159
TraceMatch
Subtraction
temporal
www.vsmerlot.com
Understanding the Time Index
ENTER Rule State True Action Next True False Action Next False
‘-’ rOper1 = <iNeg44>? Negate rOper1+1 Ignore rOper1+1
‘3’ +1 = <iDigit>* Any_Number rOper1+1 Ignore rOper1+2
‘.’ +2 = <iDot59>? One_Period rOper1+3 Ignore rOper1+4
‘14159’ +3 = <iDigit>* Any_Number rOper1+3 Ignore rOper1+4
Time +4
39
• I know where I am
• I know where I came from
• I know where I am going
• At iTime + 4 ‘-’ is “not a number” from iTime+3
Time
www.vsmerlot.com
7. Quantification
T TR DS Behavior Value
1 100 44; Negate; N= -
2 101 1; Any_Number; N= -3
3 101 59; Ignore; N=
4 102 59; One_Period; N= -3.
5 103 1; Any_Number; N= -3.1
6 103 1; Any_Number; N= -3.14
7 103 1; Any_Number; N= -3.141
8 103 1; Any_Number; N= -3.1415
9 103 1; Any_Number; N= -3.14159
10 103 44; Ignore; N=
Compare Temporal Trace
40
To Spatial Trace
www.vsmerlot.com
41
T Behavior e->sig Value
O O O
19, g-negated1, 2, 0
20, negated1
21, g-negated1, 1, -0
22, g-negated1, 1010, -0
O O O
31, int1
32, g-int1, 1, -3
33, g-int1, 1101, -3
34, g-frac1, 0, -3.
O O O
37, g-frac1, 2, -3.
38, frac1
39, g-frac1, 1, -3.
40, g-frac1, 1010, -3.
O O O
45, g-frac1, 1107, -3.14159
46, g-Oper1, 1107, -3.14159
47, g-frac1, 3, -3.14159
48, g-opEntered, 0, -3.14159
49, g-Oper1, 0, -3.14159
50, g-Oper1, 3, -3.14159
51, g-opEntered, 2, -3.14159
52, opEntered
53, g-opEntered, 1, -3.14159
54, g-opEntered, 1107, -3.14159
Temporal-Logic Counts
www.vsmerlot.com
42
• -3.14159 – ten steps to enter nine actions
– 90% efficient
– 10% of cost is overhead
• -3.14159 - - 2.14195 = thirty steps for
eighteen actions
– 60% efficient
– 40% of cost is overhead
Spatial-Logic Counts
• -3.14159 – fifty-four steps for nine actions
– 16.67 % efficient
– 83.34% of cost is overhead
• -3.14159 - - 2.14195 = ninety-six steps for
eighteen actions
– 18.75 % efficient
– 81.25% of cost is overhead
www.vsmerlot.com
43
Spatial Enter “-” Only
Trc= 1, g-calc, sig= 0 ; Operand= ,
Trc= 2, g-calc, sig= 0 ; Operand= ,
Trc= 3, g-calc, sig= 1 ; Operand= ,
Trc= 4, g-clear; Operand= ,
Trc= 5, g-ready, sig= 0 ; Operand= 0,
Trc= 6, g-ready, sig= 2 ; Operand= 0,
Trc= 7, g-ready, sig= 1 ; Operand= 0,
Trc= 8, g-begin, sig= 0 ; Operand= 0,
Trc= 9, g-begin, sig= 2 ; Operand= 0,
Trc= 10, g-begin, sig= 1 ; Operand= 0,
Trc= 11, g-begin, sig= 1107 ; Operand= 0,
Trc= 12, g-negated1, sig= 0 ; Operand= 0,
Trc= 13, g-begin, sig= 0 ; Operand= 0,
Trc= 14, g-calc, sig= 0 ; Operand= 0,
Trc= 15, g-begin, sig= 3 ; Operand= 0,
www.vsmerlot.com
44
Trc= 16, g-ready, sig= 3 ; Operand= 0,
Trc= 17, g-ready, sig= 0 ; Operand= 0,
Trc= 18, g-negated1, sig= 2 ; Operand= 0,
Trc= 19, g-negated1, sig= 1 ; Operand= -0,
Trc= 20, g-negated1, sig= 100 ; Operand= -0,
Trc= 21, g-calc, sig= 100 ; Operand= -0,
Trc= 22, g-negated1, sig= 3 ; Operand= -0,
Trc= 23, g-final, sig= 0 ; Operand= -0,
- End of Analysis
Trc= 24, g-calc, sig= 0 ; Operand= -0,
Trc= 25, g-calc, sig= 3 ; Operand= -0,
Trc= 26, g-final, sig= 2 ; Operand= -0,
Trc= 27, g-final, sig= 1 ; Operand= -0,
- End of Analysis
www.vsmerlot.com
A Temporal State Diagram
• Simple state view
• True Behavior
– One green arrow
• False Behavior
– One red arrow
• Temporal
– Trace
– Specification
• Compliance
45
www.vsmerlot.com
Statechart Comparison
Temporal Spatial
46
www.vsmerlot.com
Call Diagram Complexity
Temporal Spatial
47
Summary
Temporal Actions Logic Steps Efficiency Overhead
‐pi 9 10 90.0% 10.0%
‐pi‐(‐pi‐1) 18 30 60.0% 40.0%
Spatial
‐pi 9 54 16.67% 83.34%
‐pi‐(‐pi‐1) 18 96 18.75% 81.25%
www.vsmerlot.com
48
www.vsmerlot.com
8. Why Time is Important
• Understanding “Time” in software means not having to do
an “if” to test where the program is executing and what
has happened.
– 23 Logic points-Temporal calculator example
– 112 Logic points-Spatial calculator example
– Sampling of spatial logic tests
• 3 tests for IDC_PLUS
• 4 tests IDC_MINUS
• 2 tests IDC_MULT
• 2 tests IDC_DIVIDE
• 9 tests for IDC_0
• 11 tests for IDC_1_9
49
Spatial Software
• Must leave a trail of “bread crumb” states
– This is pure overhead
• Must track down where it was
– This is pure overhead
• Difficult to maintain
– Keeping the overhead straight
• Difficult to modify
– Keeping the overhead straight
www.vsmerlot.com
50
Temporal Software
• Keeps a temporal pointer
• Reduces complexity
• Eliminates much of the overhead
• Easier to maintain
• Easier to modify
– Add new rule
– Change the logic
www.vsmerlot.com
51
Software Quality
• Testing doesn’t improve quality
– Testing fixes quality problems
– Quality is still poor
• Temporal engineering
– Improves quality
– Reduces overhead logic
– Fewer things to go wrong
www.vsmerlot.com
52
Where I’ve Used Temporal
• Disk driver analysis (Symbios Logic)
• Data migration (US West / HP)
• Data filtering
• Lexer/Parser – Data analyzer
• Radar control system
• Robotic arm control
• Embedded applications
• Code generator
www.vsmerlot.com
53
The End – Definitions
• COSA – Coherent Object System Architecture
– U.S. Patent #6,345,387 abandoned by inventor
– Available to the public in book: Breaking the Time Barrier
– NOT associated with www.rebelscience.org
• BNF – Backus-Naur Format
– Diagramming the logic of syntax
– Basis for temporal engineering
• ITE – If-Then-Else logic
– commonly referred to as ‘spaghetti code’
• CMU – Carnegie Mellon University
• SEI – Software Engineering Institute at CMU
• CPU – Central Processing Unit
• UML – Unified Modeling Language
www.vsmerlot.com
54

More Related Content

PPTX
State Space Reduction Techniques to Verify Business Processes
PPTX
Clock driven scheduling
PDF
Pragmatic model checking: from theory to implementations
PPTX
Commonly used Approaches to Real Time Scheduling
PPT
reliability workshop
PPTX
Approaches to real time scheduling
PPT
Mutual exclusion and sync
PDF
Operating System-Ch6 process synchronization
State Space Reduction Techniques to Verify Business Processes
Clock driven scheduling
Pragmatic model checking: from theory to implementations
Commonly used Approaches to Real Time Scheduling
reliability workshop
Approaches to real time scheduling
Mutual exclusion and sync
Operating System-Ch6 process synchronization

What's hot (10)

PDF
Unit II - 3 - Operating System - Process Synchronization
PPTX
Reference model of real time system
PPTX
Concurrency: Mutual Exclusion and Synchronization
PDF
Realtime systems chapter 1
PDF
PID Tuning using Ziegler Nicholas - MATLAB Approach
PPT
Ch7 OS
 
PDF
MiL Testing of Highly Configurable Continuous Controllers
PPTX
Process synchronization in Operating Systems
PPT
Operating Systems - "Chapter 5 Process Synchronization"
PPTX
Priority driven scheduling of periodic tasks
Unit II - 3 - Operating System - Process Synchronization
Reference model of real time system
Concurrency: Mutual Exclusion and Synchronization
Realtime systems chapter 1
PID Tuning using Ziegler Nicholas - MATLAB Approach
Ch7 OS
 
MiL Testing of Highly Configurable Continuous Controllers
Process synchronization in Operating Systems
Operating Systems - "Chapter 5 Process Synchronization"
Priority driven scheduling of periodic tasks
Ad

Viewers also liked (6)

PPTX
Nuestro Catalogo.
PDF
Portfolio di Noemi Carotti
DOC
00063257
PDF
Volantone GameStop+ Luglio 2014
PDF
Offerte Card Festa della Mamma
PPT
relazione anterselva
Nuestro Catalogo.
Portfolio di Noemi Carotti
00063257
Volantone GameStop+ Luglio 2014
Offerte Card Festa della Mamma
relazione anterselva
Ad

Similar to Gordon morrison temporalengineering-delphi-v3 (20)

PPTX
How I failed to build a runbook automation system
PPT
ADS UNIT-1 PPT.ppt
PDF
DSA 103 Object Oriented Programming :: Week 3
PPT
Ch02 primitive-data-definite-loops
PPT
Resource Management in (Embedded) Real-Time Systems
PDF
The Diabolical Developers Guide to Performance Tuning
PPT
Complex Event Processing
PDF
Lecture 2 role of algorithms in computing
PDF
Rule Modularity and Execution Control
PPTX
synchronization in operating system structure
PDF
Towards Reactive Planning With Digital Twins and Model-Driven Optimization
PPT
代码大全(内训)
PPTX
Compiler Design Unit 4
PDF
VLSI Static Timing Analysis Setup And Hold Part 2
PDF
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
PPTX
Discrete event simulation
PDF
04 performance
PPTX
Time Simulation Discrete Event (time) Simulation.pptx
PPTX
The SAM Pattern: State Machines and Computation
PDF
How NOT to Write a Microbenchmark
How I failed to build a runbook automation system
ADS UNIT-1 PPT.ppt
DSA 103 Object Oriented Programming :: Week 3
Ch02 primitive-data-definite-loops
Resource Management in (Embedded) Real-Time Systems
The Diabolical Developers Guide to Performance Tuning
Complex Event Processing
Lecture 2 role of algorithms in computing
Rule Modularity and Execution Control
synchronization in operating system structure
Towards Reactive Planning With Digital Twins and Model-Driven Optimization
代码大全(内训)
Compiler Design Unit 4
VLSI Static Timing Analysis Setup And Hold Part 2
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
Discrete event simulation
04 performance
Time Simulation Discrete Event (time) Simulation.pptx
The SAM Pattern: State Machines and Computation
How NOT to Write a Microbenchmark

More from Gordon Morrison (12)

DOCX
Processing data using regular expressions
PDF
Extract Translae Load by-the-numbers
PDF
Nist cosa-foundation v7
PDF
Black capped night heron v1
PDF
NIST COSA-Foundation Software
PDF
Meta edit calc execution v3
PDF
Cosa movie v8 handout
PPT
It wasn’t the if-
PDF
Cosa top down
PDF
workflow in temporal state machine v1
PDF
A true state machine
PDF
New Cosa Movie V8
Processing data using regular expressions
Extract Translae Load by-the-numbers
Nist cosa-foundation v7
Black capped night heron v1
NIST COSA-Foundation Software
Meta edit calc execution v3
Cosa movie v8 handout
It wasn’t the if-
Cosa top down
workflow in temporal state machine v1
A true state machine
New Cosa Movie V8

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation

Gordon morrison temporalengineering-delphi-v3

  • 1. Temporal Engineering with Delphi A New Technology Changing the Game By Gordon Morrison, Author Breaking the Time Barrier
  • 2. Agenda 1. Open Software 2. The Challenge 3. Traditional Approaches 4. The Bread Crumb Problem 5. My Solution 6. Implementation 7. Quantification 8. Why Time is Important 9. Questions www.vsmerlot.com 2
  • 3. 1. Open Software • This presentation is based on technology in my patent – I have made this patented work freely available – Anyone can use this technology, go for it! – The patent is U.S. Patent #6,345,387 • Issued Feb 2002 • Download from the patent office – This technology is described in my book • Reads easier and better than my patent • Title: Breaking the Time Barrier www.vsmerlot.com 3
  • 4. www.vsmerlot.com 2. The Challenge • Using your traditional spatial If-Then-Else (ITE) approach – Produce a five-function calculator – add, subtract, multiply, divide, and percent • The specification is at: www.vsmerlot.com • Count the number of ITE and Case/Default Statements – Count every logic decision point – Don’t use my temporal approach 4
  • 5. The Challenge Test • Conform to the specification • Successfully complete the test matrix • Final Test is: – Enter ‘-3.14159 - -2.14159=‘ – There are eighteen entries – How many logic test will your code make? www.vsmerlot.com 5
  • 6. 3. Traditional Approaches • Using the traditional state machine – Expect ninety plus logic tests • If – then – else • Switch – case – default • Case – value • How well will you do? www.vsmerlot.com 6
  • 7. www.vsmerlot.com Proper State Machine(1) • In a proper state machine, the state transitions are all complete and orthogonal. – Complete Transitions: a transition is defined for every possible situation. – Orthogonal Transitions: none of the transitions have overlapping conditions. • With a proper state machine – a next state is defined for every possible condition – the designated next state is unique • My comment: – The proper state machine is spatial using If-Then-Else (ITE) – The proper state machine doesn’t know where it’s working (1)- © 2005 Carnegie Mellon University – PSP II Designing and Verifying State Machines- page 41 7
  • 8. www.vsmerlot.com Spatial Calculator Statechart • The author’s implementation: – 112 ITE / Case – 1,000+ LOC • Arrows are ambiguous – -> Transitions – -> Events – -> States • Minus is an ambiguous transition • Begin to negate1 • subtract • opEntered to negated2 “Practical Statecharts in C/C++, © CMP Books, Miro Samek, Ph.D. 8
  • 9. www.vsmerlot.com Spatial Calculator Call Diagram • This diagram has no calls to trace display • It’s very complex 9
  • 10. www.vsmerlot.com Spatial With Debugging • Spatial trace – Red lines … • Trace debug – Each function – Embedded – Side effects 10
  • 11. 4. The Bread Crumb Problem • Edsger Dijkstra once asked, "Why has elegance found so little following?" • Imagine a CPU without a program counter (PC) – The hardware would need to save states continually • Dropping bread crumbs – After an interrupt determine where it was executing • Look for the trail of bread crumbs – Massive amounts of logic as administrative overhead • Bread crumb support built in – This is spatial logic www.vsmerlot.com 11
  • 12. PC -> Pointer • The program counter is a temporal pointer – Hardware is temporal (mostly) • Spatial application software does not have an equivalent PC • Traditional state machines were created to treat the symptom of no software PC – Solution drop bread crumbs – We call these ‘state machines’ www.vsmerlot.com 12
  • 13. 5. My Solution • Create an application pointer (temporal) – One ‘time pointer’ for every Engine/Table – The time pointer keeps track of application logic – The time pointer is always available for progressive protocol based application – The time pointer eliminates most bread crumb logic www.vsmerlot.com 13
  • 14. www.vsmerlot.com Temporal State Machine (TSM) • Event or non-event driven applications • States are true or false – Transitions are next true or next false • Three fundamental parts – Engine (time, logic test, trace, and control) – Logic-Flow / Rule Table (class) – Data-Flow / Reusable Members • Logic-flow is orthogonal to data-flow – No control flow in data manipulation – No data manipulation in control flow 14
  • 15. www.vsmerlot.com TSM Structure • Engine/Table relationship – iTime is the pointer into array of rule/step – Table contains 1 or more rules – Each rule has a single entry point • Rules are like basic blocks • Array of rules consist of steps – Every step is a binary state • Each step has a test condition • Each step has a True Behavior • Each step has a Next Rule/Step (iTime pointer) • Each step has a False Behavior • Each step has a Next Rule/Step (iTime pointer) • Each step has a Trace (tied to the specification) 15
  • 16. www.vsmerlot.com TSM Pattern Data-Flow …On… …Off… …On… …Off… Logic-Flow Engine T-Trace F-Trace temporal• iTime pointer • Dynamically binds • Tracing – True Trace – False Trace 16 Table
  • 17. www.vsmerlot.com Temporal vs. Spatial ITE • Temporal domain – Time Indexed • Reduces complexity – State diagrams – Call diagrams – Models • Reduces code size • Increases reuse • Includes trace • Preemptable • Spatial domain – Test bread crumbs • Increases complexity – State diagrams – Call diagrams – Models • Increases code size • Decreases reuse • Manual trace • ~Not Preemptable 17
  • 18. www.vsmerlot.com Engine / Table Relationship Engine • Engine is temporal (iTime) • Preemption control (while) – Test condition (if – state) • Dynamic bind True Behavior – Next True Rule/Step iTime – True Trace • Dynamic bind False Behavior – Next False Rule/Step iTime – False Trace – End if – logic – End while – control loop Table • Each row is a temporal sequence – Rule/Step (name) – Test condition (state) • True Behavior – Next True Rule/Step • False Behavior – Next False Rule/Step – Trace (unique to app) 18
  • 19. www.vsmerlot.com 6. Implementation procedure TCOSAFrame.Run(intState integer); begin bEngineLocal := TRUE; iState := intState; while bEngineLocal AND bEngineGlobal do begin if iState = rRule[iTime].iState then begin rRule[iTime].pTrueRule; True_Trace(iTime); iTime := rRule[iTime].iTrueRule; end else begin rRule[iTime].pFalseRule; False_Trace(iTime); iTime := rRule[iTime].iFalseRule; end; end; end; iTime is temporal Determined by logic 19 Dynamically Bind-True Dynamically Bind-False
  • 20. Delphi Structure Setup // ************** Temporal Rules Definition ****************** pProcedureType = procedure of Object; // Dynamic Bind Definition TCOSARules = class public // the logic test can also be defined as a Boolean function private iTime : integer; iState : integer; // logic test // Static State Definition pTrueRule : pProcedureType; // Dynamic Bind True iTrueRule : integer; pFalseRule : pProcedureType; // Dynamic Bind False iFalseRule : integer; iTrace : integer; end; www.vsmerlot.com 20
  • 21. Delphi Logic Table Setup rRule : Array [0..24] of TCOSARules; // logic table allocation procedure pBRT(iTime : integer; iState : integer; pTrueRule : pProcedureType; iTrueRule : integer; pFalseRule : pProcedureType; iFalseRule : integer; iTrace : integer); // prototype fill logic array www.vsmerlot.com 21
  • 22. Implementation Logic procedure TCOSAcalc.pBRT(iTime : integer; iState : integer; pTrueRule : pProcedureType; iTrueRule : integer; pFalseRule : pProcedureType; iFalseRule : integer; iTrace : integer); begin rRule[iTime] := TCOSARules.Create; // create row rRule[iTime].iTime := iTime; // fill in row rRule[iTime].iState := iState; rRule[iTime].pTrueRule := pTrueRule; rRule[iTime].iTrueRule := iTrueRule; rRule[iTime].pFalseRule := pFalseRule; rRule[iTime].iFalseRule := iFalseRule; rRule[iTime].iTrace := iTrace; end; www.vsmerlot.com 22
  • 23. Dynamic Calls Build Logic // Next Next // Rules Static True True False False // Steps State Behavior Rule Behavior Rule Trace pBRT(rOpr1, iNeg44, Negate, rOpr1+1,Clr_Buf, rOpr1+1,100); pBRT(rOpr1+1,iDigit, Any_Number,rOpr1+1,Ignore, rOpr1+2,101); pBRT(rOpr1+2,iDot59, One_Period,rOpr1+3,Ignore, rOpr1+4,102); pBRT(rOpr1+3,iDigit, Any_Number,rOpr1+3,Ignore, rOpr1+4,103); www.vsmerlot.com 23
  • 24. 23-Steps of Calculator Logic www.vsmerlot.com 24
  • 25. www.vsmerlot.com The User Perspective (tends to be temporal) • Calculator – Enter Operand 1 (optional sign) – Enter Operation ( + - * / ) – Enter Operand 2 (optional sign) – Select Result Type ( = % ( + - * / )) • The user perspective is generally temporal • Let’s look at entering – ‘-’ ‘3’ ‘.’ ‘1’ ‘4’ ‘1’ ‘5’ ‘9’ – Followed by the Subtract Operation 25
  • 33. Entered 9 Count Step Trace Eng Static Dynamic Behavior Value 1 +T= 0; 100 Off; 44; 44; Negate; N=- 2 +T= 1; 101 Off; 1; 1; Any_Number N=-3 3 ĞF= 1; 101 On; 1; 59; Ignore; N= 4 +T= 2; 102 Off; 59; 59; One_Period; N=-3. 5 +T= 3; 103 Off; 1; 1; Any_Number N=-3.1 6 +T= 3; 103 Off; 1; 1; Any_Number N=-3.14 7 +T= 3; 103 Off; 1; 1; Any_Number N=-3.141 8 +T= 3; 103 Off; 1; 1; Any_Number N=-3.1415 9 +T= 3; 103 Off; 1; 1; Any_Number N=-3.14159 Trace temporal
  • 36. Not CE or C temporal
  • 38. 10 ĞF= 3; 103 On; 1; 44; Ignore; N= 11 ĞF= 4; 104 On; 12; 44; Ignore; N= 12 ĞF= 5; 105 On; 11; 44; Ignore; N= 13 ĞF= 6; 106 On; 1; 44; Push_Disp; N= 14 ĞF= 7; 500 On; 43; 44; Ignore; N= 15 +T=8; 501 On; 44; 1; Subtraction; N=-3.14159 TraceMatch Subtraction temporal
  • 39. www.vsmerlot.com Understanding the Time Index ENTER Rule State True Action Next True False Action Next False ‘-’ rOper1 = <iNeg44>? Negate rOper1+1 Ignore rOper1+1 ‘3’ +1 = <iDigit>* Any_Number rOper1+1 Ignore rOper1+2 ‘.’ +2 = <iDot59>? One_Period rOper1+3 Ignore rOper1+4 ‘14159’ +3 = <iDigit>* Any_Number rOper1+3 Ignore rOper1+4 Time +4 39 • I know where I am • I know where I came from • I know where I am going • At iTime + 4 ‘-’ is “not a number” from iTime+3 Time
  • 40. www.vsmerlot.com 7. Quantification T TR DS Behavior Value 1 100 44; Negate; N= - 2 101 1; Any_Number; N= -3 3 101 59; Ignore; N= 4 102 59; One_Period; N= -3. 5 103 1; Any_Number; N= -3.1 6 103 1; Any_Number; N= -3.14 7 103 1; Any_Number; N= -3.141 8 103 1; Any_Number; N= -3.1415 9 103 1; Any_Number; N= -3.14159 10 103 44; Ignore; N= Compare Temporal Trace 40
  • 41. To Spatial Trace www.vsmerlot.com 41 T Behavior e->sig Value O O O 19, g-negated1, 2, 0 20, negated1 21, g-negated1, 1, -0 22, g-negated1, 1010, -0 O O O 31, int1 32, g-int1, 1, -3 33, g-int1, 1101, -3 34, g-frac1, 0, -3. O O O 37, g-frac1, 2, -3. 38, frac1 39, g-frac1, 1, -3. 40, g-frac1, 1010, -3. O O O 45, g-frac1, 1107, -3.14159 46, g-Oper1, 1107, -3.14159 47, g-frac1, 3, -3.14159 48, g-opEntered, 0, -3.14159 49, g-Oper1, 0, -3.14159 50, g-Oper1, 3, -3.14159 51, g-opEntered, 2, -3.14159 52, opEntered 53, g-opEntered, 1, -3.14159 54, g-opEntered, 1107, -3.14159
  • 42. Temporal-Logic Counts www.vsmerlot.com 42 • -3.14159 – ten steps to enter nine actions – 90% efficient – 10% of cost is overhead • -3.14159 - - 2.14195 = thirty steps for eighteen actions – 60% efficient – 40% of cost is overhead
  • 43. Spatial-Logic Counts • -3.14159 – fifty-four steps for nine actions – 16.67 % efficient – 83.34% of cost is overhead • -3.14159 - - 2.14195 = ninety-six steps for eighteen actions – 18.75 % efficient – 81.25% of cost is overhead www.vsmerlot.com 43
  • 44. Spatial Enter “-” Only Trc= 1, g-calc, sig= 0 ; Operand= , Trc= 2, g-calc, sig= 0 ; Operand= , Trc= 3, g-calc, sig= 1 ; Operand= , Trc= 4, g-clear; Operand= , Trc= 5, g-ready, sig= 0 ; Operand= 0, Trc= 6, g-ready, sig= 2 ; Operand= 0, Trc= 7, g-ready, sig= 1 ; Operand= 0, Trc= 8, g-begin, sig= 0 ; Operand= 0, Trc= 9, g-begin, sig= 2 ; Operand= 0, Trc= 10, g-begin, sig= 1 ; Operand= 0, Trc= 11, g-begin, sig= 1107 ; Operand= 0, Trc= 12, g-negated1, sig= 0 ; Operand= 0, Trc= 13, g-begin, sig= 0 ; Operand= 0, Trc= 14, g-calc, sig= 0 ; Operand= 0, Trc= 15, g-begin, sig= 3 ; Operand= 0, www.vsmerlot.com 44 Trc= 16, g-ready, sig= 3 ; Operand= 0, Trc= 17, g-ready, sig= 0 ; Operand= 0, Trc= 18, g-negated1, sig= 2 ; Operand= 0, Trc= 19, g-negated1, sig= 1 ; Operand= -0, Trc= 20, g-negated1, sig= 100 ; Operand= -0, Trc= 21, g-calc, sig= 100 ; Operand= -0, Trc= 22, g-negated1, sig= 3 ; Operand= -0, Trc= 23, g-final, sig= 0 ; Operand= -0, - End of Analysis Trc= 24, g-calc, sig= 0 ; Operand= -0, Trc= 25, g-calc, sig= 3 ; Operand= -0, Trc= 26, g-final, sig= 2 ; Operand= -0, Trc= 27, g-final, sig= 1 ; Operand= -0, - End of Analysis
  • 45. www.vsmerlot.com A Temporal State Diagram • Simple state view • True Behavior – One green arrow • False Behavior – One red arrow • Temporal – Trace – Specification • Compliance 45
  • 48. Summary Temporal Actions Logic Steps Efficiency Overhead ‐pi 9 10 90.0% 10.0% ‐pi‐(‐pi‐1) 18 30 60.0% 40.0% Spatial ‐pi 9 54 16.67% 83.34% ‐pi‐(‐pi‐1) 18 96 18.75% 81.25% www.vsmerlot.com 48
  • 49. www.vsmerlot.com 8. Why Time is Important • Understanding “Time” in software means not having to do an “if” to test where the program is executing and what has happened. – 23 Logic points-Temporal calculator example – 112 Logic points-Spatial calculator example – Sampling of spatial logic tests • 3 tests for IDC_PLUS • 4 tests IDC_MINUS • 2 tests IDC_MULT • 2 tests IDC_DIVIDE • 9 tests for IDC_0 • 11 tests for IDC_1_9 49
  • 50. Spatial Software • Must leave a trail of “bread crumb” states – This is pure overhead • Must track down where it was – This is pure overhead • Difficult to maintain – Keeping the overhead straight • Difficult to modify – Keeping the overhead straight www.vsmerlot.com 50
  • 51. Temporal Software • Keeps a temporal pointer • Reduces complexity • Eliminates much of the overhead • Easier to maintain • Easier to modify – Add new rule – Change the logic www.vsmerlot.com 51
  • 52. Software Quality • Testing doesn’t improve quality – Testing fixes quality problems – Quality is still poor • Temporal engineering – Improves quality – Reduces overhead logic – Fewer things to go wrong www.vsmerlot.com 52
  • 53. Where I’ve Used Temporal • Disk driver analysis (Symbios Logic) • Data migration (US West / HP) • Data filtering • Lexer/Parser – Data analyzer • Radar control system • Robotic arm control • Embedded applications • Code generator www.vsmerlot.com 53
  • 54. The End – Definitions • COSA – Coherent Object System Architecture – U.S. Patent #6,345,387 abandoned by inventor – Available to the public in book: Breaking the Time Barrier – NOT associated with www.rebelscience.org • BNF – Backus-Naur Format – Diagramming the logic of syntax – Basis for temporal engineering • ITE – If-Then-Else logic – commonly referred to as ‘spaghetti code’ • CMU – Carnegie Mellon University • SEI – Software Engineering Institute at CMU • CPU – Central Processing Unit • UML – Unified Modeling Language www.vsmerlot.com 54