Giter Club home page Giter Club logo

pqueue's People

Contributors

jlouis avatar nycholas avatar okeuday avatar yamt 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

pqueue's Issues

proper dependency

Even though pqueue does not impose proper dependency, it will fail compiling pqueue_proper module. I'd rather not include proper into another library I'd like to use pqueue from... Is there any way to make pqueue_proper compilation conditional somehow?

Error in pqueue2

If I use PropEr to generate random sequences, the following one:

[{set,{var,1},{call,queue_srv,in,[-18]}},{set,{var,5},{call,queue_srv,in,[9]}},{set,{var,6},{call,queue_srv,in,[-10,-4]}},{set,{var,18},{call,queue_srv,in,[-29]}},{set,{var,22},{call,queue_srv,in,[11]}},{set,{var,26},{call,queue_srv,len,[]}}]

Fails. We basically "in" a lot of things... -18, 9, (-10 at prio -4), -29 and so on, followed by a call to len. This is the minimal test case, shrunk 12 times. The internal error is:

=ERROR REPORT==== 11-Nov-2011::16:27:08 ===
** Generic server queue_srv terminating 
** Last message in was len
** When Server state == {state,pqueue2,
                               {-4,
                                {0,empty,empty,queue,{"\v",[-29]}},
                                {0,empty,empty,queue,{"\t",[-18]}},
                                element,-10}}
** Reason for termination == 
** {function_clause,[{pqueue2,merge,
                              [{0,empty,empty,queue,{"\v",[-29]}},
                               {0,empty,empty,queue,{"\t",[-18]}}],
                              [{file,"src/pqueue2.erl"},{line,444}]},
                     {pqueue2,out,1,[{file,"src/pqueue2.erl"},{line,173}]},
                     {pqueue2,len,1,[{file,"src/pqueue2.erl"},{line,144}]},
                     {queue_srv,handle_call,3,
                                [{file,"src/queue_srv.erl"},{line,98}]},
                     {gen_server,handle_msg,5,
                                 [{file,"gen_server.erl"},{line,578}]},
                     {proc_lib,init_p_do_apply,3,[]}]}

pqueue error on emptiness.

The following trace constructs an error, this time in pqueue:

Shrinking .....(5 time(s))
[{set,{var,1},{call,queue_srv,in,[36,4]}},{set,{var,4},{call,queue_srv,out,[]}},{set,{var,6},{call,queue_srv,is_empty,[]}}]
History: [{{state,[]},ok},{{state,[{4,[36]}]},{value,36}},{{state,[]},false}]
State: {state,[]}
Result: {postcondition,false}

That is:

  • Insert an element 36 with priority 4.
  • Remove that element.
  • call pqueue:is_empty on the resulting queue.

This returns false - the queue is not empty. But if we try to out an element of the empty queue, we get told it is empty. There seem to be some problems with priorities.

Another error in pqueue2.

There is a problem with either my model or pqueue2:

Shrinking .......(7 time(s))
[{set,{var,1},{call,queue_srv,in,[-11]}},{set,{var,3},{call,queue_srv,in,[12,-13]}},{set,{var,5},{call,queue_srv,in,[-21]}},{set,{var,8},{call,queue_srv,in,[6]}},{set,{var,12},{call,queue_srv,to_list,[]}}]
History: [{{state,[]},ok},{{state,[{0,[-11]}]},ok},{{state,[{-13,[12]},{0,[-11]}]},ok},{{state,[{-13,[12]},{0,[-11,-21]}]},ok},{{state,[{-13,[12]},{0,[-11,-21,6]}]},[12,-21,6,-11]}]
State: {state,[{-13,[12]},{0,[-11,-21,6]}]}
Result: {postcondition,false}
false

The error manifests itself in the call to_list/1 where the order is different from what is expected. We have 12 at priority -13 and then -11, -21, 6 at priority 0. We expect the output to be [12, -11, -21, 6] but it is [12, -21, 6, -11].

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.