Code Monkey home page Code Monkey logo

safety's Introduction

safety

a tool to translate co-safety linear temporal logic formulas into finite automata

still in the beginning stages!

written by Matt Maly

safety's People

Contributors

mattmaly avatar

Watchers

 avatar

Forkers

autumnday

safety's Issues

Memory usage violations

See the following valgrind output excerpts (for a run over input & | F p F q F r):

==7006== Use of uninitialised value of size 4
==7006== at 0x485BB58: ??? (in /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so)
==7006== by 0x20377: std::char_traits::copy(char*, char const*, unsigned int) (char_traits.h:409)
==7006== by 0x2107F: std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_S_copy(char*, char const*, unsigned int) (basic_string.h:351)
==7006== by 0x209EF: std::__cxx11::basic_string<char, std::char_traits, std::allocator >::operator=(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&&) (basic_string.h:722)
==7006== by 0x1FF63: operator<<(std::ostream&, Formula const*) (formula.cpp:63)
==7006== by 0x20013: std::less<Formula*>::operator()(Formula* const&, Formula* const&) const (formula.cpp:73)
==7006== by 0x29EA3: std::_Rb_tree<Formula*, Formula*, std::_Identity<Formula*>, std::less<Formula*>, std::allocator<Formula*> >::_M_lower_bound(std::_Rb_tree_node<Formula*>, std::_Rb_tree_node_base, Formula* const&) (stl_tree.h:1935)
==7006== by 0x29B6B: std::_Rb_tree<Formula*, Formula*, std::_Identity<Formula*>, std::less<Formula*>, std::allocator<Formula*> >::find(Formula* const&) (stl_tree.h:2553)
==7006== by 0x2993B: std::set<Formula*, std::less<Formula*>, std::allocator<Formula*> >::find(Formula* const&) (stl_set.h:795)
==7006== by 0x2955B: CommutativeFormula::read(std::istream&) (commutativeformula.cpp:34)
==7006== by 0x1FB7B: Formula::parse(std::istream&) (formula.cpp:34)
==7006== by 0x29513: CommutativeFormula::read(std::istream&) (commutativeformula.cpp:31)

Update code to C++20 style

This'll make things significantly more readable while also serving as a refresher after an ~8 year absence.

Include option to hide dead states

Include a command-line option to control whether a dead state (the state corresponding to the formula false which loops on all worlds) is included in the automaton.

std::less<Formula*>::operator() does not respect commutativity

The function std::less<Formula*>::operator(Formula* const&, Formula* const&) orders Formula pointer values according to the ordering of their string representations.

Two commutative binary formulas will not be equal according to this ordering, if their subformulas are swapped. For example, The disjunction p | q will be considered less than q | p, when it should be equal.

One solution is to make BinaryFormula::write(std::ostream&) print the operands in alphabetical order for commutative binary formulas. Consider a subclass for commutative formulas to prevent duplicate code.

Add unit tests

Subject line says it -- project currently has zero testing!

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.