1
Florian Frohn Automatic Complexity Analysis of Programs Supervisor: Jürgen Giesl input size runtime Automated Induction Technique automatically “guess” conjecture plus(s n (0), s m (0)) s n +m (0) prove it via induction infer lower bound from proof y Ω(n ) RTA ’15 LoAT adapt ranking func. for lower bounds y metering func. x is metering func. for plus compute resulting variable values via recurrence solving y = y + x after x iterations accelerate loops plus(x , y ) plus(0, y + x ) | x > 0 y Ω(x ) IJCAR ’16 Loop Detection syntactic criterion for linear & exponential lower bounds plus(s(x ), y ) plus(x , s(y )) is a decreasing loop y Ω(x ) JAR ’17 Strategy Switching goal: analyze complexity w.r.t. unre- stricted evaluation strategy prove that eager evaluation is worst apply techniques for eager evaluation eager evaluation is worst for plus y O (x ) LPAR ’17 Java ITS execute program symbolically y symbolic evaluation graph translate graph to ITS apply techniques for ITSs translates J to I y O (x ) iFM ’17 Recursive ITS ITS analyze non-recursive sub-ITSs independently approximate runtime and size of result replace calls to analyzed program parts with obtained bounds currently restricted to N FroCoS ’17 TRS Recursive ITS goal: analyze complexity w.r.t. eager evaluation translate TRS to recursive ITS (RITS) over N apply techniques for recursive ITSs translates R to I y O (x ) FroCoS ’17 Term Rewrite System (TRS) R plus(s(x ), y ) plus(x , s(y )) plus(0, y ) y Integer Transition System (ITS) I plus(x , y ) plus(x - 1, y + 1) | x > 0 plus(x , y ) y | x =0 Java Program J int plus(int x, int y) { while (x > 0) { x --; y++; } return y; } Key worst case upper bound worst case runtime worst case lower bound Applications DARPA STAC program [4] AProVE [1] and LoAT [3] are crucial parts of the CAGE toolchain [2] used to find or prove the absence of DoS vulnerabilities in Java programs [1] AProVE – http://aprove.informatik.rwth-aachen.de [2] CAGE – http://www.draper.com/news/draper-s-cage-could-spot-code-vulnerable-denial-service-attacks [3] LoAT – https://github.com/aprove-developers/LoAT [4] Space/Time Analysis for Cybersecurity (STAC) – https://www.darpa.mil/program/space-time-analysis-for-cybersecurity

This Poster - GitHub Pages · TRS →Recursive ITS goal: analyze complexity w.r.t. eager evaluation translate TRS to recursive ITS (RITS) over N apply techniques for recursive ITSs

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: This Poster - GitHub Pages · TRS →Recursive ITS goal: analyze complexity w.r.t. eager evaluation translate TRS to recursive ITS (RITS) over N apply techniques for recursive ITSs

Florian Frohn

Automatic Complexity Analysis of ProgramsSupervisor: Jürgen Giesl

input size

runt

ime

Automated Induction Technique

automatically “guess” conjectureplus(sn(0), sm(0))→ sn+m(0)

prove it via inductioninfer lower bound from proofyΩ(n) RTA ’15

LoAT

adapt ranking func. for lowerbounds y metering func.

x is metering func. for pluscompute resulting variablevalues via recurrence solving

y ′ = y + x after x iterationsaccelerate loops

plus(x , y)→ plus(0, y +x) | x > 0yΩ(x) IJCAR ’16

Loop Detection

syntactic criterion for linear &exponential lower bounds

plus(s(x), y) → plus(x , s(y)) isa decreasing loop

yΩ(x) JAR ’17

Strategy Switching

goal: analyze complexity w.r.t. unre-stricted evaluation strategy

prove that eager evaluation is worstapply techniques for eager evaluation

eager evaluation is worst for plusyO(x) LPAR ’17

Java → ITS

execute program symbolicallyysymbolic evaluation graphtranslate graph to ITSapply techniques for ITSs

translates J to IyO(x) iFM ’17

Recursive ITS → ITS

analyze non-recursive sub-ITSs independentlyapproximate runtime and size of resultreplace calls to analyzed program parts withobtained boundscurrently restricted to N FroCoS ’17

TRS → Recursive ITS

goal: analyze complexity w.r.t. eager evaluationtranslate TRS to recursive ITS (RITS) over Napply techniques for recursive ITSs

translates R to IyO(x) FroCoS ’17

Term Rewrite System (TRS) Rplus(s(x), y)→ plus(x , s(y))

plus(0, y)→ y

Integer Transition System (ITS) Iplus(x , y)→ plus(x − 1, y + 1) | x > 0plus(x , y)→ y | x = 0

Java Program Ji n t p lus ( i n t x , i n t y )

wh i le ( x > 0) x−−; y ++;

r e t u r n y ;

Key

worst case upper boundworst case runtimeworst case lower bound

Applications

DARPA STAC program [4]AProVE [1] and LoAT [3] are crucial parts of the CAGE toolchain [2]used to find or prove the absence of DoS vulnerabilities in Java programs

[1] AProVE – http://aprove.informatik.rwth-aachen.de[2] CAGE – http://www.draper.com/news/draper-s-cage-could-spot-code-vulnerable-denial-service-attacks[3] LoAT – https://github.com/aprove-developers/LoAT[4] Space/Time Analysis for Cybersecurity (STAC) – https://www.darpa.mil/program/space-time-analysis-for-cybersecurity