Skip to content

Commit

Permalink
Merged in master (pull request #162)
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
gfour committed Apr 15, 2021
2 parents 2b729ed + 7842a83 commit 20421c7
Show file tree
Hide file tree
Showing 153 changed files with 4,578 additions and 1,803 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ At its core, Doop is a collection of various analyses expressed in the form of D
[repo](https://github.com/souffle-lang/souffle) and follow the
instructions found on [this
page](https://souffle-lang.github.io/build). Doop is currently
tested with Souffle 1.5.1.
tested with Souffle 1.5.1 and Souffle 2.0.2.

2. The legacy (unmaintained) version uses **LogiQL**, a Datalog
dialect developed by [LogicBlox](http://www.logicblox.com/). For a
Expand Down Expand Up @@ -170,7 +170,7 @@ In order to use LogicBlox instead of the Soufflé engine you can provide the --X

$ ./doop -i ../doop-benchmarks/dacapo-2006/antlr.jar -a context-insensitive --dacapo --id lb-antlr --Xlb
##### Warning: For the latest features we recommend using Souffle

### Android Analysis

You can select to run an Android-specific analysis on an Android application by providing the `--android` option.
Expand Down
4 changes: 2 additions & 2 deletions bin/gen-decls-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def endDoc(outDoc):

def writeDoc(outDoc, rules):
startDoc(outDoc)
for logicFile in sorted(rules.iterkeys()):
for logicFile in sorted(rules.keys()):
decls = rules[logicFile]
decls.sort()
startNewFile(outDoc, logicFile)
Expand All @@ -72,7 +72,7 @@ def parseLogicDir(logicDir):
content = ""
decls = []
# Ignore lines containing '//' (commented-out .decl lines).
with open(path, 'rb') as f:
with open(path, 'r') as f:
for line in f.readlines():
if not ('//' in line):
content += line
Expand Down
8 changes: 4 additions & 4 deletions bin/scaler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import os
import shutil
import sys
Expand All @@ -25,12 +25,12 @@
def run_pre_analysis(args):
args = [DOOP] + args
args = args + ['-a', PRE_ANALYSIS]
args = args + ['--scaler-pre']
args = args + ['--Xscaler-pre']
args = args + ['--id', APP + "-scaler-ci"]
args = args + ['--input-id', APP+"-facts"]
args = args + ['--Xsymlink-cached-facts']
cmd = ' '.join(args)
print YELLOW + BOLD + 'Running pre-analysis ...' + RESET
print YELLOW + BOLD + 'Running pre-analysis ... ' + RESET
# print cmd
os.system(cmd)

Expand Down Expand Up @@ -97,7 +97,7 @@ def run(args):
if not os.path.exists(os.path.join(SCALER_CACHE, APP)):
os.mkdir(os.path.join(SCALER_CACHE, APP))
run_pre_analysis(args)
ci_analysis_database = os.path.join(DOOP_OUT, 'context-insensitive', APP + '-scaler-ci', 'database')
ci_analysis_database = os.path.join(DOOP_OUT, APP + '-scaler-ci', 'database')
dump_required_doop_results(APP, ci_analysis_database, os.path.join(SCALER_CACHE, APP))
scaler_file = run_scaler(APP, os.path.join(SCALER_CACHE, APP), os.path.join(SCALER_OUT, APP))
run_main_analysis(args, scaler_file)
Expand Down
8 changes: 4 additions & 4 deletions bin/zipper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import os
import shutil
import sys
Expand Down Expand Up @@ -30,7 +30,7 @@ def run_pre_analysis(initArgs):
del args[i] # delete the analysis argument
args = [DOOP] + args
args = args + ['-a', PRE_ANALYSIS]
args = args + ['--zipper-pre']
args = args + ['--Xzipper-pre']
args = args + ['--cache']
args = args + ['--id', APP + "-zipper-ci"]
args = args + ['--input-id', APP+"-facts"]
Expand All @@ -40,7 +40,7 @@ def run_pre_analysis(initArgs):
# print cmd
os.system(cmd)

ci_analysis_facts = os.path.join(DOOP_OUT, 'context-insensitive', APP + '-zipper-ci', 'facts')
ci_analysis_facts = os.path.join(DOOP_OUT, APP + '-zipper-ci', 'facts')

cache_facts_dir = os.path.join(ZIPPER_CACHE, APP, 'facts')
if not os.path.exists(cache_facts_dir):
Expand Down Expand Up @@ -101,7 +101,7 @@ def run_zipper(app, cache_dir, out_dir):

def run_main_analysis(args, zipper_file):
args = [DOOP] + args
args = args + ['--zipper', zipper_file]
args = args + ['--Xzipper', zipper_file]
args = args + ['--input-id', APP+"-facts"]
args = args + ['--Xsymlink-cached-facts']

Expand Down
32 changes: 30 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (project.hasProperty('heapDLVersion'))
heapDLVersion = project.property('heapDLVersion')

wrapper {
gradleVersion = "6.2"
gradleVersion = "6.7"
}

def allGeneratorProjects = subprojects.findAll { it.name.contains('fact-generator') }
Expand Down Expand Up @@ -143,7 +143,7 @@ gradle.rootProject.ext.metadataVersion='2.1.0'
gradle.rootProject.ext.groovyVersion="3.0.6"
gradle.rootProject.ext.clueCommonVersion='3.24.0'
gradle.rootProject.ext.log4jVersion='1.2.17'
gradle.rootProject.ext.spockVersion='2.0-M3-groovy-3.0'
gradle.rootProject.ext.spockVersion='2.0-M5-groovy-3.0'

dependencies {
// apktool "ext:apktool:2.4.0" // old artifactory dependency
Expand Down Expand Up @@ -304,6 +304,34 @@ task souffleScript(type: JavaExec) {
args project.property("args").split()
}

task xtractor(type: JavaExec) {
// We set the DOOP_HOME environment variable (see org.clyze.doop.Main)
environment.DOOP_HOME = projectDir
description 'Run xTractor logic'
group = 'Doop'
main = 'org.clyze.doop.utils.XTractor'
classpath = sourceSets.main.runtimeClasspath
if (project.hasProperty("args"))
args project.property("args").split()
}

def testNames = new File("src/inputTests").list()

sourceSets {
testNames.each { t -> "$t" { java { srcDirs = ["src/inputTests/$t"] } } }
}

testNames.each {name ->
task "${name}JAR"(type:Jar, dependsOn: "${name}Classes") {
group = 'Input Test'
from sourceSets.getByName(name).output.classesDirs
archiveFileName.set("${name}.jar")
manifest { attributes 'Main-Class': "A" }
xtractor.dependsOn it
}
}


task createEmptyProperties {
doLast {
def urls = sourceSets.main.runtimeClasspath.files.collect { it.toURI().toURL() } as URL[]
Expand Down
2 changes: 1 addition & 1 deletion docs/doop-101.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Put the following logic in file extra.dl:

```
#!java
.decl Temp(v: Var, h: mainAnalysis.Value)
.decl Temp(v: Var, h: Value)
Temp(v, h) :-
mainAnalysis.VarPointsTo(_, h, _, v),
Expand Down
Loading

0 comments on commit 20421c7

Please sign in to comment.