Visualising Program Behaviour. 2 Program visualisation tools in ECLiPSe  Debugger  Profiler  Coverage  Display matrix  Visualisation  Debugger 

Slides:



Advertisements
Similar presentations
How to use - A Powerful Tool
Advertisements

Profiling Applications in Luis I. Gomez BR Profiler BR Profiler Feature –Components –Profiler types –Profiling an application –Interpreting your.
Simulation executable (simv)
Computer Science 2212a/b - UWO1 Structural Testing Motivation The gcov Tool An example using gcov How does gcov do it gcov subtleties Further structural.
ECE Application Programming
SE-292 High Performance Computing Profiling and Performance R. Govindarajan
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Compile MS Access Pertemuan 18 Matakuliah: F0712 / Lab MS Access Tahun: 2007.
Mx? A programming language for scientific computation. Related Languages: Matlab IDL Maple, Mathcad, Mathematica.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
COMP Computer Basics Yi Hong May 13, 2015.
Chapter 2 Software Tools and Assembly Language Syntax.
Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.
$100 $200 $300 $400 $100 $200 $300 $400 $300 $200 $100 Place value circle model Place value up to tens Place value hundred - thousands Place value –
CCS APPS CODE COVERAGE. CCS APPS Code Coverage Definition: –The amount of code within a program that is exercised Uses: –Important for discovering code.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Case Study: Designing A Telephone Directory Program Ellen Walker CPSC 201 Data Structures Hiram College Includes figures from Objects, Abstraction & Data.
Let VRS Work for You! ELUNA Conference 2008 Presenter: Kelly P. Robinson GIL Service Georgia State University
All rights reserved, property and © CAD Computer GmbH & Co.KG 2009 Cover page.
All rights reserved, property and © CAD Computer GmbH & Co.KG 2009 Cover page.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Chapter 0 Overview. Why you are here? Where will you go? What is this course for?
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Adv. UNIX: Profile/151 Advanced UNIX v Objectives –introduce profiling based on execution times and line counts Special Topics in Comp.
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Compiling a Native C++ Program on the Command Line #define #include.
Debugging TI RTOS TEAM 4 JORGE JIMENEZ JHONY MEDRANO ALBIEN FEZGA.
Teacher/Mentor Institute Using easyC David Dominguez June 2, 2015 Update Version.
Using the humec Tools 20 th March 2006 Robert Pointon.
Oracle Forms Oracle Forms Builder provides various tools, which have powerful Graphical User Interfaces (GUI's) to design such forms. All objects, properties,
Reconfigurable Communication Interface Between FASTER and RTSim Dec0907.
Teaching Digital Logic courses with Altera Technology
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
4,135,652 Place Value Hundred Thousands Ten Thousands Hundreds
Community Information Toolkit
Cover page.
Comparing Numbers.
Is it worth 5 or 50?.
Is it worth 5 or 50?.
Chapter 2 - Introduction to C Programming
4,135,652 Place Value Hundred Thousands Ten Thousands Hundreds
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
System Concept Simulation for Concurrent Engineering
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
Hundred Dollar Questions
Tools.
Lab 1: Getting started ICE0125 Programming Fundamentals II – C/C++
Code Analysis, Repository and Modelling for e-Neuroscience
Tools.
Solving Equations 3x+7 –7 13 –7 =.
Code Analysis, Repository and Modelling for e-Neuroscience
Comparing Numbers.
Chapter 15 Debugging.
Chapter 15 Debugging.
Presentation transcript:

Visualising Program Behaviour

2 Program visualisation tools in ECLiPSe  Debugger  Profiler  Coverage  Display matrix  Visualisation  Debugger  Profiler  Coverage  Display matrix  Visualisation

3 Profiler - sample based code profiling  Any goal can be profiled  Does not require special compilation  0.01s sample interval  Not available on MS Window (currently)  Any goal can be profiled  Does not require special compilation  0.01s sample interval  Not available on MS Window (currently) queen(Data, Out) :- qperm(Data, Out), safe(Out). qperm([], []). qperm([X|Y], [U|V]) :- qdelete(U, X, Y, Z), qperm(Z, V). qdelete(A, A, L, L). qdelete(X, A, [H|T], [A|R]) :- qdelete(X, H, T, R). safe([]). safe([N|L]) :- nodiag(L, N, 1), safe(L). nodiag([], _, _). nodiag([N|L], B, D) :- D =\= N - B, D =\= B - N, D1 is D + 1, nodiag(L, B, D1). queen(Data, Out) :- qperm(Data, Out), safe(Out). qperm([], []). qperm([X|Y], [U|V]) :- qdelete(U, X, Y, Z), qperm(Z, V). qdelete(A, A, L, L). qdelete(X, A, [H|T], [A|R]) :- qdelete(X, H, T, R). safe([]). safe([N|L]) :- nodiag(L, N, 1), safe(L). nodiag([], _, _). nodiag([N|L], B, D) :- D =\= N - B, D =\= B - N, D1 is D + 1, nodiag(L, B, D1).

4 Profiler - the profile predicate  profile(+Goal) :- profile(queen([1,2,3,4,5,6,7,8,9],Out)).  profile(+Goal, +OptionList) :- profile( queen([1,2,3,4,5,6,7,8,9],Out), [simple, keep_file] ).  When the goal runs quickly, use an auxiliary queen_100 :- for(_X,1,100) do queen([1,2,3,4,5,6,7,8,9],_Out). :- profile(queen_100).  profile(+Goal) :- profile(queen([1,2,3,4,5,6,7,8,9],Out)).  profile(+Goal, +OptionList) :- profile( queen([1,2,3,4,5,6,7,8,9],Out), [simple, keep_file] ).  When the goal runs quickly, use an auxiliary queen_100 :- for(_X,1,100) do queen([1,2,3,4,5,6,7,8,9],_Out). :- profile(queen_100).

5 Profiler - sample based code profiling goal succeeded PROFILING STATISTICS Goal: queen_100 Total user time: 3.19s Predicate Module %Time Time %Cum nodiag /3 eclipse 52.2% 1.67s 52.2% qdelete /4 eclipse 27.4% 0.87s 79.6% qperm /2 eclipse 17.0% 0.54s 96.5% safe /1 eclipse 2.8% 0.09s 99.4% queen /2 eclipse 0.6% 0.02s 100.0% Yes (3.33s cpu) goal succeeded PROFILING STATISTICS Goal: queen_100 Total user time: 3.19s Predicate Module %Time Time %Cum nodiag /3 eclipse 52.2% 1.67s 52.2% qdelete /4 eclipse 27.4% 0.87s 79.6% qperm /2 eclipse 17.0% 0.54s 96.5% safe /1 eclipse 2.8% 0.09s 99.4% queen /2 eclipse 0.6% 0.02s 100.0% Yes (3.33s cpu)

6 Coverage - source line coverage library queen(Data, Out) :- 1 qperm(Data, Out), 7686 safe(Out) 1. qperm([], []) qperm([X|Y], [U|V]) : qdelete(U, X, Y, Z), qperm(Z, V) qdelete(A, A, L, L) qdelete(X, A, [H|T], [A|R]) : qdelete(X, H, T, R) safe([]) 1. safe([N|L]) : nodiag(L, N, 1), 1338 safe(L) 9. nodiag([], _5917, _5918) nodiag([N|L], B, D) : D =\= N - B, D =\= B - N, D1 is D + 1, nodiag(L, B, D1)  Requires special compilation  Inserts coverage counters into the code Entry to code blocks Between predicate calls within a block At the end of code blocks  Pretty prints source annotated with counter values

7 Coverage - source line coverage library The ccompile predicate compiles and loads a file adding coverage counters as it does so ccompile(+File) :- ccompile(’foo.ecl’). ccompile(+File, +OptionList) :- ccompile(’foo.ecl’, [exit_counters:off, macro_expansion:off]). The ccompile predicate compiles and loads a file adding coverage counters as it does so ccompile(+File) :- ccompile(’foo.ecl’). ccompile(+File, +OptionList) :- ccompile(’foo.ecl’, [exit_counters:off, macro_expansion:off]).

8 Coverage - source line coverage library All coverage counters are reset by calling  reset_counters/0 The result predicate outputs source code annotated with coverage counter values  result/0  result(+File) :- result(‘foo.ecl’).  result(+File, +OptionList) :- result(‘foo.ecl’, [outdir:coverage, format:html]). All coverage counters are reset by calling  reset_counters/0 The result predicate outputs source code annotated with coverage counter values  result/0  result(+File) :- result(‘foo.ecl’).  result(+File, +OptionList) :- result(‘foo.ecl’, [outdir:coverage, format:html]).

9 Coverage - source line coverage library queen(Data, Out) :- 1 qperm(Data, Out), 7686 safe(Out) 1. qperm([], []) qperm([X|Y], [U|V]) : qdelete(U, X, Y, Z), qperm(Z, V) qdelete(A, A, L, L) qdelete(X, A, [H|T], [A|R]) : qdelete(X, H, T, R) safe([]) 1. safe([N|L]) : nodiag(L, N, 1), 1338 safe(L) 9. nodiag([], _5917, _5918) nodiag([N|L], B, D) : D =\= N - B, D =\= B - N, D1 is D + 1, nodiag(L, B, D1) :-lib(coverage). :-ccompile(“foo.ecl”). :-queen( [1,2,3,4,5,6,7,8,9], Out ). :-result(“foo.ecl”).

10 Visualisation - control flow Visualisation Client Debugger Annotated source code

11 More Details...  See ECLiPSe User Manual Profiling Prolog Execution chapter  See ECLiPSe Library Manual Coverage library  See ECLiPSe Visualisation Tutorial  See ECLiPSe User Manual Profiling Prolog Execution chapter  See ECLiPSe Library Manual Coverage library  See ECLiPSe Visualisation Tutorial

12 SEND + MORE = MONEY :-lib(ic). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], Carries = [C1,C2,C3,C4], Carries :: [0..1], alldifferent(Digits), S #\= 0, M #\= 0, C1 #= M, C2 + S + M #= O + 10*C1, C3 + E + O #= N + 10*C2, C4 + N + R #= E + 10*C3, D + E #= Y + 10*C4, lab(Carries), lab(Digits). :-lib(ic). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], Carries = [C1,C2,C3,C4], Carries :: [0..1], alldifferent(Digits), S #\= 0, M #\= 0, C1 #= M, C2 + S + M #= O + 10*C1, C3 + E + O #= N + 10*C2, C4 + N + R #= E + 10*C3, D + E #= Y + 10*C4, lab(Carries), lab(Digits).

