Skip to content

Commit

Permalink
Cumulative updates
Browse files Browse the repository at this point in the history
  • Loading branch information
amoeller committed Jan 18, 2017
1 parent 5774779 commit a986468
Show file tree
Hide file tree
Showing 168 changed files with 5,357 additions and 5,273 deletions.
43 changes: 7 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,9 @@
*.class
*.log

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# Scala-IDE specific
.scala_dependencies

#idea project files
.idea/
.idea_modules/
/.cache

# gradle eclipse files
/.settings/
bin/
/.project
/.classpath


# gradle
.gradle
*.iml
*.ipr
*.iws
build/

# compilation tmp file
comp.out

# tip out folder
out/
.classpath
.project
.settings
.idea/
/target
/project
.DS_Store
17 changes: 17 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,108 changes: 4 additions & 1,104 deletions .idea/inspectionProfiles/Project_Default.xml

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
style = IntelliJ
maxColumn = 150
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
language: java
language: scala
scala:
- 2.11.8

# whitelist
branches:
only:
- master
- devel
- public-release
128 changes: 68 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,102 @@
#TIP

TIP is a tiny imperative programming language aimed at teaching the fundamental concepts of static program analysis.
TIP is a tiny imperative programming language aimed at teaching the
fundamental concepts of static program analysis. This code accompanies the
lecture notes on [Static Program Analysis](http://cs.au.dk/~amoeller/spa/).

[![Build Status](https://travis-ci.org/cs-au-dk/TIP.svg)](https://travis-ci.org/cs-au-dk/TIP)

## Getting started

Prerequisites:
- Check you have [Scala 2.11](http://www.scala-lang.org/download/) installed
- [Scala 2.11](http://www.scala-lang.org/download/)
- [SBT](http://www.scala-sbt.org/)

### Eclipse users
We suggest you to use IntelliJ for working on TIP, but all the following
options are viable.

- Check that you have installed the [scala-plugin](http://scala-ide.org/) for eclipse
- Run ```./gradlew eclipse``` (```gradlew eclipse``` on Windows) to generate the eclipse project files.
- Now you should be able to open and build the project from eclipse.
- To run tip from within eclipse feed the [arguments](#tipcmd) into the "Run Arguments" dialog
### IntelliJ IDEA

### IntelliJ IDEA users
- Import the project from the SBT model.
- Since the `.idea` folder is regenerated from scrach, in order to keep the
inspection profiles you need to checkout the `.idea/inspectionProfiles`
folder and the `.idea/codeStyleSettings.xml` file from the original repo,
leaving untouched the other generated folders.
- Follow the IDE instructions to download the Scala plugin and to set-up the
Scala SDK, if needed.
- Right-click on `Tip.scala` in `src/tip`, then select `Run 'Tip'`. To supply
arguments, use `Edit Configurations` in the `Run` menu.

- Import the project from the Gradle model
- Since the ```.idea``` folder is regenerated from scrach, in order to keep the inspection profiles, you need to checkout the ```.idea/inspectionProfiles``` folder from this repo, leaving untouched the other generated folders
- Follow the IDE instructions to download the Scala plugin and to set-up the Scala-SDK, if needed
#### IntelliJ performance

### Working from the terminal

To build

```
./gradlew build
```

To build an executable
If your IntelliJ has high-CPU and high-memory peaks while editing, the
following tweaks might be useful:

- Disable type-aware highlighting by clicking on the small `[T]` icon on the
bottom right corner of the window.
- Go to `Help -> Edit Custom VM Options` and increase the JVM memory at least
with the following values:
```
./gradlew installDist
-Xms500m -Xmx1500m
```
- If still nothing works, try `File -> Power Save Mode`.

#### Build -> Run cycle
#### IntelliJ Import optimization

A wrapper ```tipw``` is provided to compile and run TIP with the given arguments.
IntelliJ offers an option to optimize imports upon commit. We suggest not to
use that feature, as it may remove needed imports thereby breaking
compilation.

## Command-line arguments <a name="tipcmd"></a>
### Eclipse

```
Usage:
tip <options> <source> [out]
- Check that you have installed the [scala-plugin](http://scala-ide.org/) for
Eclipse.
- To run TIP from within Eclipse, feed the [arguments](#tipcmd) into the `Run
Arguments` dialog.

<source> can be a file or a directory,
### Working from the command-line

[out] is an output directory (default: ./out)
A wrapper command `tip` (`tip.bat` for Windows) is provided to compile and run
TIP with the given arguments.

possible options are:
Example:
```
./tip -types examples/a1.tip
```

Analyses:
To build:
```
sbt compile
```

-cfg construct the control flow graph, but do not perform any analysis
-icfg construct the interprocedural control flow graph, but do not perform any analysis
-types enable type analysis
-cfa enable control-flow analysis
-andersen enable Andersen pointer analysis
-steensgaard enable Steensgaard pointer analysis
-sign enable sign analysis
-livevars enable live variables analysis
-available enable available expressions analysis
-vbusy enable very busy expressions analysis
-reaching enable reaching definitions analysis
-constprop enable constant propagation analysis
-interval enable interval analysis
## Command-line arguments <a name="tipcmd"></a>

some of the previous options can be followed immediately by the modifiers
Usage:
```
tip <options> <source> [out]
```
where `<source>` can be a file or a directory containing `.tip` files and
`[out]` is an output directory (default: ./out).

wl use the worklist solver
wli use the worklist solver with init
wliw use the worklist solver with init and widening
wliwn use the worklist solver with init, widening, and narrowing
wlip use the worklist solver with init and propagation
iwli use the worklist solver with init, interprocedural version
iwlip use the worklist solver with init and propagation, interprocedural version
iwlic use the worklist solver with init, interprocedural version with CFA analysis
To see the possible options, run `tip` without options.

e.g. -sign wl will run the sign analysis using the basic worklist solver
## Code style

Running:
To avoid using inconsistent code styles and meaningless diffs caused
by IDE reformatting we use [scalafmt](https://olafurpg.github.io/scalafmt/).
Before committing, please double-check that all the code is in the right
format by executing `sbt scalafmt` or by installing the `scalafmt` IDE plugin
and enabling the `Format on save` option as explained
[here](https://olafurpg.github.io/scalafmt/#IntelliJ).

-run run the program as the last step
```
## Authors

- Gianluca Mezzetti
- [Gianluca Mezzetti](http://gmezzetti.name/)
- [Anders M&oslash;ller](http://cs.au.dk/~amoeller/)
- Erik Krogh Kristensen
- Christian Budde Christensen

with contributions from

- [Coen De Roover](http://soft.vub.ac.be/~cderoove/)
- [Quentin Stievenart](http://awesom.eu/~acieroid/)
- Erik Krogh Kristensen (interpreter)
- Christian Budde Christensen (interpreter)
84 changes: 0 additions & 84 deletions build.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name := "tip"
version := "2.0.0"

scalaVersion := "2.11.8"

trapExit := false

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.3"
libraryDependencies += "com.regblanc" % "scala-smtlib_2.11" % "0.2.1"
libraryDependencies += "junit" % "junit" % "4.12" % "test"
libraryDependencies += "org.scalatest" % "scalatest_2.11" % "3.0.0"

scalaSource in Compile := baseDirectory.value / "src"
scalaSource in Test := baseDirectory.value / "test"
4 changes: 2 additions & 2 deletions examples/a1.tip
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
map(l,f,z) {
var r;
if (l==null){
r=z;
r=z;
} else {
r=(f)(map(*l,f,z));
r=(f)(map(*l,f,z));
}
return r;
}
Expand Down
Loading

0 comments on commit a986468

Please sign in to comment.