pet.cc: extract out get_value_decl