Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AGORA invariants #497

Open
wants to merge 144 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
1da1698
Add Beet invariants and modifications in computeConfidence functions
JuanCarlosAlonsoValenzuela Jul 4, 2023
d44d50d
Remove double quotes from Texinfo
JuanCarlosAlonsoValenzuela Jul 4, 2023
b13b587
Remove comparison using reference equality instead of value equality
JuanCarlosAlonsoValenzuela Jul 4, 2023
05306ea
Change EOL chars again
JuanCarlosAlonsoValenzuela Jul 4, 2023
ff8c123
Run make reformat
JuanCarlosAlonsoValenzuela Jul 4, 2023
39f5376
Fix nullness typechecking warnings
mernst Jul 10, 2023
8381479
Remove boilerplate comments
mernst Jul 12, 2023
2f71044
Merge ../daikon-fork-mernst-branch-no-we-are-serializable
mernst Jul 12, 2023
4361507
Remove boilerplate comments
mernst Jul 12, 2023
753b103
Don't require Javadoc
mernst Jul 12, 2023
3057b65
Merge ../daikon-fork-mernst-branch-no-we-are-serializable
mernst Jul 12, 2023
a166354
Remove import wildcards in Daikon.java
JuanCarlosAlonsoValenzuela Jul 13, 2023
94c8460
Convert string patterns into private static variables
JuanCarlosAlonsoValenzuela Jul 13, 2023
335cdad
Remove changes in computeConfidence
JuanCarlosAlonsoValenzuela Jul 13, 2023
37d1a6b
Fix test typecheck
JuanCarlosAlonsoValenzuela Jul 14, 2023
437fb28
Remove unrequired import
JuanCarlosAlonsoValenzuela Jul 14, 2023
47d646b
Compute confidence referencing Invariant class
JuanCarlosAlonsoValenzuela Jul 14, 2023
e1cff75
Fix Signedness Checker warnings
mernst Jul 14, 2023
4403d92
Merge ../daikon-branch-master into no-we-are-serializable
mernst Jul 14, 2023
e84472b
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-no-w…
mernst Jul 14, 2023
3a17680
Reinstate cast
mernst Jul 14, 2023
3d3270d
Update Checker Framework
mernst Jul 14, 2023
21a408c
Typecheck with both bundled CF and latest CF
mernst Jul 14, 2023
33f2af5
Typecheck with both bundled CF and latest CF
mernst Jul 14, 2023
c9a9655
Use script instead of direct command
mernst Jul 14, 2023
5034620
Reinstate cast
mernst Jul 14, 2023
a1e78ea
Remove JAVACHECK_EXTRA_ARGS
mernst Jul 14, 2023
7fac2ea
Update checker.jar
mernst Jul 14, 2023
c35a35f
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-no-w…
mernst Jul 15, 2023
6365fdb
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-remo…
mernst Jul 15, 2023
af3b661
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-type…
mernst Jul 15, 2023
53e7491
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-no-w…
mernst Jul 15, 2023
055b763
Merge /home/mernst/research/invariants/daikon-branch-master into type…
mernst Jul 16, 2023
e38ee22
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-type…
mernst Jul 16, 2023
95ecbe5
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-no-w…
mernst Jul 16, 2023
b4fa11b
Formatting
mernst Jul 16, 2023
ba24338
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Jul 16, 2023
20c8864
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Jul 16, 2023
ddc7443
Undo a change
mernst Jul 16, 2023
68aa5eb
Merge branch 'master' into master
mernst Jul 17, 2023
a70c0bc
Merge ../daikon-fork-JuanCarlosAlonsoValenzuela into agora-javadoc
mernst Jul 17, 2023
2900c7d
Add Javadoc for some Agora invariants
mernst Jul 17, 2023
0394acb
Code review suggestions
mernst Jul 17, 2023
a7d28c3
Merge pull request #2 from mernst/agora-javadoc
JuanCarlosAlonsoValenzuela Jul 22, 2023
edd3609
Merge branch 'pr/1'
JuanCarlosAlonsoValenzuela Jul 22, 2023
0afc34b
Add missing imports
JuanCarlosAlonsoValenzuela Jul 22, 2023
1ca93f6
Remove unused variables
JuanCarlosAlonsoValenzuela Jul 23, 2023
1069e37
Add missing documentation and convert regexes to public variables
JuanCarlosAlonsoValenzuela Jul 23, 2023
f5b6f56
Merge branch 'master' into master
JuanCarlosAlonsoValenzuela Jul 23, 2023
18be64c
Fix Javadoc in `IsEmail.java`
mernst Jul 23, 2023
387f1f4
Add missing documentation
JuanCarlosAlonsoValenzuela Jul 23, 2023
41cf7f1
Improve diagnostics from test-misc.sh
mernst Jul 24, 2023
ce4a6bc
Add missing @return to Javadoc
JuanCarlosAlonsoValenzuela Jul 24, 2023
adedd6b
make reformat
JuanCarlosAlonsoValenzuela Jul 24, 2023
69ce4ea
Merge ../daikon-fork-mernst-branch-ci-explanation
mernst Jul 24, 2023
c9f9c37
Merge branch 'master' of github.com:JuanCarlosAlonsoValenzuela/daikon
mernst Jul 24, 2023
746e1d5
Merge branch 'master' into master
mernst Jul 24, 2023
316964b
Changelog
mernst Aug 19, 2023
1fd2996
Code review changes
mernst Aug 19, 2023
b2dc6c2
Agora tests
mernst Aug 19, 2023
96dce5d
Merge ../daikon-fork-mernst-branch-empty-sequence
mernst Aug 19, 2023
5afd592
Enable Agora invariants
mernst Aug 19, 2023
c382469
More Agora tests
mernst Aug 19, 2023
b40c9ea
Undo a change
mernst Aug 21, 2023
7805e66
Fix crashes caused by arrays of strings containing null elements
JuanCarlosAlonsoValenzuela Sep 1, 2023
d764c14
make reformat
JuanCarlosAlonsoValenzuela Sep 1, 2023
a389cc8
Add new suppressor and fix FP possibly-null reference
JuanCarlosAlonsoValenzuela Sep 6, 2023
adee0a1
Replace suppressor with isObviousDynamically
JuanCarlosAlonsoValenzuela Sep 6, 2023
b3f138d
Add get_ni_suppressions and isObviousDynamically to SequenceFixedLeng…
JuanCarlosAlonsoValenzuela Sep 6, 2023
c681fa9
Merge ../daikon-branch-master
mernst Sep 19, 2023
6665dd8
Style
mernst Sep 27, 2023
10df849
Merge ../daikon-branch-master
mernst Sep 27, 2023
2bfd849
Merge ../daikon-branch-master
mernst Sep 29, 2023
f8c3fd3
Fix .jpp errors
mernst Sep 29, 2023
a901d57
Remove trailing whitespace
mernst Sep 29, 2023
16567b6
Reinstate trailing blank lines
mernst Sep 29, 2023
a1a6114
Ignore more files
mernst Sep 30, 2023
2fb8ec4
Remove blank lines
mernst Sep 30, 2023
526ca78
Add blank lines back
mernst Sep 30, 2023
ebcd346
Merge ../daikon-fork-mernst-branch-remove-trailing-whitespace
mernst Sep 30, 2023
04dbc6a
Update test goals
mernst Sep 30, 2023
e55a13f
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Sep 30, 2023
00091b3
Add blank lines
mernst Sep 30, 2023
1bc2a6e
Add blank lines back
mernst Sep 30, 2023
ac643b0
Show failure
mernst Sep 30, 2023
1b0710a
Merge /home/mernst/research/invariants/daikon-fork-mernst-branch-remo…
mernst Sep 30, 2023
1ebf874
Add length invariant output
mernst Sep 30, 2023
6878e69
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 1, 2023
d883e6f
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 1, 2023
5d48f25
Update goals
mernst Oct 1, 2023
a663b39
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 2, 2023
393e5b8
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 2, 2023
0195077
Update Agora test goals
mernst Oct 4, 2023
2d9a658
Checkpoint
mernst Oct 5, 2023
57e77d5
Fix typo
mernst Oct 5, 2023
13ad30d
Add comment
mernst Oct 5, 2023
6321f65
Check that `merge()` is defined
mernst Oct 5, 2023
4a1c8e2
Merge ../daikon-fork-mernst-branch-check-merge-overridden into agora-…
mernst Oct 5, 2023
87c129b
Better test
mernst Oct 5, 2023
b7a5e0a
Merge ../daikon-fork-mernst-branch-check-merge-overridden into agora-…
mernst Oct 5, 2023
cef2160
Fix typo
mernst Oct 5, 2023
6cbffae
Fix counting of number of samples
mernst Oct 6, 2023
95aeb0e
Merge ../daikon-fork-mernst-branch-commonsequence-elts into agora-pas…
mernst Oct 6, 2023
68273e1
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 6, 2023
b2861cf
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 6, 2023
7b62cd9
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 7, 2023
ede8a57
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 7, 2023
acd3d02
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 7, 2023
f99c8ad
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 7, 2023
b5c9f50
Undo undesirable whitespace changes
mernst Oct 7, 2023
d6c0410
Improve diagnostics
mernst Oct 7, 2023
065c573
Improve diagnostics
mernst Oct 7, 2023
f7b55c2
Rename variable
mernst Oct 7, 2023
4627fdd
Merge ../daikon-fork-mernst-branch-non-agora-changes
mernst Oct 7, 2023
5bc8260
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 7, 2023
b1f4017
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 7, 2023
1c9f2e6
Add clone and merge methods to AGORA invariants
JuanCarlosAlonsoValenzuela Oct 11, 2023
9db1417
Remove redundant parentheses
JuanCarlosAlonsoValenzuela Oct 11, 2023
f6b37e0
Merge /home/mernst/research/invariants/daikon-branch-master
mernst Oct 11, 2023
63b47ca
Merge /home/mernst/research/invariants/daikon-fork-JuanCarlosAlonsoVa…
mernst Oct 11, 2023
6090617
Use variable
mernst Oct 11, 2023
8c0dc2a
Update tests due to formatting of invariant
mernst Oct 11, 2023
04aaa10
Suppress nullness warning
mernst Oct 11, 2023
59cbbc0
Update goals
mernst Oct 11, 2023
1bc8703
Update goals
mernst Oct 12, 2023
d053314
`.j8` files are not used
mernst Oct 12, 2023
ecc4602
Update goal
mernst Oct 12, 2023
549cff4
Add missing documentation
JuanCarlosAlonsoValenzuela Oct 12, 2023
28a2f4a
Merge pull request #3 from mernst/agora-passing-tests
JuanCarlosAlonsoValenzuela Oct 13, 2023
ebb62c5
Merge ../daikon-branch-master
mernst Jul 4, 2024
0a6378d
Merge ../daikon-branch-master
mernst Jul 7, 2024
39c488d
The empty string is not numeric
mernst Jul 8, 2024
252d2e1
Merge ../daikon-branch-master
mernst Jul 19, 2024
db4f4e0
Merge ../daikon-branch-master
mernst Jul 22, 2024
88a7bf5
Merge ../daikon-branch-master
mernst Jul 23, 2024
681643a
Merge ../daikon-branch-master
mernst Aug 3, 2024
288792e
Merge ../daikon-branch-master
mernst Aug 6, 2024
b64b681
Merge ../daikon-branch-master
mernst Aug 20, 2024
08cccc9
Merge ../daikon-branch-master
mernst Aug 23, 2024
d20ddc8
Merge ../daikon-branch-master
mernst Sep 2, 2024
62852a2
Merge ../daikon-branch-master
mernst Sep 23, 2024
92ad307
Merge ../daikon-branch-master
mernst Nov 14, 2024
c553282
Merge ../daikon-branch-master
mernst Nov 26, 2024
02a40a1
Merge ../daikon-branch-master
mernst Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,35 @@ Further documentation can be found in:
It is also available at http://plse.cs.washington.edu/daikon/download/api/ .


