1 / 9

Incrementalization and Abstraction Lecture

This lecture explores the concepts of incrementalization and abstraction in software synthesis. Topics covered include object abstraction, set comprehensions, and rule development. Automatic rules creation is discussed as a solution to the challenges of manual rule development.

Télécharger la présentation

Incrementalization and Abstraction Lecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Incrementalization across object abstractionLecture 12 Ras BodikCS294-2 Software Synthesis Spring 2006

  2. Administrativia • Project proposals • were due two days ago • Summaries • continue posting them also to pl.newsdog.info

  3. Example: spec class Protocol signals: set(Signal) threshold: float addSignal(signal): signals.add(signal) findStrongSignals(): return { s in signals | s.getStrength() > threshold } class Signal strength: float setStrength(v): strength = v getStrength(): return strength

  4. class Protocol signals: set(Signal) strongsignals: set(Signal) threshold: float setting threshold … stringsignals = { s | signal.getStrength() > threshold} addSignal(signal): signals.add(signal) if signal.getStrength() > threshold strongsignals.add(signal) findStrongSignals(): return strongsignals class Signal strength: float protocols: set(Protocols) setStrength(v): strength = v foreach p in protocols if p.threashold < strength then p.strongsignals.add(this) else p.strongsignals.remove(this) getStrength(): return strength

  5. class Protocol signals: set(Signal) strongsignals: set(Signal) threshold: float addSignal(signal): signals.add(signal) signal.registerProtocol(this) if signal.getStrength() > threshold strongsignals.add(signal) findStrongSignals(): return strongsignals class Signal strength: float protocols: set(Protocols) registerProtocol(p): protocols.registerProtocol(p) setStrength(v): strength = v foreach p in protocols if p.signals.contains(this) if p.strongsignals.contains(this) if not p.threashold < strength p.strongsignals.remove(this) else if p.threashold < strength p.strongsignals.add(this) getStrength(): return strength

  6. class Protocol signals: set(Signal) strongsignals: set(Signal) threshold: float addSignal(signal): signals.add(signal) signal.registerProtocol(this) if signal.getStrength() > threshold strongsignals.add(signal) findStrongSignals(): return strongsignals updateSignal(signal): if signals.contains(signal) if strongsignals.contains(signal) if not threashold < signal.getStrength() strongsignals.remove(signal) else if threashold < signal.getStrength() strongsignals.add(signal) class Signal strength: float protocols: set(Protocols) registerProtocol(p): protocols.registerProtocol(p) setStrength(v): strength = v foreach p in protocols p.update(this) getStrength(): return strength

  7. Rules for set comprehension inv r = { v in s | e } O(|s| x cost(e)) if vars(e)  {v, this} at s = new set() O(1) do r = new set() O(1) at s.remove(x) O(1) do if e[vx] r.remove(x) O(cost(e)) at s.add(x) O(1) do if e[vx] r.add(x) O(cost(e)) at s.add(x) if type(s) = set(C), C != Cq, and there is an update to a field in C do x.takeCq(this) O(1)

  8. Rules for set comprehension (2) inv r = { v in s | e } O(|s| x cost(e)) if vars(e)  {v, this} at update if s is a field of Cq, type(s) = set(Cu), != Cq {v,f: v in s}  readq and writeq = {this.f} de in Cu cqs: set(Cq) takeCq(cq): cqs.add(cq) in Cq updateCu(x): if s.contains(x) if r.contains(x) if not e[vx] r.remove(x) else if e[vx] r.add(x)

  9. Where do rules come from? • For complex computations • manual rule development is difficult • at least as much as manual incrementalization • Issues • described system does not verify correctness of rules • Solution (outside scope of paper) • automatic rules creation • computation  rules (applicable to similar comp’s) • works for a class of programs • done for set comprehensions

More Related