GithubHelp home page GithubHelp logo

datalog's Introduction

I enjoy building secure and correct systems. I have built a number of static analysis and automated verification tools, with a recent focus on analysis of binaries.

Repositories

Data Structures

Data structures that may be generally useful

  • haggle [36 ⭐ 📖]: An efficient graph library for Haskell
  • persistent-vector [27 ⭐ 📖]: Persistent vectors for Haskell based on array mapped tries
  • robbed [4 ⭐]: A pure Haskell implementation of Reduced Ordered Binary Decision Diagrams (BDDs)

Program Analysis

  • ql-grep [2 ⭐]: A code search tool that implements CodeQL on the tree-sitter infrastructure
  • build-bom [43 ⭐]: Dynamically discover the commands used to create a piece of software
  • whole-program-llvm [648 ⭐]: A wrapper script to build whole-program LLVM bitcode files; note that I consider this to be obsoleted by build-bom, which takes a more robust approach to the same problem
  • itanium-abi [12 ⭐ 📖]: An implementation of C++ name mangling for the Itanium ABI
  • what4-serialize [0 ⭐]: Serialization/deserialization for What4 expressions

Binary Analysis

  • crepitans [2 ⭐]: A tool for scriptable exploration of binaries
  • dismantle [24 ⭐]: A library of assemblers and disassemblers derived from LLVM TableGen data
  • portable-executable [3 ⭐]: Tools for working with the Windows Portable Executable (PE) file format
  • semmc [34 ⭐]: Stratified synthesis for learning machine code instruction semantics
  • macaw [188 ⭐]: Open source binary analysis tools.
  • macaw-loader [5 ⭐]: Uniform interface to load a binary executable and get Macaw Memory and a list of entry points.
  • renovate [46 ⭐]: A library for binary analysis and rewriting
  • language-sleigh [5 ⭐]: A parser for the Sleigh language, which is used to represent ISA semantics in Ghidra
  • mctrace [5 ⭐]: An implementation of DTrace for machine code

Debugging Tools

  • ddmin [3 ⭐]: An implementation of delta debugging (ddmin) in Haskell
  • surveyor [18 ⭐]: A symbolic debugger for C/C++ (via LLVM), machine code, and JVM programs
  • binary-walkr [2 ⭐]: A tool for examining ELF binaries

Solvers

Note that these are interesting and informative, but definitely not efficient enough to use in production

  • satisfaction [2 ⭐]: A DPLL SAT solver written in Haskell
  • datalog [100 ⭐]: A pure Haskell implementation of Datalog
  • ifscs [4 ⭐ 📖]: An inductive form set constraint solver in Haskell
  • satir [1 ⭐]: An implementation of a SAT solver in Rust

Emacs Packages

Others

  • taffybar [684 ⭐ 📖]: A gtk based status bar for tiling window managers such as XMonad; now maintained by Ivan Malison
  • travitch [1 ⭐]: The code for my Github profile page, which generates this page
  • blog [3 ⭐]: The code for my blog (ravit.ch)
  • dotfiles [0 ⭐]: A collection of dotfiles managed by Chezmoi

datalog's People

Contributors

alanz avatar chrisdone avatar travitch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datalog's Issues

Needs old libraries? [solution: delete bounds in Cabal file, then use Stack as normal]

I built it with Stack instead of Cabal. Stack seems to think it needs a really old resolver:

jeff@jbb-lenovo:~/code/datalog$ stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- datalog.cabal

Selecting the best among 11 snapshots...

* Partially matches lts-9.9
    transformers version 0.5.2.0 found
        - datalog requires >=0.3 && <0.5
    vector version 0.12.0.1 found
        - datalog requires >=0.9 && <0.11

* Partially matches nightly-2017-10-21
    transformers version 0.5.2.0 found
        - datalog requires >=0.3 && <0.5
    vector version 0.12.0.1 found
        - datalog requires >=0.9 && <0.11

