{"id":25777110,"url":"https://github.com/cs-au-dk/TIP","last_synced_at":"2025-02-27T06:07:12.821Z","repository":{"id":12003815,"uuid":"14583355","full_name":"cs-au-dk/TIP","owner":"cs-au-dk","description":"Static program analysis for TIP","archived":false,"fork":false,"pushed_at":"2022-12-25T21:32:59.000Z","size":3172,"stargazers_count":270,"open_issues_count":6,"forks_count":120,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-03-26T15:15:18.092Z","etag":null,"topics":["pointer-analysis","points-to-analysis","program-analysis","static-analyzer","static-code-analysis"],"latest_commit_sha":null,"homepage":"http://cs.au.dk/~amoeller/spa/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cs-au-dk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-21T09:38:20.000Z","updated_at":"2024-03-08T03:03:45.000Z","dependencies_parsed_at":"2023-01-11T20:17:23.004Z","dependency_job_id":null,"html_url":"https://github.com/cs-au-dk/TIP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-au-dk%2FTIP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-au-dk%2FTIP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-au-dk%2FTIP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-au-dk%2FTIP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cs-au-dk","download_url":"https://codeload.github.com/cs-au-dk/TIP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pointer-analysis","points-to-analysis","program-analysis","static-analyzer","static-code-analysis"],"created_at":"2025-02-27T06:01:36.610Z","updated_at":"2025-02-27T06:07:12.813Z","avatar_url":"https://github.com/cs-au-dk.png","language":"Scala","readme":"# TIP\n\nTIP is a tiny imperative programming language aimed at teaching the\nfundamental concepts of static program analysis. This code accompanies the\nlecture notes on [Static Program Analysis](http://cs.au.dk/~amoeller/spa/).\n\n## Getting started\n\nPrerequisites:\n- Java 8 (or newer)\n- [Scala 2.12](http://www.scala-lang.org/download/)\n- [SBT](http://www.scala-sbt.org/)\n\nWe suggest you to use IntelliJ for working on TIP, but all the following\noptions are viable.\n\n### IntelliJ IDEA\n\n- Install the Scala plugin in IntelliJ. (Follow the instructions on [how to install IntelliJ plugins](https://www.jetbrains.com/help/idea/installing-updating-and-uninstalling-repository-plugins.html), search for \"Scala\" in the plugins menu.)\n- Open a terminal, navigate to the directory where you want to store the TIP project.\n- Run `git clone https://github.com/cs-au-dk/TIP.git tip`\n- In IntelliJ, click File -\u003e New -\u003e Project from Existing Sources..., choose your new 'tip' directory, click OK, choose 'Import project from external model', then 'sbt' and 'Next'.\n- Select a 'Project JDK' (1.8 or newer), and make sure 'builds' is enabled under 'sbt shell\", 'use for' before clicking 'Finish'.\n- In the IntelliJ Project overview, move the contents of 'ideafiles' into '.idea', overwriting the existing files.\n- Now reload the project by clicking File -\u003e Invalidate Caches / Restart... -\u003e Just Restart. (Yes, this step is necessary, because of a bug in IntelliJ.)\n- Right-click on `Tip.scala` in `src/tip`, then select \"Run 'Tip'\". To supply arguments, use Run... -\u003e Edit Configurations in the Run menu.\n  \n#### IntelliJ Scala bugs\n\n**Important: if you experience spurious type errors reported by IntelliJ for code involving Scala implicits, try disabling type-aware highlighting**\nby clicking on the small `[T]` icon on the bottom right corner of the window.\n\n#### IntelliJ performance\n\nIf your IntelliJ has high-CPU and high-memory peaks while editing, the\nfollowing tweaks might be useful:\n\n- Disable type-aware highlighting by clicking on the small `[T]` icon on the\n  bottom right corner of the window.\n- Go to Help -\u003e Edit Custom VM Options and increase the JVM memory at least\n  with the following values:\n```\n-Xms500m -Xmx1500m\n```\n- If still nothing works, try File -\u003e Power Save Mode.\n\n#### IntelliJ Import optimization\n\nIntelliJ offers an option to optimize imports upon commit. We suggest not to\nuse that feature, as it may remove needed imports thereby breaking\ncompilation.\n\n### Eclipse\n\n- Check that you have installed the [scala-plugin](http://scala-ide.org/) for\n  Eclipse.\n- To run TIP from within Eclipse, feed the [arguments](#tipcmd) into the Run\n  Arguments dialog.\n\n### Working from the command-line\n\nA wrapper command `tip` (`tip.bat` for Windows) is provided to compile and run\nTIP with the given arguments.\n\nExample:\n```\n./tip -run examples/fib.tip\n```\n\nTo build:\n```\nsbt compile\n```\n\n## Command-line arguments \u003ca name=\"tipcmd\"\u003e\u003c/a\u003e\n\nUsage:\n```\ntip \u003coptions\u003e \u003csource\u003e [out]\n```\nwhere `\u003csource\u003e` can be a file or a directory containing `.tip` files and\n`[out]` is an output directory (default: ./out).\n\nTo see the possible options, run `tip` without options.\nOption `-verbose` is recommended when developing and testing analyses.\n\n## Visualizing control flow graphs and analysis results\n\nThe main function `Tip.scala` emits control flow graphs and analysis results as \".dot\" files \nthat can be processed by [Graphviz](https://www.graphviz.org/) to produce images, for example using the Graphviz dot command-line tool:\n```\ndot -O -Tpng out/example.tip__sign.dot\n```\n\n## Program normalization\n\nSome analyses require the programs use restricted subsets of TIP. \nThe following kinds of normalization can be performed automatically:\n\n- `-normalizecalls`: \n  normalizes function calls to be top-level only and such that arguments are identifiers \n  (e.g. `id1 = id2(id3,id4)`)\n- `-normalizereturns`: \n  normalizes return expressions to be identifiers \n  (e.g. `return id`)\n- `-normalizepointers`: \n  normalizes pointer operations to primitive statements\n  (`id = alloc P` where `P` is null or an integer constant, `id1 = \u0026id2`, `id1 = id2`, `id1 = *id2`, `*id1 = id2`, or`id = null`) \n \nIf one or more of these options are enabled, the normalized program is printed to e.g. `out/example.tip__normalized.tip`. \n \n## Help to Scala novices\n\nThis implementation takes advantage of many cool Scala language features that allow the code to be concise and flexible. \nMany of these language features are quite intuitive and easy to understand for anyone familiar with \nobject oriented and functional programming, even without prior knowledge of Scala.\nStill, the following language features deserve some extra attention:\n\n- [traits](https://docs.scala-lang.org/tour/traits.html)\n- [case classes](https://docs.scala-lang.org/tour/case-classes.html)\n- [companion objects](https://docs.scala-lang.org/tour/singleton-objects.html)\n- [abstract type members](https://docs.scala-lang.org/tour/abstract-types.html) (see e.g. [GenericLattices.scala](src/tip/lattices/GenericLattices.scala))\n- [implicit parameters](https://docs.scala-lang.org/tour/implicit-parameters.html) (see e.g. [TypeAnalysis.scala](src/tip/analysis/TypeAnalysis.scala))\n- [implicit conversions](https://docs.scala-lang.org/tour/implicit-conversions.html) (see e.g. [TipType.ast2typevar](src/tip/types/Types.scala))\n- [implicit classes](https://docs.scala-lang.org/overviews/core/implicit-classes.html) (see e.g. [AstNodeData.AstNodeWithDeclaration](src/tip/ast/AstNodeData.scala))\n\nTutorials and extensive documentation for Scala are available at [http://docs.scala-lang.org/](http://docs.scala-lang.org/).\n\nUseful tips: \n  - You can see what type Scala has inferred for an expression by selecting the expression and pressing Alt+Equals \n(depending on keyboard settings in Settings -\u003e Keymap -\u003e Scala -\u003e Type Info).\n  - You can see what implicit conversion Scala is applying by enabling View -\u003e Show Implicit Hints (and View -\u003e Expand Implicit Hints, for full information).\n\n## Code style\n\nTo avoid using inconsistent code styles and meaningless diffs caused\nby IDE reformatting we use [scalafmt](http://scalameta.org/scalafmt/).\n\nThe code is automatically formatted upon compilation by SBT.\n\nBefore committing, please double-check that all the code is in the right format by executing `sbt scalafmt`. \nTo automatically format when the file is saved, go to File -\u003e Settings..., under 'Editor', 'Code Style', 'Scala', make sure 'Scalafmt' is selected under 'Formatter'. (Unfortunately the formatting is only triggered when the file is *explicitly* saved with Ctrl-S.)\n\n## Authors\n\n- [Anders M\u0026oslash;ller](http://cs.au.dk/~amoeller/)\n- [Gianluca Mezzetti](http://gmezzetti.name/)\n\nwith contributions from\n\n- [Coen De Roover](http://soft.vub.ac.be/~cderoove/)\n- [Quentin Stievenart](http://awesom.eu/~acieroid/)\n- Erik Krogh Kristensen\n- Christian Budde Christensen\n","funding_links":[],"categories":["静态分析"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-au-dk%2FTIP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcs-au-dk%2FTIP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-au-dk%2FTIP/lists"}