[erlang-questions] PropEr statem: what does Res::term in next_state/3 mean?

Motiejus Jakštys <>
Wed May 30 23:34:22 CEST 2012

Hi, PropEr team,

sorry for writing you (again) on holiday time. ;)

I was reading about proper_statem, and could not understand one thing.
>From PropEr tutorial[1]:
next_state(S, V, {call,_,create_account,[_Name]}) ->
    S#state{users = [V|S#state.users]};

<some text about the callback...> Instead, next_state/3 should return:

S#state{users = [{call,erlang,hd,[V]}|S#state.users]}

Two things are unclear:
1. What is V after all?
2. How can I return abstract code in *my own state*? I.e. does PropEr
do some magic to look at my state and call the appropriate commands?

I read the edoc[2] too, but still it didn't make it clearer.

[1]: http://proper.softlab.ntua.gr/Tutorials/PropEr_testing_of_generic_servers.html
[2]: file:///home/motiejus/code/erlmpc/deps/proper/doc/index.html

I would be very glad if you could shed some light on this.

Thanks a lot,
Motiejus Jakštys

More information about the erlang-questions mailing list