GithubHelp home page GithubHelp logo

flisboac / adl Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 753 KB

Abstract Domain Library, a C++ library implementing the octagon domain in CPU and GPU. (may add more abstract domains in the future!)

License: MIT License

Makefile 0.16% TeX 1.60% CMake 0.87% C++ 97.37%
abstract-domain adl gpu library octagon-domain static-analysis

adl's People

Contributors

flisboac avatar

Stargazers

 avatar

Watchers

 avatar  avatar

adl's Issues

.

So, github does not let me delete issues. Playing with the issues system in a final repository is out of question now. Lesson learned.

.

So, github does not let me delete issues. Playing with the issues system in a final repository is out of question now. Lesson learned.

adl: Create Module Unit `adl/util`

This module unit includes all of its inner modules in its main .hpp file. Also, an additional .cfg.hpp should be responsible for all preprocessor verifications, if any.

All of this module's types (e.g. namespace-level typedefs, classes, enums, structs, unions) must be forward-declared in the module's .fwd.hpp header. Inner artifacts (e.g. module, component) are prohibited to forward-declare types anywhere else.

File structure

  • $PROJECT_ROOT/
    • include/
      • adl/util.hpp
      • adl/util.fwd.hpp

Dependencies

adl/oct: Add insertion functions and constructors to `adl/oct/system:adl::oct::oct_system` for multiple constraints

Signature:

template <
    typename ValueType
    typename ValueTraits>
template <
    std::size_t ArraySize,
    typename ValueType_, 
    template VarType_,
    template = std::enable_if_t<
        std::is_convertible<ValueType, ValueType_>::value
        && common_var<VarType_>::is_oct_space>
oct_cons<ValueType, ValueTraits>::oct_cons(
    oct_cons<ValueType_, VarType_>  (&constraints)[ArraySize]
);

template <
    typename ValueType
    typename ValueTraits>
template <
    std::size_t ArraySize,
    typename ValueType_, 
    template VarType_,
    template = std::enable_if_t<
        std::is_convertible<ValueType, ValueType_>::value
        && common_var<VarType_>::is_oct_space>
std::size_t insert(oct_cons<ValueType_, VarType_> (&constraints)[ArraySize]);

template <
    typename ValueType
    typename ValueTraits>
template <typename IterType>
std::size_t insert(IterType begin, IterType end);

project: Basic infrastructure (Build system, dot files, etc)

Objectives

  • Create the project's main infrastructure (e.g. folders and file patterns).
  • Create the dotfiles.
  • Create the build system's initial infrastructure.
  • Ensure LICENSE reflects

Checklist

  • LICENSE
  • Doxyfile
  • README
  • CMake
  • .gitignore
  • .editorconfig

adl/oct: Create enum-value-related Component Units

Should contain enumerations and values that globally apply to the octagon domain module or to the project as a whole.


Dependencies

Checklist

  • Component Unit adl/error_code
  • Component Unit adl/oct/domain_space
  • Component Unit adl/oct/oper_kind
  • Component Unit adl/oct/dbm_layout

adl: Create Main Module Units for `adl`

The module unit adl includes all of the inner modules in the project. Every module unit has a main .hpp file. Also, an additional .cfg.hpp should be responsible for all preprocessor verifications, if any.

The following main sub-modules are contemplated in this first sprint:

  • Module Unit adl
  • Module Unit adl/oct
  • Module Unit adl/util
  • Module Unit adl/oct/dsl

All of the main sub-modules' types (e.g. namespace-level typedefs, classes, enums, structs, unions) must be forward-declared in the module's .fwd.hpp header. Inner artifacts (e.g. module, component) are prohibited to forward-declare types anywhere else.

File structure

  • $PROJECT_ROOT/
    • include
      • adl.hpp
      • adl.fwd.hpp
      • adl.cfg.hpp
      • adl/
        • oct/
          • dsl/
          • dsl.hpp
        • util/
        • oct.hpp
        • oct.fwd.hpp
        • util.hpp
        • util.fwd.hpp

Dependencies

adl/util: Create Component Unit `adl/timer`

