Modal Proofs as Distributed Programs - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Modal Proofs as Distributed Programs

Description:

Natural deduction corresponds to sequent calculus. Soundness ... print(rpc (AtoB file, A), hp_B ) : printOut at B. pdf _at_ B at A. pdf at B. 09/04/2003 ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 40
Provided by: limi3
Category:

less

Transcript and Presenter's Notes

Title: Modal Proofs as Distributed Programs


1
Modal Proofs as Distributed Programs
  • Limin Jia Princeton University
  • Joint work with David Walker

2
Distributed computing is pervasive
  • Todays computing environments distribute data
    across networks of all shapes and sizes.
  • Software applications
  • Peer-to-peer file sharing (Kazaa).
  • Mobile code (Java applets).

3
Distributed computing is hard
  • Distributed environment is complicated
  • Data resides on different nodes
  • Nodes have different interfaces
  • Computational agents migrate from one node to
    another
  • Failures

4
Contribution
  • Developed a modal logic for reasoning about
    networks.
  • Derived a type system for a distributed
    programming language.
  • Program doesnt go wrong

5
Outline
  • Motivation
  • Modal logic for reasoning about networks
  • Logic inference rules
  • Modal operators (necessity, possibility)
  • Lambda RPC
  • Syntax
  • Simple examples
  • Related work

6
Modal logic
  • ? F at p (where a formula is true
  • as well as whether it is
    true)
  • Eg ? printer at B (There is a printer at B).
  • p ? P (set of abstract places)

7
Formulas
  • Formulas
  • F A T F1 ? F2 F1 ? F2
  • F _at_ p
  • Reasoning locally within a node
  • ( A , T , F1 ? F2 , F1 ? F2 )
  • Reasoning across nodes
  • ( F _at_ p )
  • Eg printer_at_B

8
Judgment
  • Logical contexts
  • D . D , F at p
  • Hypothetical judgments
  • D ? P F at p

9
Local reasoning
10
Local reasoning
11
Sample reasoning (I)
? printer at B, pdf at B, printer
? pdf ? printOut at B
? ? printer ? pdf at B ? ? printOut at B
? printer at B, pdf at C,
printer ? pdf ? printOut at B
12
Interplace reasoning
F_at_p
13
Sample reasoning (II)
? printer at B, printer ? pdf ? printOut
at B, pdf at A, pdf ? pdf _at_ B at A
? ? pdf _at_ B at A ? ? pdf at B ? ? printOut at B
14
Outline
  • Motivation
  • Modal logic for reasoning about networks
  • Logic inference rules
  • Modal operators (necessity, possibility)
  • Lambda RPC
  • Syntax
  • Simple examples
  • Related work

15
Global reasoning
  • Some facts are true everywhere
  • Eg ls command is available on every node.
  • A modal formula expresses facts true everywhere
  • ? P F everywhere
  • ?F (modal necessity)
  • ?F (F is true somewhere, modal possibility)

16
Syntax (cont.)
  • Formulas
  • F ?F ?F
  • Logical contexts
  • D . D , F at p
  • G . G, F
  • Hypothetical judgments
  • G D ?P F at p

17
Hypothetical judgments
G
G, F D ? P F at p
L
G D , F at p ? P F at p
18
Modal operator rules (I)
q ? FP(G) ? FP(D) ? FP(F)
? I
G D ? P ?F at p
G D ? P ?F at p
G , F D ? P F at p
G D ? P F at p
19
Modal operator rules (II)
G D ? P F at p
? I
G D ? P ?F at p
  • D ? P ?F at p

G D , F at q ? Pq F at p
q ? FP(F) ? FP(p)
G D ? P F at p
20
Sample reasoning (III)
? printer at B, printer ? pdf ? printOut
at B, ?(pdf ? pdf _at_ B) at B, pdf at
C
- ? ? printOut at B
21
Properties of the logic
  • Simple properties
  • Local soundness and completeness
  • Substitution lemma
  • Natural deduction corresponds to sequent calculus
  • Soundness
  • Completeness
  • sequent calculus
  • Cut-elimination

