From fd32bcb30814c005c5decb964c5ee18939bf0cc7 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Thu, 20 Feb 2014 21:06:10 +0900 Subject: [PATCH] Fix PULSE model to accomodate API change from previous commit. Now 1+ trim & fill transitions are collapsed to a single 'w_t+' atom. The atom name is a bit odd; think about regexps and it hopefully makes sense. --- prototype/corfurl/test/corfurl_pulse.erl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/prototype/corfurl/test/corfurl_pulse.erl b/prototype/corfurl/test/corfurl_pulse.erl index 33b0308..f835b67 100644 --- a/prototype/corfurl/test/corfurl_pulse.erl +++ b/prototype/corfurl/test/corfurl_pulse.erl @@ -449,18 +449,19 @@ check_trace(Trace0, _Cmds, _Seed) -> %% following four (4) acceptable transition orderings. {_, _, [{transitions, FinalTtns}]} = lists:last( eqc_temporal:all_future(TransitionsR)), + FinaTtns_filtered = filter_transition_trimfill_suffixes(FinalTtns), InvalidTransitions = orddict:fold( fun(_LPN, [w_0], Acc) -> Acc; (_LPN, [w_0,w_1], Acc) -> Acc; - (_LPN, [w_0,w_ft], Acc) -> + (_LPN, [w_0,'w_t+'], Acc) -> Acc; - (_LPN, [w_0,w_1,w_tt], Acc) -> + (_LPN, [w_0,w_1,'w_t+'], Acc) -> Acc; (LPN, BadTtns, Acc) -> [{LPN, BadTtns}|Acc] - end, [], FinalTtns), + end, [], FinaTtns_filtered), ?WHENFAIL(begin ?QC_FMT("*ModsReads: ~p\n", [eqc_temporal:unions([Mods,Reads])]), @@ -600,6 +601,23 @@ filter_relation_facts(FilterFun, R) -> [{TS1, TS2, lists:filter(FilterFun, Facts)} || {TS1, TS2, Facts} <- R]. %% {TS1, TS2, Facts} <- Reads, Fact <- Facts, BadFilter(Fact)], +filter_transition_trimfill_suffixes(Ttns) -> + [{X, filter_1_transition_list(L)} || {X, L} <- Ttns]. + +filter_1_transition_list([]) -> + []; +filter_1_transition_list(Old) -> + New = lists:reverse(lists:dropwhile(fun(w_tt) -> true; + (w_ft) -> true; + (_) -> false + end, lists:reverse(Old))), + Suffix = case lists:last(Old) of + w_ft -> ['w_t+']; + w_tt -> ['w_t+']; + _ -> [] + end, + New ++ Suffix. + log_make_call(Tag) -> log_make_call(self(), Tag).