cabal-version: 3.12
name: dhscanner-kbgen
category: parsing
synopsis: knowledge base predicates for static code analysis
description:
* The [knowledge base](https://en.wikipedia.org/wiki/Knowledge_representation_and_reasoning) ( kb )
aims to be a data structure able to:
* represent /multiple/ facts about the source code repo
* from /various/ programming languages
* each fact can be translated to a [Prolog](https://en.wikipedia.org/wiki/Prolog) fact
* facts can be combined to create [predicates](https://en.wikipedia.org/wiki/Predicate_%28logic%29)
* predictaes can be combined to formulate /security queries/
* [Prolog](https://en.wikipedia.org/wiki/Prolog) facts describe relations between:
* code locations
* const strings
* const integers
* [Prolog](https://en.wikipedia.org/wiki/Prolog) facts can be /combined/:
* create /expressive/ queries from /simple/ facts
* [conjunction](https://en.wikipedia.org/wiki/Logical_conjunction)
* [disjunction](https://en.wikipedia.org/wiki/Logical_disjunction)
* [negation](https://en.wikipedia.org/wiki/Negation)
* [Prolog](https://en.wikipedia.org/wiki/Prolog) queries are /easy/ to write:
* you /don't/ have to be a Prolog expert
* copy-paste the basic facts to /any/ [LLM](https://en.wikipedia.org/wiki/Large_language_model)
* explain in plain English your query's purpose
* et voilà !
version: 2.1.0
license: GPL-3.0-only
license-file: LICENSE
author: OrenGitHub
maintainer: Oren Ish Shalom
copyright: (c) 2025 Oren Ish Shalom
homepage: https://github.com/OrenGitHub/dhscanner
stability: experimental
build-type: Simple
common ghc_options
ghc-options: -Wall -Werror=incomplete-patterns -O2
library
import:
ghc_options
exposed-modules:
Kbgen
build-depends:
aeson >= 2.3 && < 2.4,
attoparsec >= 0.14 && < 0.15,
filepath >= 1.4 && < 1.6,
base >= 4.22 && < 4.23,
containers >= 0.8 && < 0.9,
text >= 2.0 && < 2.2,
dhscanner-ast >= 1.3,
dhscanner-bitcode >= 2.1
hs-source-dirs:
src
default-language:
GHC2024
test-suite restoreloc
import:
ghc_options
type:
exitcode-stdio-1.0
hs-source-dirs:
test
main-is:
Test.hs
other-modules:
SmokeTests
build-depends:
base,
dhscanner-kbgen,
dhscanner-ast,
hspec,
QuickCheck
default-language:
GHC2024