A timer that will be used for operator timing measures.

The API still needs to be fleshed out, but in a nutshell, it will use std::chrono functionality to measure timings on various places of interest in the algorithms.' Imagine:

adl::util::timer_list timers;
for (...) { // suppose 5 iterations
    timer.start();
    // (processing, suppose 5th was fastest)
    timer.stop();
}
timers.size(); // 5
timers.fastest(); // an adl::util::timer_list::entry
timers.slowest(); // an adl::util::timer_list::entry
timers.fastest().index(); // 4 (starts at 0)
timers.min(); // an adl::util::timer_list::entry
timers.max(); // an adl::util::timer_list::entry
timers.fastest().duration(); // a std::duration
timers.sum(); // a std::duration
timers.average(); // a std::duration
timers[1].duration(); // a std::duration

Dependencies

adl: Create Module Unit `adl/oct`

This module unit includes all of its inner modules in its main .hpp file. Also, an additional .cfg.hpp should be responsible for all preprocessor verifications, if any.

All of this module's types (e.g. namespace-level typedefs, classes, enums, structs, unions) must be forward-declared in the module's .fwd.hpp header. Inner artifacts (e.g. module, component) are prohibited to forward-declare types anywhere else.

File structure

  • $PROJECT_ROOT/
    • include/
      • adl/oct.hpp
      • adl/oct.fwd.hpp

adl/oct: Create Module Unit `adl/oct/dsl`

This module unit includes all of its inner modules in its main .hpp file. Also, an additional .cfg.hpp should be responsible for all preprocessor verifications, if any.

This module implements an octagonal domain-exclusive DSL. This DSL includes user-literals and operators that can be used by the user to define constraints, systems and problems in the octagonal domain. Each of the parent's class that participates in the DSL should have a specific include header file.

Because the DSL does not declare types (as of now), there will be no .fwd.hpp header file.

File structure

  • $PROJECT_ROOT/
    • include/adl/oct
      • dsl.hpp

adl/oct, adl: Correct function implementations (e.g. adl_IMPL, inline, etc)

Guidelines for implementations:

  • Is it a template class/struct specialization? Use adl_*CLASS
  • Is it a non-template class/struct? Use adl_*CLASS
  • Is it a non-constexpr non-type-member (global or namespace) function declaration? Use adl_*API
  • Is the full path to a non-constexpr function definition non-templated or specialized? Use adl_IMPL
  • Does the full path to a non-constexpr function definition contain any non-specialized template parameter? Use inline.

Examples for template types:

// Declaration
template<typename T> struct my_type;

// Definition
template<typename T> struct my_type {
    void function();
    template <typename F> void tpl_function(F);
    void inline_function() {}
};

// Member function definition
template <typename T>
inline void my_type<T>::function() {}

// Template member function definition
template <typename T>
template <typename F>
inline void my_type<T>::tpl_function(F) {}

// Specialization declaration (if any)
template<> struct adl_CLASS my_type<int> {
    void function();
    template <typename F> void tpl_function(F);
    void inline_function() {}
};

// Specialization: Member function definition
template <>
adl_IMPL void my_type<int>::function() {}

// Specialization: Template member function definition
template <>
template <typename F>
inline void my_type<int>::tpl_function(F) {}

// Specialization: Template member function specialized definition
template <>
template <>
adl_IMPL void my_type<int>::tpl_function<int>(F) {}

Examples for non-template types:

// Declaration
struct my_type;

// Definition
struct my_type {
    void function();
    template <typename F> void tpl_function(F);
    void inline_function() {}
};

// Specialization: Member function definition
adl_IMPL void my_type::function() {}

// Specialization: Template member function definition
inline void my_type::tpl_function(F) {}

Examples for functions:

// Declaration
adl_API void function();

template <typename F> void tpl_function(F);
template <> adl_API void tpl_function<int>(F);

adl_API void inline_function() {}


// Definition
adl_IMPL void function() {}

template <typename F> 
inline void tpl_function(F) {}

template <> adl_IMPL void tpl_function<int>(F) {}

The rest follows standard convention (constexpr at declaration and definition, etc).

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.