Presentation is loading. Please wait.

Presentation is loading. Please wait.

Smooth Interpretation Swarat Chaudhuri and Armando Solar-Lezama.

Similar presentations


Presentation on theme: "Smooth Interpretation Swarat Chaudhuri and Armando Solar-Lezama."— Presentation transcript:

1 Smooth Interpretation Swarat Chaudhuri and Armando Solar-Lezama

2 The Parameter Synthesis Problem tOff := ??; tOn := ??; h := ?? repeat( Á t ) { temp := readTemp(); if (isOn() && temp > tOff) switchHeaterOff(); elseif ( !isOn() && temp < tOn) switchHeaterOn(h); } Cooling: Warming:

3 The Parameter Synthesis Problem temp time 75 · Can we find values of (tOff, tOn, h) to minimize Err?

4 Minimization by numerical search What about gradient descent?

5 Minimization by numerical Search Discontinuities affect even the best methods

6 Smoothing to the Rescue

7 Smoothing in Signal Processing Gaussian Smoothing –Given a function –produces a smooth function What if we could do this for programs?

8 Smoothed semantics of programs Smoothed program: Probabilistic semantics: 1.Make input a random variable with Normal distribution 2.Execute the program on this random variable 3.Return the expected value of the program output P(x) = if x > 2 then 1 else 0; Tuning knob: Standard deviation 

9 Smooth Interpretation How do we execute a program on a distribution of inputs? –Not by sampling we would miss essential features of the search landscape. –Symbolic execution: propagate symbolic representations of distributions. Program Approximation of expected output Input x

10 Smooth Interpretation: Assignment x = x - y;

11 Smooth Interpretation: Branch if( x > 0 ) false true

12 Smooth Interpretation: Join if( x > 0 ) false true

13 Smooth Interpretation: Join if( x > 0 ) false true

14 Does this work?

15 Back to the thermostat original =1 =13 =1 0

16 Parallel Parking Result of Search With Smoothing Result of Search Without Smoothing

17 Conclusions Numerical methods can benefit program analysis They can not be applied blindly –numerical methods work better in continuous spaces –continuous approximations essential for good results –insights about program semantics are crucial

18 Break On Break Off PID Controller with Break Wheel Motor Break Break On Break Off No Smoothing Wheel Position Break Goal Wheel Position Smoothing

19 MAKING THE WORLD A BETTER PLACE OF PROGRAMS FOR NUMERICAL METHODS void park(){ driveBack( ?? /*distance*/); driveTurningIn( ?? /*dist*/, ?? /*turn rate */); driveTurningOut(??/*dist*/, ??/*turn rate*/); }

20 Parameter synthesis: architecture Control program + Model of physical environment Gradient descent solver Program Error Smooth interpreter Built on top of GNU Scientific Library Suitable parameter values Extent of smoothing tuned dynamically Reference trajectory (specification)

21 Successful parameter synthesis in several control applications: –Automated gearbox (challenging!) –PID controller (even more challenging!) Numerical methods fail miserably without smoothing. Approximations needed to achieve scalability. Hypothesis: Numerical methods are of use in program analysis, but preprocessing (e.g., smoothing) is needed. Results

22 Approximation 1: Assignment x = x - y; x = -y;

23 Approximation 2: Branch if( x > 0 ) false true

24 Approximation 2: Branch if( x > 0 ) false true

25 Approximation 3: Join

26 Gearbox repeat( Á t){ v = carModel(v, gear, t); if(v > ?? && gear == 1){ gear = 0; tgear = 2; timer=0.8; }else if(v > ?? && gear == 2){ gear = 0; tgear = 3; timer=0.8; }else if(v > ?? && gear == 3){ gear = 0; tgear = 4; timer=0.8; }else if(v > ?? && gear == 4){ gear = 0; tgear = 5; timer=0.8; }else if(timer < 0 && gear == 0){ gear = tgear; } t += dt; timer -= dt; } Efficiency Curves g1 g2 g3 g4 g5 speed efficiency

27 Gradient Descent

28

29 Error Function for Gearbox

30 Wheel PID controller with Breaks Motor Break torque = ??*ang + ??*vel + ??*integral if( ?? * vel > ?? && ?? * ang > ??) break(); Goal := Angle(t x ) == target

31 Result without Smoothing

32 Result with Smoothing Goal

33 Error Functions for Controller


Download ppt "Smooth Interpretation Swarat Chaudhuri and Armando Solar-Lezama."

Similar presentations


Ads by Google