Jussi Rintanen
Professor of Artificial Intelligence and Software Systems – Aalto University
Jussi is a computer scientist with interests in automating the solution of complex problems which earlier have required the use of human intelligence. His research belongs to the areas of automated reasoning, combinatorial search and optimization, and artificial intelligence.
2. The Problem
• Massive programmer shortage:
• Finland: 7000+
• USA: 200000+
• Programmer productivity too low
• Programming is a craft industry
Completely new kind of solutions are needed!
3. How do we program computers?
mov ax,@data
mov ds,ax
mov bx,si_ze
dec bx
xx:
mov cx,bx
mov si,0
yy:
mov al,a[si]
inc si
cmp al,a[si]
jb zz
xchg al,a[si]
mov a[si-1],al
zz:
loop yy
dec bx
jnz xx
4. How do we program computers?
40 N = N - 1
70 ISCAN = 1
IOK = 1
ISTOP = N
IF(ISTART - ISTOP) 50, 110, 110
50 IF(NUMS(ISCAN) - NUMS(ISCAN+1)) 90,90,60
60 J = NUMS(ISCAN)
NUMS(ISCAN) = NUMS(ISCAN+1)
NUMS(ISCAN+1) = J
IOK = 0
90 IF(ISCAN - (ISTOP - 1)) 80,100,100
80 ISCAN = ISCAN + 1
GOTO 50
100 IF(IOK) 105,105,110
105 ISTOP = ISTOP - 1
GOTO 70
110 DO 120 I=1, N
120 PRINT 130, NUMS(I)
130 FORMAT(I10)
STOP
END
5. How do we program computers?
for (c = 0; c < n; c++)
scanf("%d", &array[c]);
for (c = 0 ; c < n - 1; c++)
{
for (d = 0 ; d < n - c - 1; d++)
{
if (array[d] > array[d+1]) /* For decreasing order use < */
{
swap = array[d];
array[d] = array[d+1];
array[d+1] = swap;
}
}
}
6. What are programs good for?
• Easy to compile to machine code
• Easy to execute
• Easy to understand what it really does, in terms of
machine code
7. What are programs not so good for?
• Difficult to prove correct
• Difficult to analyze and reason about
• Difficult to use for other purposes than execute
(This is why testing beats correctness proofs)
• Difficult to understand (by programmer, other people)
8. Model-Based Approach to Software
SW for managing electricity networks
Model of a network:
• power lines
(topology)
• switches
• protection devices
• transformers
• customer
connections
Functionalities:
• Monitoring and diagnosis
• Control and reconfiguration
• Management of maintenance
crews
• Medium and long-term planning
of network maintenance,
modifications, extensions
9. Model-Based Approach to Software
SW for data-intensive applications
Model of an application:
• Data model
• Rules governing change of data
• Permissions to access, modify
(who? when?)
Functionalities:
• Analyze the model
• Implement the model
(code)
• Automate tasks (A.I.)
10. Our Goals
• Make (some of) SW development engineering
• Systematic process to develop SW specifications
• “AI” to do (almost) all of the routine coding
• Lift the abstraction level of code written by programmers
• Shift focus from code to business/organizational processes
• Result:
• Decreased development effort
• Easier testing and validation
• More modifiable and extendible SW
• Independence from execution environment (PL, OS, DBMS, UI)
11. Our Goals: Longer Term
• Intelligent agents (A.I.) supporting (and replacing) humans
in organizational roles
• Networks of interacting and inter-operating SW systems
• Fully automated companies, agencies, services, ...
• Integration with physical assets and infrastructure
• management of primary industries, energy, manufacturing,
transportation and logistics, services, ...
12. EIAI / aitocode: Software Production
users
HTML/HTTP
mobile apps
email/messaging
SW
DBMS
cloud storage
external SW
13. How Is Software Produced?
1 Precisely specify what the software is to do
2 Analyze software specification (automatic)
3 Choose:
• Programming language
• Database system(s)
• Operating system / execution environment
4 Synthesize software system (automatic)
5 Deploy software system (automatic)
14. Abstract View of Software
1 A university employee can establish a new
course in a given faculty, if the employee is
the director of education of the faculty.
2 A university employee can change the
responsible teacher of a course, if the
employee is the director of education for the
faculty responsible for the course.
3 A university employee can change the
requirements for a B.Sc. degree granted by a
given faculty, if the employee is the director
of education of the faculty.
4 A student can be granted a B.Sc. degree, if
the student has passed all courses required
for the degree.
5 A student can register for a course, if the
student has the right to study at the
university, and the course is part of the
studies for a degree the student is studying
for.
6 A student can register for an exam, if the
student is registered for the course.
7 A university employee can record the exam
grade for a student, if the student was
registered for the exam, and the exam is for a
course for which the employee is the
responsible teacher.
8 A student is recorded as having passed a
course, if the student has passed an exam for
the course and fulfilled other requirements
(for example, done obligatory home
assignments and a course project.)
9 A university employee can mark a course as
passed for a student, if the employee is the
responsible teacher of the course, and the
student was enrolled on the course.
15. Rules of an Application
Each of the informal rules can formalized as three parts:
• Inputs
• What does the user supply when performing the action?
• Each input has a type (int, string, set, list, ...)
• Condition
• What condition has to hold for the action to be possible?
• Boolean combination of atomic conditions (and, or, not, ...)
• Also limits the possible inputs!
• Effect
• How does the action modify the data (in the DB)
• One or more pieces of “code”
16. Rules of an Application
Each of the informal rules can formalized as three parts:
• Inputs
• What does the user supply when performing the action?
• Each input has a type (int, string, set, list, ...)
• Condition
• What condition has to hold for the action to be possible?
• Boolean combination of atomic conditions (and, or, not, ...)
• Also limits the possible inputs!
• Effect
• How does the action modify the data (in the DB)
• One or more pieces of “code”
17. Rules of an Application
Each of the informal rules can formalized as three parts:
• Inputs
• What does the user supply when performing the action?
• Each input has a type (int, string, set, list, ...)
• Condition
• What condition has to hold for the action to be possible?
• Boolean combination of atomic conditions (and, or, not, ...)
• Also limits the possible inputs!
• Effect
• How does the action modify the data (in the DB)
• One or more pieces of “code”
18. Example
A Facebook-style social media application
Who can post on a wall?
• The owner of the wall
• Friends of the wall owner
Result: Post appears on the
wall and in all relevant feeds.
action post(p : feedData, wallOwner : user) {
wallOwner == currentuser
or currentuser in wallOwner.friends
==>
new ent : feedEntry [ t = now,
entry = p,
comments = [],
auth = currentuser.auth,
owner = currentuser ];
wallOwner.wall = concat(wallOwner.wall,[ent]);
currentuser.posts = concat(wallOwner.wall,[ent]);
forall (u in currentuser.friends)
u.feed = concat(u.feed,[ent]);
}
19. Example
Peer-reviewing for an academic journal
Some articles can be published
as a new volume if
• the current user is the editor
of the journal,
• the articles are unpublished
and belong to the journal,
• the set of articles is
non-empty.
action createNewVolume( p : article set,
j : journal ) {
currentuser == j.editor
and subseteq(p,j.unpublishedarticles)
and card(p) > 0
==>
j.lastvolumenumber = j.lastvolumenumber + 1;
j.unpublishedarticles = j.unpublishedarticles p;
new v : volume [ volumenumber = j.lastvolumenumber,
publicationtime = now,
articles = p ];
j.publishedvolumes = j.publishedvolumes U { v };
forall (a in p) a.volume = v;
}
20. How Is A Rule Implemented?
1 Is current user able to take the action? (UI menus etc.)
• Can precondition be true, for some inputs?
• Conceptually, must go through all possible input values
2 What input options to offer user? (UI input forms)
• Which input combinations can make precondition true?
• Conceptually, must produce all input combinations
3 Execute the rule
• Is precondition (with inputs) true? (easy)
• Execute the “Effects” part (easy)
• Implemented as a DBMS transaction
First two are both NP-hard (or harder)!
21. How Is A Rule Implemented?
1 Is current user able to take the action? (UI menus etc.)
• Can precondition be true, for some inputs?
• Conceptually, must go through all possible input values
2 What input options to offer user? (UI input forms)
• Which input combinations can make precondition true?
• Conceptually, must produce all input combinations
3 Execute the rule
• Is precondition (with inputs) true? (easy)
• Execute the “Effects” part (easy)
• Implemented as a DBMS transaction
First two are both NP-hard (or harder)!
22. How Is A Rule Implemented?
1 Is current user able to take the action? (UI menus etc.)
• Can precondition be true, for some inputs?
• Conceptually, must go through all possible input values
2 What input options to offer user? (UI input forms)
• Which input combinations can make precondition true?
• Conceptually, must produce all input combinations
3 Execute the rule
• Is precondition (with inputs) true? (easy)
• Execute the “Effects” part (easy)
• Implemented as a DBMS transaction
First two are both NP-hard (or harder)!
23. EIAI / aitocode: What We Have Now
Project since 2016, with 2018 funding from Business Finland
• Core technology completed
• Prototype implementation works
• Demo applications running
• peer-reviewing and publication for academic journals (10 rules)
• university course management (5 rules)
• social media (“Facebook”) (7 rules)
• blogging website (3 rules)
• web chat (2 rules)
• Other applications under development
24. EIAI / aitocode: Next Steps
• IDE integration (Q3/2019)
• Alternative PL, OS, DBMS, UI (Q3/2019)
• Mobile apps (2020)
• Verification/validation (2020)
• correctness proofs (w.r.t. stated properties)
• spec anomalies: unreachable and redundant actions & data
• Intelligence (2021)
• optimal data input (w.r.t. evaluation of a condition)
• suggest actions to human users (w.r.t. users’ goals)
• take action sequences autonomously
• minimization of a cost measure, maximization of a reward measure
25. Interested?
We are looking for collaboration partners:
• Companies to participate in technology trials
• Software developers willing to try out
• Everything else to transfer the technology to real use
26. Conclusion
• Automation of software production
• data and knowledge-intensive information systems
• web applications
• et cetera
• Future:
• Increased intelligence (automated embedding of “AI” in SW)
• Highly automated analytics and validation
Code is not interesting, systems and their features are!