Skip to content

Commit fae99e9

Browse files
committed
Minor changes to ensure table can be easily replicated
1 parent 327f335 commit fae99e9

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

src/lang/php/analysis/includes/IncludesInfo.rsc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ data IncludesInfo
6464
map[str, Expr] constMap,
6565
map[str, map[str, Expr]] classConstMap);
6666

67+
68+
public bool includesInfoExists(str p, str v) {
69+
return exists(infoLoc + "<p>-<v>-l2c.bin") && exists(infoLoc + "<p>-<v>-crel.bin") && exists(infoLoc + "<p>-<v>-cmap.bin") && exists(infoLoc + "<p>-<v>-ccmap.bin");
70+
}
71+
6772
public IncludesInfo loadIncludesInfo(str p, str v) {
6873
map[loc,set[ConstItemExp]] loc2consts = readBinaryValueFile(#map[loc,set[ConstItemExp]], infoLoc + "<p>-<v>-l2c.bin");
6974
rel[ConstItem,loc,Expr] constRel = readBinaryValueFile(#rel[ConstItem,loc,Expr], infoLoc + "<p>-<v>-crel.bin");

src/lang/php/experiments/ase2014/ASE2014.rsc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void doQuickResolve() {
9696
public void doQuickResolve(Corpus corpus) {
9797
for (p <- corpus, v := corpus[p]) {
9898
pt = loadBinary(p,v);
99+
if (!includesInfoExists(p,v)) buildIncludesInfo(p,v,getCorpusItem(p,v));
99100
IncludesInfo iinfo = loadIncludesInfo(p, v);
100101
rel[loc,loc,loc] res = { };
101102
map[loc,Duration] timings = ( );
@@ -218,14 +219,18 @@ public str createQuickResolveCountsTable() {
218219
corpus = getBaseCorpus();
219220
220221
str headerLine() {
221-
return "System & Includes & Dynamic & Unique & Missing & Any & Other & Average \\\\ \\midrule";
222+
res = "System & \\multicolumn{3}{c}{Includes} & \\phantom{abc} & \\multicolumn{5}{c}{Results} \\\\
223+
'\\cmidrule{2-4} \\cmidrule{6-10}
224+
' & Total & Static & Dynamic & & Unique & Missing & Any & Other & Average \\\\ \\midrule";
225+
return res;
222226
}
223227
224228
str productLine(str p, str v) {
225229
map[int hits, int includes] m = counts[<p,v>];
226230
total = ( 0 | it + m[h] | h <- m<0> );
227231
pt = loadBinary(p,v);
228232
dyn = total - size([ i | /i:include(ip,_) := pt, scalar(sv) := ip, encapsed(_) !:= sv ]);
233+
st = total - dyn;
229234
unique = (1 in m) ? m[1] : 0;
230235
missing = (0 in m) ? m[0] : 0;
231236
files = size(pt<0>);
@@ -235,23 +240,21 @@ public str createQuickResolveCountsTable() {
235240
denom = ( 0 | it + m[h] | h <- m<0>, h > 1, h < threshold );
236241
avg = (denom == 0) ? 0 : ( ( 0 | it + (m[h] * h) | h <- m<0>, h > 1, h < threshold ) * 1.000 / denom);
237242
238-
return "<p> & \\numprint{<total>} & \\numprint{<dyn>} & \\numprint{<unique>} & \\numprint{<missing>} & \\numprint{<anyinc>} & \\numprint{<other>} & \\nprounddigits{2} \\numprint{<avg>} \\npnoround \\\\";
243+
return "<p> & \\numprint{<total>} & \\numprint{<st>} & \\numprint{<dyn>} & & \\numprint{<unique>} & \\numprint{<missing>} & \\numprint{<anyinc>} & \\numprint{<other>} & \\nprounddigits{2} \\numprint{<avg>} \\npnoround \\\\";
239244
}
240245
241246
res = "\\npaddmissingzero
242247
'\\npfourdigitsep
243-
'\\begin{table}
248+
'\\begin{table*}
244249
'\\centering
245-
'\\ra{1.0}
246-
'\\resizebox{\\columnwidth}{!}{%
247-
'\\begin{tabular}{@{}lrrrrrrr@{}} \\toprule
250+
'\\ra{1.2}
251+
'\\begin{tabular}{@{}lrrrcrrrrr@{}} \\toprule
248252
'<headerLine()> <for (p <- sort(toList(corpus<0>),bool(str s1,str s2) { return toUpperCase(s1)<toUpperCase(s2); })) {>
249253
' <productLine(p,corpus[p])> <}>
250254
'\\bottomrule
251255
'\\end{tabular}
252-
'}
253-
'\\caption{File-Level Resolution.\\label{table-quick}}
254-
'\\end{table}
256+
'\\caption{Results of running {\\sf FLRES} on the corpus.\\label{table-quick}}
257+
'\\end{table*}
255258
'";
256259
return res;
257260
}

0 commit comments

Comments
 (0)