13 SEND + MORE = MONEY (annotated) :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore1(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, Digits), Carries = [C1,C2,C3,C4], Carries :: [0..1], alldifferent(Digits), S #\= 0, M #\= 0, C1 #= M, C2 + S + M #= O + 10*C1, C3 + E + O #= N + 10*C2, C4 + N + R #= E + 10*C3, D + E #= Y + 10*C4, lab(Carries), lab(Digits). :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore1(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, Digits), Carries = [C1,C2,C3,C4], Carries :: [0..1], alldifferent(Digits), S #\= 0, M #\= 0, C1 #= M, C2 + S + M #= O + 10*C1, C3 + E + O #= N + 10*C2, C4 + N + R #= E + 10*C3, D + E #= Y + 10*C4, lab(Carries), lab(Digits).

14 SEND + MORE = MONEY (annotated II) :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore2(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, Digits, array([flexible],numeric_bounds)), Carries = [C1,C2,C3,C4],... lab(Digits), viewable_expand(equation, 1, C1), viewable_expand(equation, 1, C2), viewable_expand(equation, 1, C3), viewable_expand(equation, 1, C4). :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore2(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, Digits, array([flexible],numeric_bounds)), Carries = [C1,C2,C3,C4],... lab(Digits), viewable_expand(equation, 1, C1), viewable_expand(equation, 1, C2), viewable_expand(equation, 1, C3), viewable_expand(equation, 1, C4).

