logic in computer science, engineering, industry (and ... · computability three approaches...

32
1 LOGIC in computer science, engineering, industry (and, time permitting, math) Yuri Gurevich Microsoft Research

Upload: others

Post on 17-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

11

LOGIC in computer science, engineering, industry(and, time permitting, math)

Yuri Gurevich

Microsoft Research

Page 2: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

ALL MAJOR LOGIC IDEASOF PRE-COMPUTER AGE

FOUND APPLICATIONS IN CS

2

Page 3: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Types

Frege; Russell & Whitehead

Programming languages

Java virtual machine, .Net

3

Page 4: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Computability

Three approaches

Recursive functions

Lambda calculus

Turing machines

4

Page 5: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Recursion in CS

Syntax of various formal languages

Runtime recursion

5

Page 6: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Lambda calculus

Functional programming languages

6

Page 7: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Machines

Time and space classes

Juris Hartmanis and Boris Trakhtenbrot

P=?NP

Steve Cook

Leonid Levin

7

Page 8: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Model theory

Relational databases

First-order structures. Schemas, with their attributes, are improved vocabularies

Codd’s operations vs. Tarski’s cylindrical algebra

Implementation independence, and polynomial time for arbitrary structures (not only strings)

8

Page 9: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Proof theory logic engines

SAT solvers

Satisfiability modulo theories

Proof engines

9

Page 10: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

NEW CS ISSUES UNFORESEEN BY PRE-CS LOGICIANS

10

Page 11: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Finite automata

Rabin & Scott

Lexical analysis

11

Page 12: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Formal languages

Kleene’s regular languages

Context-free languages

12

Page 13: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Levels of abstraction

Machine languages, assembly languages, programming languages, specification languages

Compilers, interpreters, translators

13

Page 14: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

One under-appreciated achievement

Solve the “proportion”

𝐹𝑆𝐴

𝑅𝑒𝑔=𝑁𝑃𝐷𝐴

𝐶𝐹=𝑃𝐷𝐴

𝑋

Knuth’s solution revolutionized compiler construction.

14

Page 15: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Software engineering V-diagram

15

Wikipedia’s “V-model”

Page 16: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Software specifications

Declarative vs. operational

Abstract state machines

Spec Explorer

16

Page 17: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

EXPLICIT & IMPLICIT USE OF LOGIC BY COMPUTER ENGINEERS

17

Page 18: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Electrical engineers have been using logic explicitly

Boolean circuits

Many-valued logics

But the implicit use is more important.

18

Page 19: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Proliferation of formal languages

Programming languages

Database languages

Specification languages

Authentication/authorization languages

Hardware specification languages, especially Verilog

19

Page 20: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Logic day in and day out

Writing specifications and programming at ever increasing levels of abstraction

Writing compilers. A compiler to L is often written in L.

Model checking, model based testing, conformance testing

Creating specialized languages, e.g. XACML

Formalizing stuff e.g. certificates, claims

Increasing use of provers

20

Page 21: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Engineers do not know logic

Few studied logic. Instead they studied calculus which they rarely, if ever, use.

Even the brightest of them – brilliant folks –as a rule do not know logic.

21

Page 22: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

They do not have the necessary vocabulary

From a conversation with a talented software architect.

“I guess their language is a subset of yours."

22

Page 23: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

WHAT DIVIDESLOGICIANS & ENGINEERS?

23

Page 24: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Syntax divide:precise vs. “precisable”

Logicians are cavalier about syntax. We speak about formulas but rarely write them in full.

Engineers take syntax seriously.

24

Page 25: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Semantics divide

Engineers often are cavalier about meaning; often syntax is presumed to convey the meaning.The price for this may be large.

Logicians take semantics seriously. But of course we live in a cleaner world.

It is not enough that software has the right functionality. It should have good performance, be maintainable, be legacy compatible, etc.

It is soundness that is most needed to engineers. Completeness is typically too good to be true.

25

Page 26: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Feasibility divide

A problem with complexity: it is asymptotical.

We used to neglect complexity altogether.“Wlog 𝜑 is in cnf.”

Engineer’s feasibility is realistic, down-to-earth.

26

Page 27: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Declarative/operational divide

Logicians like declarative approaches these tend to be limited in engineering, e.g. because software evolves.

Even in largely declarative domains typically there are operational aspects. Authorization: if a then send permit p to x.

Obligations have imperative aspects.

An important goal of the ASM theory was to bridge that divide: high-level and operational are consistent.

27

Page 28: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

LOGIC & MATH

28

Page 29: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

A history flash

USA. Logicians have been fighting hard to get acceptance, with patchy success.

Europe on the example of ETH Zurich.

Past: Zermelo, H. Weyl, Gonseth, Bernays, Specker, H. Lauchli, Engeler.

Present: nobody.

Russia on a one-man example.

Kolmogorov did logic in 1920s and 1930suntil it became too risky.

After the 1960s thaw, he headed Logic Dept of Moscow State University till his death.

29

Page 30: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Future

There is inertia in academy, yet in the long run much depends on whether logicians contribute to math.To contribute, you better know relevant math intimately. Hence the key question:

Is it easier for you to learn relevant math, or for a mathematician to learn (or get around) relevant logic?There have been impressive successes, and surely there will be more. Yet I remain skeptical about the future of logic in math.

30

Page 31: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

Lefschetz’s principle

Tarski, but also Chevaller (Constructive sets are

closed under projections.)

“Although I am aware of the precise formulations using first order logic and beyond ..., I tend not to use them. Rather I view the Lefschetz principle as more of a philosophical principle of what ought to be possible in general, and do the necessary verifications as and when I need them ... I suspect this attitude is pretty common among many algebraic geometers,” Donu Arapura.

31

Page 32: LOGIC in computer science, engineering, industry (and ... · Computability Three approaches Recursive functions Lambda calculus Turing machines 4. Recursion in CS Syntax of various

THANKS

32