-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Java/C++/Go/C#: Share parts of ExternalFlow.qll #21011
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
Open
aschackmull
wants to merge
12
commits into
github:main
Choose a base branch
from
aschackmull:mad/shared-externalflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cb578e3
Java: Move interpretModelForTest into shared code.
aschackmull f0e7f1a
C++/C#/Go: Align ExternalFlowExtensions with Java.
aschackmull 0915db4
C++/C#/Go: Use shared interpretModelForTest.
aschackmull 3b334ea
Java/C#: Share model coverage code.
aschackmull 47dcf05
C++/Go/Java: Don't import top-level extensible predicates.
aschackmull 0725251
Java/C++: Thread additional models through the shared lib.
aschackmull e262438
C++: Use shared model coverage code.
aschackmull 5bddc8d
Go: Move Go package-grouping support into shared lib.
aschackmull 4b2e8c0
C++/C#/Go: Add empty extensible data.
aschackmull 8564b4e
Go: Use shared modelCoverage.
aschackmull 7f8d077
MaD: Rename file.
aschackmull 64a48e4
MaD: Use "namespace" instead "package" in shared code.
aschackmull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| overlay[local?] | ||
| module; | ||
|
|
||
| signature module ExtensionsSig { | ||
| /** | ||
| * Holds if a source model exists for the given parameters. | ||
| */ | ||
| predicate sourceModel( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string output, string kind, string provenance, QlBuiltins::ExtensionId madId | ||
| ); | ||
|
|
||
| /** | ||
| * Holds if a sink model exists for the given parameters. | ||
| */ | ||
| predicate sinkModel( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string kind, string provenance, QlBuiltins::ExtensionId madId | ||
| ); | ||
|
|
||
| /** | ||
| * Holds if a barrier model exists for the given parameters. | ||
| */ | ||
| predicate barrierModel( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string output, string kind, string provenance, QlBuiltins::ExtensionId madId | ||
| ); | ||
|
|
||
| /** | ||
| * Holds if a barrier guard model exists for the given parameters. | ||
| */ | ||
| predicate barrierGuardModel( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string acceptingvalue, string kind, string provenance, | ||
| QlBuiltins::ExtensionId madId | ||
| ); | ||
|
|
||
| /** | ||
| * Holds if a summary model exists for the given parameters. | ||
| */ | ||
| predicate summaryModel( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string output, string kind, string provenance, QlBuiltins::ExtensionId madId | ||
| ); | ||
|
|
||
| /** | ||
| * Holds if a neutral model exists for the given parameters. | ||
| */ | ||
| predicate neutralModel( | ||
| string namespace, string type, string name, string signature, string kind, string provenance | ||
| ); | ||
| } | ||
|
|
||
| module ModelsAsData<ExtensionsSig Extensions> { | ||
| /** | ||
| * Holds if the given extension tuple `madId` should pretty-print as `model`. | ||
| * | ||
| * Barrier models are included for completeness even though they will not show up in a path. | ||
| * | ||
| * This predicate should only be used in tests. | ||
| */ | ||
| predicate interpretModelForTest(QlBuiltins::ExtensionId madId, string model) { | ||
| exists( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string output, string kind, string provenance | ||
| | | ||
| Extensions::sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, | ||
| provenance, madId) | ||
| | | ||
| model = | ||
| "Source: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + | ||
| "; " + ext + "; " + output + "; " + kind + "; " + provenance | ||
| ) | ||
| or | ||
| exists( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string kind, string provenance | ||
| | | ||
| Extensions::sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, | ||
| provenance, madId) | ||
| | | ||
| model = | ||
| "Sink: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; " | ||
| + ext + "; " + input + "; " + kind + "; " + provenance | ||
| ) | ||
| or | ||
| exists( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string output, string kind, string provenance | ||
| | | ||
| Extensions::barrierModel(namespace, type, subtypes, name, signature, ext, output, kind, | ||
| provenance, madId) | ||
| | | ||
| model = | ||
| "Barrier: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + | ||
| "; " + ext + "; " + output + "; " + kind + "; " + provenance | ||
| ) | ||
| or | ||
| exists( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string acceptingvalue, string kind, string provenance | ||
| | | ||
| Extensions::barrierGuardModel(namespace, type, subtypes, name, signature, ext, input, | ||
| acceptingvalue, kind, provenance, madId) | ||
| | | ||
| model = | ||
| "Barrier Guard: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + | ||
| signature + "; " + ext + "; " + input + "; " + acceptingvalue + "; " + kind + "; " + | ||
| provenance | ||
| ) | ||
| or | ||
| exists( | ||
| string namespace, string type, boolean subtypes, string name, string signature, string ext, | ||
| string input, string output, string kind, string provenance | ||
| | | ||
| Extensions::summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, | ||
| provenance, madId) | ||
| | | ||
| model = | ||
| "Summary: " + namespace + "; " + type + "; " + subtypes + "; " + name + "; " + signature + | ||
| "; " + ext + "; " + input + "; " + output + "; " + kind + "; " + provenance | ||
| ) | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dynamic languages have
ModelsAsData.qll; I think it would be better to spell it out here as well.