programming in linear temporal logic
play

Programming in Linear Temporal Logic Correspondence Categorical - PowerPoint PPT Presentation

Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal CurryHoward Programming in Linear Temporal Logic Correspondence Categorical Semantics for Restricted LTL and FRP Wolfgang Jeltsch Hybrid Signals Functional Reactive


  1. Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal Curry–Howard Programming in Linear Temporal Logic Correspondence Categorical Semantics for Restricted LTL and FRP Wolfgang Jeltsch Hybrid Signals Functional Reactive Brandenburgische Technische Universität Cottbus Dataflow Programming Cottbus, Germany Seminar talk at the Institute of Cybernetics Tallinn, Estonia February 10, 2011

  2. Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal The Temporal Curry–Howard Correspondence Curry–Howard Correspondence Categorical Semantics for Categorical Semantics for Restricted LTL and FRP Restricted LTL and FRP Hybrid Signals Hybrid Signals Functional Reactive Dataflow Programming Functional Reactive Dataflow Programming

  3. Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal The Temporal Curry–Howard Correspondence Curry–Howard Correspondence Categorical Semantics for Categorical Semantics for Restricted LTL and FRP Restricted LTL and FRP Hybrid Signals Hybrid Signals Functional Reactive Dataflow Programming Functional Reactive Dataflow Programming

  4. Programming in Linear Temporal Logic Linear Temporal Logic Wolfgang Jeltsch The Temporal Curry–Howard ◮ trueness of a proposition depends on time Correspondence ◮ times are natural numbers Categorical Semantics for Restricted LTL ◮ propositional logic extended with four new constructs: and FRP � ϕ ϕ will hold at the next time Hybrid Signals � ϕ ϕ will always hold Functional Reactive Dataflow � ϕ ϕ will eventually hold Programming ϕ ⊲ ψ ϕ will hold for some time, and then ψ will hold ◮ for now only � and � : ◮ restricted LTL ◮ continuous time also possible

  5. Programming in Embedding into predicate logic Linear Temporal Logic ◮ temporal formula ϕ can be translated into predicate Wolfgang Jeltsch logic formula � ϕ � The Temporal ◮ � ϕ � may contain a single free variable t that denotes Curry–Howard Correspondence the time Categorical Semantics for ◮ atomic propositions p correspond to predicates ˆ p Restricted LTL and FRP that take a time argument Hybrid Signals ◮ translation for propositional logic fragment: Functional Reactive Dataflow � p � = ˆ p ( t ) � ϕ ∧ ψ � = � ϕ � ∧ � ψ � Programming �⊤� = ⊤ � ϕ ∨ ψ � = � ϕ � ∨ � ψ � �⊥� = ⊥ � ϕ → ψ � = � ϕ � → � ψ � ◮ translation for � and � : � � ϕ � = ∀ t ′ ∈ [ t , ∞ ) . � ϕ � [ t ′ / t ] � � ϕ � = ∃ t ′ ∈ [ t , ∞ ) . � ϕ � [ t ′ / t ]

  6. Programming in Restricted LTL as a type system Linear Temporal Logic ◮ type inhabitation depends on time Wolfgang Jeltsch ◮ simple type system extended with two new type The Temporal constructors � and � Curry–Howard Correspondence ◮ temporal type α can be translated into dependent Categorical type � α � Semantics for Restricted LTL ◮ � α � may contain a single-free variable t that denotes and FRP the time Hybrid Signals ◮ translation for � and � : Functional Reactive Dataflow � � α � = Π t ′ ∈ [ t , ∞ ) . � α � [ t ′ Programming / t ] � � α � = Σ t ′ ∈ [ t , ∞ ) . � α � [ t ′ / t ] ◮ concepts from Functional Reactive Programming (FRP): � behaviors � events ◮ restricted LTL corresponds to a strongly typed form of FRP ◮ t denotes start times of behaviors and events

  7. Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal The Temporal Curry–Howard Correspondence Curry–Howard Correspondence Categorical Semantics for Categorical Semantics for Restricted LTL and FRP Restricted LTL and FRP Hybrid Signals Hybrid Signals Functional Reactive Dataflow Programming Functional Reactive Dataflow Programming

  8. Programming in Basics Linear Temporal Logic ◮ categorical models should be CCCCs: Wolfgang Jeltsch ◮ LTL extends propositional logic ◮ FRP extends simply-typed λ -calculus The Temporal Curry–Howard Correspondence ◮ components of a categorical model: Categorical objects propositions/types Semantics for Restricted LTL morphisms time-independent proofs/functions: and FRP Hybrid Signals f : α → β ⇒ f : Π t . � α � → � β � Functional Reactive Dataflow Programming ◮ � and � are (endo)functors: f : α → β f : α → β � f : � α → � β � f : � α → � β ◮ start time consistency is ensured: � : (Π t . � α � → � β � ) → (Π t . � � α � → � � β � ) � : (Π t . � α � → � β � ) → (Π t . � � α � → � � β � )

  9. Programming in Operations on behaviors Linear Temporal Logic ◮ � is a comonad: Wolfgang Jeltsch head : � α → α The Temporal Curry–Howard tails : � α → �� α Correspondence Categorical ◮ � is a strong cartesian functor: Semantics for Restricted LTL units : 1 → � 1 and FRP Hybrid Signals zip : � α × � β → � ( α × β ) Functional Reactive Dataflow ◮ � is not an applicative functor: Programming ◮ lifting of pure values would have to be possible: const : α → � α ◮ would break start time consistency: const : Π t . � α � → Π t ′ ∈ [ t , ∞ ) . � α � [ t ′ / t ] ◮ however, this is possible: f : 1 → α � f ◦ units : 1 → � α

  10. Programming in Operations on events Linear Temporal Logic ◮ � is a monad: Wolfgang Jeltsch now : α → � α The Temporal Curry–Howard join : �� α → � α Correspondence Categorical ◮ � is not a strong monad: Semantics for ◮ time shifting of values would have to be possible: Restricted LTL and FRP shift : α × � β → � ( α × β ) Hybrid Signals Functional Reactive ◮ would break start time consistency: Dataflow Programming shift : Π t . � α � × � � β � → Σ t ′ ∈ [ t , ∞ ) . � α � [ t ′ / t ] × � β � [ t ′ / t ] ◮ however, � is � -strong: age : � α × � β → � ( � α × β ) ◮ sampling can be derived: sample : � α × � β → � ( α × β ) sample = � ( head × id ) ◦ age

  11. Programming in From S4 to restricted LTL Linear Temporal Logic ◮ until now, we have categorical models for CS4/IS4 Wolfgang Jeltsch ◮ no big surprise: The Temporal ◮ classically, restricted LTL is a specialization of S4 Curry–Howard Correspondence ◮ intuitionistically, it is too Categorical ◮ classical S4 and restricted LTL differ in their restrictions Semantics for Restricted LTL on the accessibility relation: and FRP S4 reflexive order Hybrid Signals Functional Reactive restr. LTL total reflexive order Dataflow Programming ◮ add a further operation that ensures totality of time: race : � α × � β → � ( α × β + α × � β + � α × β ) ◮ possible outcomes of time comparison represented by the different alternatives: = α × β < α × � β > � α × β

  12. Programming in Linear Temporal Logic Wolfgang Jeltsch The Temporal The Temporal Curry–Howard Correspondence Curry–Howard Correspondence Categorical Semantics for Categorical Semantics for Restricted LTL and FRP Restricted LTL and FRP Hybrid Signals Hybrid Signals Functional Reactive Dataflow Programming Functional Reactive Dataflow Programming

  13. Programming in ⊲ -LTL and its corresponding FRP dialect Linear Temporal Logic ◮ translation of ⊲ -formulas into predicate logic formulas: Wolfgang Jeltsch � ϕ ⊲ ψ � = ∃ t ′ ∈ ( t , ∞ ) . ( ∀ t ′′ ∈ [ t , t ′ ) . � ϕ � [ t ′′ / t ]) ∧ � ψ � [ t ′ / t ] The Temporal Curry–Howard ◮ ⊲ as a type constructor of FRP: Correspondence Categorical � α ⊲ β � = Σ t ′ ∈ ( t , ∞ ) . (Π t ′′ ∈ [ t , t ′ ) . � α � [ t ′′ / t ]) ×� β � [ t ′ / t ] Semantics for Restricted LTL ◮ components of a value of type α ⊲ β : and FRP ◮ a finite behavior with values of type α Hybrid Signals ◮ a terminating event with a value of type β Functional Reactive Dataflow ◮ introduction of weak variant of ⊲ that does not Programming guarantee termination ◮ notation: ⊲ ⊥ strong variant ( ⊲ as defined above) ⊲ ⊤ weak variant ◮ � and � now derivable: � α = α ⊲ ⊤ 0 � β = β + 1 ⊲ ⊥ β

  14. Programming in Applications of ⊲ -types Linear Temporal Logic ◮ ⊲ -types are useful as such: Wolfgang Jeltsch ◮ temperatures from some sensor that may be detached The Temporal from the computer: Curry–Howard Correspondence R ⊲ ⊤ 1 Categorical ◮ dialog window: Semantics for Restricted LTL UI ⊲ ⊤ α and FRP Hybrid Signals etc. Functional Reactive ◮ ⊲ -types are useful in combination with (co)induction: Dataflow Programming ◮ audio signal that may switch between stereo and mono: νσ . ( R × R ) ⊲ ⊤ R ⊲ ⊤ σ ◮ positions of a pen that might be taken off from the drawing area: νσ . ( R × R ) ⊲ ⊤ 1 ⊲ ⊤ σ etc.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend