A Linear Logic Semantics for CHR - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

A Linear Logic Semantics for CHR

Description:

'For one euro, we can buy a cup of coffee with unlimited refills' used to represent. stable facts. unlimited resources. 11/9/09. hariolf.betz_at_informatik.uni-ulm.de. 14 ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 21
Provided by: pappan9
Category:

less

Transcript and Presenter's Notes

Title: A Linear Logic Semantics for CHR


1
A Linear Logic Semantics for CHR
  • Hariolf Betz, Thom Frühwirth
  • University of Ulm

2
Overview
  • CHR Roundup
  • Constraints and Rules
  • What are the limits of the classical declarative
    semantics?
  • Introduction to Linear Logic
  • Why choose linear logic?
  • A Linear Logic Semantics for CHR
  • Soundness and Completeness

3
CHR overview
  • constraint handling rules
  • developed in the 1990s
  • originally intended for the implementation of
    constraint solvers
  • nowadays increasingly used as a general-purpose
    concurrent programming language

4
CHR Constraints
  • We distinguish two disjoint sets of constraints
  • CHR constraints
  • defined by CHR program (P)
  • built-in constraints
  • predefined/hard-wired
  • defined by constraint theory (CT)

5
CHR Rules
E ltgt C G
6
Classical Declarative Semantics
E ltgt G
E ltgt G1 ? G2
E ltgt C G1 ? G2
E ltgt C G
7
Example Coin Throw Simulator
  • throw(Coin) ltgt Coinhead.
  • throw(Coin) ltgt Cointail.
  • Requires a fair selection strategy

8
Coin Simulator Declarative Semantics
  • throw(Coin) ltgt Coinhead.
  • throw(Coin) ltgt Cointail.
  • Classical logic cannot represent change
  • Classical logic cannot represent multiplicities

9
Linear Logic
  • Introduced by Jean-Yves Girard in 1987
  • Resource-oriented logic
  • one can be prohibited from re-using the same
    hypotheses several times
  • Logic of actions
  • Logic of resources

10
Linear Implication
  • lollipop
  • consuming ... yields ...
  • For one euro, we can buy a pizza.
  • Classical vs. Linear Implication

11
With Conjunction
  • with
  • choose from ... and ...
  • For one euro, we can buy a pizza or a cake

12
Times Conjunction
  • times
  • both ... and ...
  • For one euro, we can buy a pizza and an ice
    cream
  • A pizza is two euros

13
! Bang Modality
  • bang
  • of course ...
  • For one euro, we can buy a cup of coffee with
    unlimited refills
  • used to represent
  • stable facts
  • unlimited resources

14
Why use linear logic for CHR?
  • Similarity between CHR operational semantics and
    linear logic calculus
  • Change and dynamics
  • Multiplicities
  • Seamless embedding of classical logic into linear
    logic

15
Linear Logic Declarative Semantics
  • Recursively defined function
  • E ltgt C G
  • Programs semantics is ?-conjunction of rules
    logical semantics

16
Back to Coin Throwing Problem
  • throw(Coin) ltgt Coinhead.
  • throw(Coin) ltgt Cointail.

17
Soundness and Completeness
  • Soundness Let P be a CHR program and S0 be an
    initial state. If S0 has a derivation with a
    final state SnL, then

18
Soundness and completeness
  • Completeness If S0 and Sn are states such that
  • then S0 has a derivation with a state S?
    such that

19
Conclusion
  • The classical declarative semantics of CHR aims
    at constraint solvers
  • When CHR is used as a general-purpose concurrent
    programming language some limitations arise with
    the classical declarative semantics
  • Representation of redundant resources
  • Representation of dynamics and change
  • Misleading semantics
  • The linear logic represents more aspects of the
    operational semantics

20
Future work
  • Linear-logic based program analysis
  • Integration of linear and classical semantics
  • Linear-logic based constraint systems
  • Find a restaurant in Sitges where the following
    holds
Write a Comment
User Comments (0)
About PowerShow.com