From fae99e9e673e3c6856fd4e8f6be613dd1eb2b5f9 Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Mon, 12 May 2014 14:25:32 -0400 Subject: [PATCH] Minor changes to ensure table can be easily replicated --- .../php/analysis/includes/IncludesInfo.rsc | 5 +++++ src/lang/php/experiments/ase2014/ASE2014.rsc | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/lang/php/analysis/includes/IncludesInfo.rsc b/src/lang/php/analysis/includes/IncludesInfo.rsc index cfb27f3..eaac175 100644 --- a/src/lang/php/analysis/includes/IncludesInfo.rsc +++ b/src/lang/php/analysis/includes/IncludesInfo.rsc @@ -64,6 +64,11 @@ data IncludesInfo map[str, Expr] constMap, map[str, map[str, Expr]] classConstMap); + +public bool includesInfoExists(str p, str v) { + return exists(infoLoc + "

--l2c.bin") && exists(infoLoc + "

--crel.bin") && exists(infoLoc + "

--cmap.bin") && exists(infoLoc + "

--ccmap.bin"); +} + public IncludesInfo loadIncludesInfo(str p, str v) { map[loc,set[ConstItemExp]] loc2consts = readBinaryValueFile(#map[loc,set[ConstItemExp]], infoLoc + "

--l2c.bin"); rel[ConstItem,loc,Expr] constRel = readBinaryValueFile(#rel[ConstItem,loc,Expr], infoLoc + "

--crel.bin"); diff --git a/src/lang/php/experiments/ase2014/ASE2014.rsc b/src/lang/php/experiments/ase2014/ASE2014.rsc index 10277fc..649f7b9 100644 --- a/src/lang/php/experiments/ase2014/ASE2014.rsc +++ b/src/lang/php/experiments/ase2014/ASE2014.rsc @@ -96,6 +96,7 @@ public void doQuickResolve() { public void doQuickResolve(Corpus corpus) { for (p <- corpus, v := corpus[p]) { pt = loadBinary(p,v); + if (!includesInfoExists(p,v)) buildIncludesInfo(p,v,getCorpusItem(p,v)); IncludesInfo iinfo = loadIncludesInfo(p, v); rel[loc,loc,loc] res = { }; map[loc,Duration] timings = ( ); @@ -218,7 +219,10 @@ public str createQuickResolveCountsTable() { corpus = getBaseCorpus(); str headerLine() { - return "System & Includes & Dynamic & Unique & Missing & Any & Other & Average \\\\ \\midrule"; + res = "System & \\multicolumn{3}{c}{Includes} & \\phantom{abc} & \\multicolumn{5}{c}{Results} \\\\ + '\\cmidrule{2-4} \\cmidrule{6-10} + ' & Total & Static & Dynamic & & Unique & Missing & Any & Other & Average \\\\ \\midrule"; + return res; } str productLine(str p, str v) { @@ -226,6 +230,7 @@ public str createQuickResolveCountsTable() { total = ( 0 | it + m[h] | h <- m<0> ); pt = loadBinary(p,v); dyn = total - size([ i | /i:include(ip,_) := pt, scalar(sv) := ip, encapsed(_) !:= sv ]); + st = total - dyn; unique = (1 in m) ? m[1] : 0; missing = (0 in m) ? m[0] : 0; files = size(pt<0>); @@ -235,23 +240,21 @@ public str createQuickResolveCountsTable() { denom = ( 0 | it + m[h] | h <- m<0>, h > 1, h < threshold ); avg = (denom == 0) ? 0 : ( ( 0 | it + (m[h] * h) | h <- m<0>, h > 1, h < threshold ) * 1.000 / denom); - return "

& \\numprint{} & \\numprint{} & \\numprint{} & \\numprint{} & \\numprint{} & \\numprint{} & \\nprounddigits{2} \\numprint{} \\npnoround \\\\"; + return "

& \\numprint{} & \\numprint{} & \\numprint{} & & \\numprint{} & \\numprint{} & \\numprint{} & \\numprint{} & \\nprounddigits{2} \\numprint{} \\npnoround \\\\"; } res = "\\npaddmissingzero '\\npfourdigitsep - '\\begin{table} + '\\begin{table*} '\\centering - '\\ra{1.0} - '\\resizebox{\\columnwidth}{!}{% - '\\begin{tabular}{@{}lrrrrrrr@{}} \\toprule + '\\ra{1.2} + '\\begin{tabular}{@{}lrrrcrrrrr@{}} \\toprule ' ),bool(str s1,str s2) { return toUpperCase(s1) ' <}> '\\bottomrule '\\end{tabular} - '} - '\\caption{File-Level Resolution.\\label{table-quick}} - '\\end{table} + '\\caption{Results of running {\\sf FLRES} on the corpus.\\label{table-quick}} + '\\end{table*} '"; return res; }