* Partially matches lts-8.24
    transformers version 0.5.2.0 found
        - datalog requires >=0.3 && <0.5
    vector version 0.11.0.0 found
        - datalog requires >=0.9 && <0.11

* Partially matches lts-7.24
    transformers version 0.5.2.0 found
        - datalog requires >=0.3 && <0.5
    vector version 0.11.0.0 found
        - datalog requires >=0.9 && <0.11

* Partially matches lts-6.35
    vector version 0.11.0.0 found
        - datalog requires >=0.9 && <0.11

* Partially matches lts-5.18
    vector version 0.11.0.0 found
        - datalog requires >=0.9 && <0.11

* Partially matches lts-4.2
    vector version 0.11.0.0 found
        - datalog requires >=0.9 && <0.11

* Matches lts-3.22

Selected resolver: lts-3.22
Initialising configuration using resolver: lts-3.22
Total number of user packages considered: 1
Writing configuration to file: stack.yaml
All done.
jeff@jbb-lenovo:~/code/datalog$ 

I would like to use it in a project with more recent dependencies. Is there a way?

Can the same variable not appear twice in a literal?

I ask because the README says "Rewrite literals like f(X,X) into f(X,Y), X=Y. A few internals assume that the same variable doesn't appear twice in a literal" -- but it says that under "Planned Enhancements", as opposed to (a hypothetical section called) "instructions to the user".

Multiple Inference Predicates

where 
    q = do
      use <- relationPredicateFromName "use" 
      def <- relationPredicateFromName "def" 
      succ <- relationPredicateFromName "succ" 
      live <- inferencePredicate "live"
      live2 <- inferencePredicate "live2"
      let l  = LogicVar "l"
          l' = LogicVar "l'"
          t  = LogicVar "t"
          t' = LogicVar "t'"
      (live, [l,t]) |- [ lit use [l,t] ]
      (live, [l,t]) |- [ lit live [l',t]
                       , lit succ [l, l']
                       , negLit def [l, t] ]
      (live2, [l,t]) |- [ lit live [l,t] ]
      issueQuery live2 [l,t]

Hi there, I seem to be having some trouble with inference predicates that require other inference predicates. In the above code, if I issue the query for live instead of live2 everything works fine, and it actually generates liveness. If, however, I query for live2, the database produces nothing. Any idea as why this might be?

RangeRestrictionViolation for literal in head

The following code generates a RangeRestrictionViolation in the MagicSets transformation

db2 :: Maybe (Database Text)
db2 = makeDatabase $ do
      stateRel <- addRelation "state" 2
      let facts :: [[Text]]
          facts = [ [ "b", "z" ]
                  ]
      mapM_ (assertFact stateRel) facts

tq3 :: IO ()
tq3 = do
  let Just db = db2
      q = do
        stateRel <- relationPredicateFromName "state"
        toggle <- inferencePredicate "toggle"
        let x = LogicVar "x"
            y = LogicVar "y"
        (toggle, [Atom "a", y]) |- [ lit stateRel [Atom "b", y] ]
        (toggle, [Atom "b", y]) |- [ lit stateRel [Atom "a", y] ]
        issueQuery toggle [x, y ]

  res <- queryDatabase db q
  putStrLn ("res=" ++ (show res))

FYI, I am trying to capture the following rules

toggle(1, T) :- state(0, T). toggle(0, T) :- state(1, T).

Querying data?

How do you query with the REPL?

chris@retina:~/Projects/datalog$ datalog-repl 
% human(chris).
% :facts
human(chris).
% ?human(X).
Query result:
datalog-repl: No rules for pattern

@pchiusano does your version support this?

Add data to an existing database

The tests demonstrate how to make a database from scratch and query it. But what if you wanted to add a relationship to an existing database, or assert that a relationship holds for a new tuple?

Hackage?

Are you intending to put this on hackage?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.