22
Outline
  • Motivation
  • Modal logic for reasoning about networks
  • Logic inference rules
  • Modal operators (necessity, possibility)
  • Lambda RPC
  • Syntax
  • Simple examples
  • Related work

23
?RPC overview
  • Programming language for distributed computing
  • Logic ? type system
  • F at p ? t at p
  • When e is evaluated at place p it will produce a
    value of type t

24
Computational model
  • Computation occurs on network N
  • N (P,L)
  • L - L, l ? e at p (set of processes)

25
?RPC syntax
  • t b T t t t ? t
  • t _at_ p return values for a remote procedure
    call
  • ?t broadcast
  • ?t non-broadcast portable values
  • ?t agents

26
?RPC syntax
  • e
  • c x () const/var/T
  • (e1, e2) fst e snd e pairs (?)
  • lx.e e1e2 functions (?)
  • ret(e, p) rpc(e, p) remote procedure call
    (t _at_ p).

27
RPC
28
Simple example (I)
? file pdf at A, AtoB pdf ? pdf
_at_ B at A, hp_B prn at B,
print pdf ? prn ? printOut at B
? ? print(rpc (AtoB file, A), hp_B )
printOut at B
29
Broadcast
  • e close(?p.e) bc e1 at p2 as x in e2
    broadcast (?t)

30
Broadcast
  • e close(?p.e) bc e1 at p as x in e2
    broadcast (?t)

(bc at p2 as x in e2) l2 ? ep1 /p
close(?p.e) l2 ? ep2/p
p1
p2

31
Broadcast
  • e close(?p.e) bc e1 at p as x in e2
    broadcast (?t)

e2 l2 / x l2 ? ep1 /p
close(?p.e) l2 ? ep2 /p
p1
p2

32
Portable values (pull)
  • e port(?p.e) pull e1 at p2 as x in e2
    pull (?t)

33
Portable values (pull)
  • e port(?p.e) pull e1 at p as x in e2
    pull (?t)

e2 ?p.e /x
port(?p.e)
p1
p2

34
Example program
  • let delete
  • ?k ? key.
  • let del
  • pull k at server as k' in
  • close ?p.deleteDb k'
  • in bc del at server as _ in ()
  • end
  • in .

35
Properties of the language
  • Formalized the operational semantics
  • Safety (progress preservation)
  • Resources cannot be used at a wrong place
  • Other features
  • Recursive functions
  • References
  • Universal quantifiers

36
Related work
  • Hybrid logic Prior 1967
  • Classical
  • Ambient calculus (logic) Cardelli, Gordon
  • Logic for reasoning about evolution of
    distributed systems
  • Logic uses calculus as a model
  • Other interpretations of modal logic
  • Staged computation Pfenning, Davies 2001
  • Trustless grid computing in Concert project
  • Moody 2003

37
Conclusion
  • Developed a modal logic
  • F _at_ p, ?F, ?F
  • Developed a programming language and type system
  • Well-typed programs dont try to access resources
    at the wrong place
  • http//www.cs.princeton.edu/ljia/research/papers/
    esop04.pdf

38
Thanks
39
?RPC syntax
  • e
  • c x sync(x) run(x, p)
    () const/var/T
  • (e1, e2) fst e snd e pairs (?)
  • lx.e e1e2 functions (?)
  • ret(e, p) rpc(e, p) rpc (_at_)
  • close(?p.e) bc e1 at p as x in e2
    broadcast (?)
  • port(?p.e) pull e1 at p as x in e2
    portable (?)
  • agente, p go e1 at p return x,p in e2
    agent(?)
  • v c lx.e (v1, v2) ret(e, p)
    close(?p.e)
  • port(?p.e) agente, p
Write a Comment
User Comments (0)
About PowerShow.com