15 SEND + MORE = MONEY (annotated III) :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore3(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, []([](0, S, E, N, D), [](0, M, O, R, E), [](M, O, N, E, Y)), array([flexible,fixed], numeric_bounds)), Carries = [C1,C2,C3,C4],... lab(Carries), lab(Digits), viewable_expand(equation, 1, [C1, C2, C3, C4, 0]). :-lib(ic). :-lib(viewable). lab([]). lab([X|Xs]):- indomain(X), lab(Xs). sendmore3(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, []([](0, S, E, N, D), [](0, M, O, R, E), [](M, O, N, E, Y)), array([flexible,fixed], numeric_bounds)), Carries = [C1,C2,C3,C4],... lab(Carries), lab(Digits), viewable_expand(equation, 1, [C1, C2, C3, C4, 0]).

16 SEND + MORE = MONEY (annotated IV) :-lib(ic). :-lib(viewable).... sendmore4(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, []([](0, S, E, N, D), [](0, M, O, R, E), [](M, O, N, E, Y)), array([flexible,fixed], numeric_bounds), [["send", "more", "money"], ["ten thousands", "thousands", "hundreds","tens", "units"]]), Carries = [C1,C2,C3,C4],... lab(Carries), lab(Digits), viewable_expand(equation, 1, [C1, C2, C3, C4, 0], "carries"). :-lib(ic). :-lib(viewable).... sendmore4(Digits) :- Digits = [S,E,N,D,M,O,R,Y], Digits :: [0..9], viewable_create(equation, []([](0, S, E, N, D), [](0, M, O, R, E), [](M, O, N, E, Y)), array([flexible,fixed], numeric_bounds), [["send", "more", "money"], ["ten thousands", "thousands", "hundreds","tens", "units"]]), Carries = [C1,C2,C3,C4],... lab(Carries), lab(Digits), viewable_expand(equation, 1, [C1, C2, C3, C4, 0], "carries").