1 / 8

Debugging C with Erlang

Debugging C with Erlang. John Hughes Quviq AB/Chalmers University. Testing gdsl_list_delete. prop_list_delete () -> ?FORALL( L,non_empty (list( int ()), ?FORALL( X,elements (L), equals ( from_gdsl_list ( gdsl_list_delete ( X,to_gdsl_list (L))), lists:delete (X,L) )).

liora
Download Presentation

Debugging C with Erlang

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Debugging C with Erlang John Hughes Quviq AB/Chalmers University

  2. Testing gdsl_list_delete prop_list_delete() -> ?FORALL(L,non_empty(list(int()), ?FORALL(X,elements(L), equals(from_gdsl_list( gdsl_list_delete(X,to_gdsl_list(L))), lists:delete(X,L) )). prop_list_delete() -> ?FORALL(L,non_empty(list(int()), ?FORALL(X,elements(L), begin New = from_gdsl_list( gdsl_list_delete(X,to_gdsl_list(L))), New == lists:delete(X,L) orelse New == reverse(lists:delete(X,reverse(L))) end)). reverse(lists:delete(X,reverse(L))) Failed! [0,10,0,10] 10 [0,10,0] /= [0,0,10] Failed! [6,0,6] 6 [0,6] /= [6,0]

  3. Testing the link to C • For a randomtype T, generate • …and test identity(x)==x T identity(T x) { return x; } struct s {int a; complexfloat b;}

  4. GCC Bugzilla Bug 39678 • Summary: ”complex type isn't passed correctly” • Reported: 7 April 2009 • Our counterexample found: 9 April • Patch posted: 9 April • 818 lines of comments in Bugzilla • Once the bug was simplified, a patch was quick to write

  5. Want to try? quviq-licencer.com/promotion.html

More Related