for (s2,o2) in S:
				if pomdp.inv_states[s2] in pomdp.transitionFunction[(pomdp.inv_states[s1],pomdp.inv_actions[a])] and pomdp.inv_observations[o2] in pomdp.observationFunction[pomdp.inv_states[s2]]:
					if ((s1,o1),a) not in T:
						T[((s1,o1),a)] = dict()
					T[((s1,o1),a)][(s2,o2)] = pomdp.transitionFunction[(pomdp.inv_states[s1],pomdp.inv_actions[a])][pomdp.inv_states[s2]] * pomdp.observationFunction[pomdp.inv_states[s2]][pomdp.inv_observations[o2]]
		print 'S:',S,'\nA:',pomdp.actions.values(),'\nT:',T

		MarkovDecisionProcess.__init__(self,S,pomdp.actions.values(),T)

# >>> main test

if __name__ == '__main__':
	pomdp = cs.tigerPomdp()
	print pomdp
	prior = Distribution(set(pomdp.states.keys()),lambda el,dom: Distribution.restrictedUniformPdf(el,dom,{pomdp.inv_states['tl'],pomdp.inv_states['tr']}))
	# generate explicit MDP
	emdp = ExplicitMarkovDecisionProcess(pomdp,prior)
	print emdp
	# export to DOT
	e2d.export2dot(emdp,'emdp','emdp.dot', [], [], [],[])

# >>> authorship information

__author__ = "Marco Tinacci"
__copyright__ = "Copyright 2016"
__credits__ = ["Marco Tinacci"]
__license__ = "ASF"
__version__ = "2.0"
__maintainer__ = "Marco Tinacci"
__email__ = "*****@*****.**"
__status__ = "Production"
	e2p.mdp2lab(bmdp,bmdp.inv_states[prior],'test.lab')

	# compute initial, accepting and refusing states
	accept = []
	refuse = []
	for k,v in bmdp.states.iteritems():
		if pomdp.inv_states['win'] in v.distr:
			if v.distr[pomdp.inv_states['win']] > 0.85:
				accept.append(k)
		if pomdp.inv_states['lose'] in v.distr:
			if v.distr[pomdp.inv_states['lose']] > 0.85:
				refuse.append(k)

	# export to DOT
	e2d.export2dot(
		bmdp,'bmdp','test.dot', refuse, accept, 
		[bmdp.inv_states[prior]],
		map(lambda s: bmdp.inv_states[s],bmdp.fringe))
	# model checking
	mc.checkPCTLonMDP('test','filter(print,Pmin=? [ true U<=3 (' + \
		reduce(lambda y,z: y+'|'+z , \
			map(lambda x : 'index='+str(x),accept)) \
		+ ') ], true)')

# >>> authorship information

__author__ = "Marco Tinacci"
__copyright__ = "Copyright 2016"
__credits__ = ["Marco Tinacci"]
__license__ = "ASF"
__version__ = "2.0"
__maintainer__ = "Marco Tinacci"