Version 5.9.0 (??)
=============================

Daikon supports the following new invariants, over strings and sequences of
strings; all of them are enabled by default:
* IsUrl
* FixedLengthString
* IsNumeric
* IsEmail
* IsDateYYYYMMDD
* IsDateDDMMYYYY
* IsDateMMDDYYYY
* IsTimeOfDay
* IsTimeOfDayWithSeconds
* IsTimeOfDayAMPM
* IsTimestampYYYYMMHHThhmmssmm
* SequenceFixedLengthString
* SequenceStringElementsAreUrl
* SequenceStringElementsAreNumeric
* SequenceStringElementsAreEmail
* SequenceStringElementsAreDateYYYYMMDD
* SequenceStringElementsAreDateDDMMYYYY
* SequenceStringElementsAreDateMMDDYYYY
* SequenceStringElementsAreTimeOfDay
* SequenceStringElementsAreTimeOfDayWithSeconds
* SequenceStringElementsAreTimeOfDayAMPM
* SequenceStringElementsAreTimestampYYYYMMHHThhmmssmm


Version 5.8.20 (May 14, 2024)
=============================

Expand Down
59 changes: 57 additions & 2 deletions java/daikon/Daikon.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,33 @@
import daikon.inv.unary.sequence.SeqIndexIntLessThan;
import daikon.inv.unary.sequence.SeqIndexIntNonEqual;
import daikon.inv.unary.string.CompleteOneOfString;
import daikon.inv.unary.string.FixedLengthString;
import daikon.inv.unary.string.IsEmail;
import daikon.inv.unary.string.IsNumeric;
import daikon.inv.unary.string.IsUrl;
import daikon.inv.unary.string.OneOfString;
import daikon.inv.unary.string.PrintableString;
import daikon.inv.unary.string.dates.IsDateDDMMYYYY;
import daikon.inv.unary.string.dates.IsDateMMDDYYYY;
import daikon.inv.unary.string.dates.IsDateYYYYMMDD;
import daikon.inv.unary.string.dates.IsTimeOfDay;
import daikon.inv.unary.string.dates.IsTimeOfDayAMPM;
import daikon.inv.unary.string.dates.IsTimeOfDayWithSeconds;
import daikon.inv.unary.string.dates.IsTimestampYYYYMMHHThhmmssmm;
import daikon.inv.unary.stringsequence.CommonStringSequence;
import daikon.inv.unary.stringsequence.EltOneOfString;
import daikon.inv.unary.stringsequence.OneOfStringSequence;
import daikon.inv.unary.stringsequence.SequenceFixedLengthString;
import daikon.inv.unary.stringsequence.SequenceStringElementsAreEmail;
import daikon.inv.unary.stringsequence.SequenceStringElementsAreNumeric;
import daikon.inv.unary.stringsequence.SequenceStringElementsAreUrl;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreDateDDMMYYYY;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreDateMMDDYYYY;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreDateYYYYMMDD;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreTimeOfDay;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreTimeOfDayAMPM;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreTimeOfDayWithSeconds;
import daikon.inv.unary.stringsequence.dates.SequenceStringElementsAreTimestampYYYYMMHHThhmmssmm;
import daikon.simplify.LemmaStack;
import daikon.split.ContextSplitterFactory;
import daikon.split.PptSplitter;
Expand Down Expand Up @@ -1541,6 +1563,19 @@ public static void setup_proto_invs() {
proto_invs.add(CompleteOneOfString.get_proto());
proto_invs.add(CompleteOneOfScalar.get_proto());

// String formats
proto_invs.add(IsUrl.get_proto());
proto_invs.add(FixedLengthString.get_proto());
proto_invs.add(IsNumeric.get_proto());
proto_invs.add(IsEmail.get_proto());
proto_invs.add(IsDateYYYYMMDD.get_proto());
proto_invs.add(IsDateDDMMYYYY.get_proto());
proto_invs.add(IsDateMMDDYYYY.get_proto());
proto_invs.add(IsTimeOfDay.get_proto());
proto_invs.add(IsTimeOfDayWithSeconds.get_proto());
proto_invs.add(IsTimeOfDayAMPM.get_proto());
proto_invs.add(IsTimestampYYYYMMHHThhmmssmm.get_proto());

// Positive (x > 0) (Postive.java). Positive is a sample invariant
// that is only included as an example.
// proto_invs.add (Postive.get_proto());
Expand Down Expand Up @@ -1606,6 +1641,19 @@ public static void setup_proto_invs() {

// CommonStringSequence (CommonStringSubsequence.java)
proto_invs.add(CommonStringSequence.get_proto());

// String formats
proto_invs.add(SequenceFixedLengthString.get_proto());
proto_invs.add(SequenceStringElementsAreUrl.get_proto());
proto_invs.add(SequenceStringElementsAreNumeric.get_proto());
proto_invs.add(SequenceStringElementsAreEmail.get_proto());
proto_invs.add(SequenceStringElementsAreDateYYYYMMDD.get_proto());
proto_invs.add(SequenceStringElementsAreDateDDMMYYYY.get_proto());
proto_invs.add(SequenceStringElementsAreDateMMDDYYYY.get_proto());
proto_invs.add(SequenceStringElementsAreTimeOfDay.get_proto());
proto_invs.add(SequenceStringElementsAreTimeOfDayWithSeconds.get_proto());
proto_invs.add(SequenceStringElementsAreTimeOfDayAMPM.get_proto());
proto_invs.add(SequenceStringElementsAreTimestampYYYYMMHHThhmmssmm.get_proto());
}

// Binary scalar-scalar invariants
Expand Down Expand Up @@ -1808,9 +1856,16 @@ public static void createUpperPpts(PptMap all_ppts) {
// Process each ppt that doesn't have a parent
// (mergeInvs is called on a root, and recursively processes children)
for (PptTopLevel ppt : all_ppts.pptIterable()) {
// System.out.printf("considering ppt %s parents: %s, children: %s%n",
// ppt.name, ppt.parents, ppt.children);
if (ppt.parents.size() == 0) {
boolean debug =
ppt.name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");
if (debug) {
System.out.printf(
"createUpperPpts: %s%n parents: %s%n children: %s%n",
ppt.name, ppt.parents, ppt.children);
}
ppt.mergeInvs();
}
}
Expand Down
53 changes: 48 additions & 5 deletions java/daikon/MergeInvariants.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public static void main(final String[] args)
OptionalDataException,
IOException,
ClassNotFoundException {
LogHelper.setLevel("daikon.MergeInvariants", FINE);
LogHelper.setLevel("daikon.MergeInvariants.progress", FINE);
try {
mainHelper(args);
} catch (Daikon.DaikonTerminationException e) {
Expand Down Expand Up @@ -238,12 +240,21 @@ public static void mainHelper(String[] args)
} else {
PptMap pmap = FileIO.read_serialized_pptmap(file, true);
for (PptTopLevel ppt : pmap.pptIterable()) {
boolean debug =
ppt.name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");

if (merge_ppts.containsName(ppt.name())) {
// System.out.printf("Not adding ppt %s from %s%n", ppt, file);
if (debug) {
System.out.printf("Not adding ppt %s from %s%n", ppt, file);
}
continue;
}
if (debug) {
System.out.printf("Adding ppt %s from %s%n", ppt, file);
}
merge_ppts.add(ppt);
// System.out.printf("Adding ppt %s from %s%n", ppt, file);

// Make sure that the parents of this ppt are already in
// the map. This will be true if all possible children of
Expand Down Expand Up @@ -286,6 +297,14 @@ public static void mainHelper(String[] args)
debugProgress.fine("Building hierarchy between leaves of the maps");
for (PptTopLevel ppt : merge_ppts.pptIterable()) {

boolean debug =
ppt.name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");
if (debug) {
System.out.printf("MergeInvariants processing ppt " + ppt);
}

// Skip everything that is not a final exit point
if (!ppt.ppt_name.isExitPoint()) {
assert ppt.children.size() > 0 : ppt;
Expand All @@ -296,8 +315,9 @@ public static void mainHelper(String[] args)
continue;
}

// System.out.printf("Including ppt %s, %d children%n", ppt,
// ppt.children.size());
if (debug) {
System.out.printf("Including ppt %s, %d children%n", ppt, ppt.children.size());
}

// Splitters should not have any children to begin with
if (ppt.has_splitters()) {
Expand All @@ -313,7 +333,9 @@ public static void mainHelper(String[] args)
for (int j = 0; j < pptmaps.size(); j++) {
PptMap pmap = pptmaps.get(j);
PptTopLevel child = pmap.get(ppt.name());
// System.out.printf("found child %s from pmap %d%n", child, j);
if (debug) {
System.out.printf("found child %s from pmap %d%n", child, j);
}
if (child == null) {
continue;
}
Expand Down Expand Up @@ -351,10 +373,15 @@ public static void mainHelper(String[] args)
assert ppt.splitters != null; // because ppt.has_splitters() = true
setup_conditional_merge(ppt, child);
} else {
// The returned value is ignored, but it is already stored in the parent and child.
PptRelation.newMergeChildRel(ppt, child);
}
}

if (debug) {
System.out.println("children of " + ppt + " = " + ppt.children);
}

// Make sure at least one child was found
assert ppt.children.size() > 0 : ppt;
if (ppt.has_splitters()) {
Expand All @@ -379,9 +406,25 @@ public static void mainHelper(String[] args)
}
}
}
System.out.println("PPT Hierarchy");
for (PptTopLevel ppt : merge_ppts.pptIterable()) {
boolean debug =
ppt.name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");

if (debug) {
if (ppt.parents.size() == 0) {
System.out.println(" TODO: " + ppt);
// TODO:
// ppt.debug_print_tree(debug, 0, null);
}
}
}

// Merge the invariants
debugProgress.fine("Merging invariants");
System.out.printf("Merging invariants; about to call Daikon.createUpperPpts");
Daikon.createUpperPpts(merge_ppts);

// Equality post processing
Expand Down
23 changes: 23 additions & 0 deletions java/daikon/PptSlice.java.jpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ public final class PPTSLICE1 extends PptSlice {
*/
public void merge_invariants() {

boolean debug = parent.name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");

if (debugMerge.isLoggable(Level.FINE)) {
debugMerge.fine("entering merge_invariants for " + name());
}
Expand Down Expand Up @@ -734,6 +738,10 @@ public final class PPTSLICE1 extends PptSlice {
}
}

if (debug) {
System.out.println("Found " + all_invs.size() + " invariants to merge");
System.out.println(all_invs);
}
log("Found " + all_invs.size() + " invariants to merge");
if (debugMerge.isLoggable(Level.FINE) && (valid_child_count == 0)) {
debugMerge.fine("-- No valid children found");
Expand All @@ -759,6 +767,10 @@ public final class PPTSLICE1 extends PptSlice {
invs.add(inv);
}

if (debug) {
System.out.println("inv_map = " + inv_map);
}

// Attempt to create a parent invariant for each invariant that
// appeared at each valid child. Note that some invariants will
// not exist at the parent even if they exist at each child (eg,
Expand All @@ -783,19 +795,30 @@ public final class PPTSLICE1 extends PptSlice {
}
if (child_invs.size() == valid_child_count) {
Invariant first = child_invs.get(0);
if (debug) {
System.out.printf("Attempting merge of %s invariants into ppt %s%n", child_invs.size(), name());
}
if (Debug.logOn()) {
first.log("Attempting merge of %s invariants into ppt %s", child_invs.size(), name());
}
Invariant parent_inv = first.merge(child_invs, this);
if (parent_inv != null) {
invs.add(parent_inv);
if (debug) {
System.out.printf("Merge successful of %s into %s%n", parent_inv.format(), name());
}
if (Debug.logOn()) {
parent_inv.log("Merge successful of %s into %s", parent_inv.format(), name());
}
}
} else {
if (Debug.logOn()) {
Invariant inv = child_invs.get(0);
if (debug) {
System.out.printf(
"Not merging invariant into %s, Found %s child invariants in %s children%n",
name(), child_invs.size(), valid_child_count);
}
inv.log(
"Not merging invariant into %s, Found %s child invariants in %s children",
name(), child_invs.size(), valid_child_count);
Expand Down
43 changes: 35 additions & 8 deletions java/daikon/PptTopLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3650,8 +3650,14 @@ public void mergeInvs() {
// Merge the ModBitTracker.
// We'll reuse one dummy ValueTuple throughout, side-effecting its mods
// array.
if (debugStdout) {
System.out.printf("in ppt %s%n", name());
boolean debugLocal =
debugStdout
&& name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");

if (debugLocal) {
System.out.printf("mergeInvs in ppt %s%n", name());
System.out.printf(" num_tracevars = %d%n", num_tracevars);
System.out.printf(" mbtracker.num_vars() = %d%n", mbtracker.num_vars());
for (int ii = 0; ii < var_infos.length; ii++) {
Expand All @@ -3667,8 +3673,19 @@ public void mergeInvs() {
for (PptRelation rel : children) {
ModBitTracker child_mbtracker = rel.child.mbtracker;
int child_mbsize = child_mbtracker.num_samples();
// System.out.println("mergeInvs child #" + children.indexOf(rel) + "=" + rel.child.name() + "
// has size " + child_mbsize + " for " + name());
if (debugLocal) {
System.out.println(
"mergeInvs child #"
+ children.indexOf(rel)
+ "/"
+ children.size()
+ "="
+ rel.child.name()
+ " has size "
+ child_mbsize
+ " for "
+ name());
}
for (int sampno = 0; sampno < child_mbsize; sampno++) {
Arrays.fill(mods, ValueTuple.MISSING_FLOW);
for (int j = 0; j < var_infos.length; j++) {
Expand Down Expand Up @@ -3858,11 +3875,17 @@ public void mergeInvs() {
@RequiresNonNull("equality_view")
public void merge_invs_multiple_children() {

boolean debugLocal =
debugStdout
&& name()
.startsWith(
"com.rolemodelsoft.drawlet.basics.AbstractFigure.addPropertyChangeListener(java.beans.PropertyChangeListener)");

// Debug print ppt and children
if (debugStdout) {
if (debugLocal) {
System.out.printf("Merging invariants for ppt %s%n", this);
for (PptRelation rel : children) {
System.out.printf("child: %s%n", rel);
System.out.printf(" child: %s%n", rel);
}
}

Expand All @@ -3877,8 +3900,9 @@ public void merge_invs_multiple_children() {
continue;
}
if (constants != null && constants.is_missing(l)) {
// System.out.printf("skipping leader %s in ppt %s, always missing%n",
// l, name());
if (debugLocal) {
System.out.printf("skipping leader %s in ppt %s, always missing%n", l, name());
}
continue;
}
non_missing_leaders.add(l);
Expand All @@ -3900,6 +3924,9 @@ public void merge_invs_multiple_children() {
}
suppressed_invs.put(child, NIS.create_suppressed_invs(child));
}
if (debugLocal) {
System.out.println("suppressed_invs = " + suppressed_invs);
}

// Create unary views and related invariants
List<PptSlice> unary_slices = new ArrayList<>();
Expand Down
Loading
Loading