def _conclusion(self, state, lhs_truth_value, rhs_truth_value, truth_value): """ Return the conclusion motivation the truth value of this formula :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :param truth_value: the truth value of this formula :type truth_value: bool :return: String with the motivation :rtype: String """ if (truth_value): return '{models} holds since {condition}.'.format( models=models(state, self, '$'), condition=self._truth_condition(state)) else: conclusion = Template('$models does not hold since $reason.') if not lhs_truth_value: reason = '{condition} does not hold'.format( condition=models(state, self.lhs, '$')) if not rhs_truth_value: reason = '{condition} does not hold'.format( condition=models(state, self.rhs, '$')) return conclusion.substitute(reason=reason, models=models(state, self, '$'))
def _conclusion(self, state, truth_value): if truth_value: return '{models} holds since {condition}.'.format( models=models(state, self, '$'), condition=self._truth_condition(state, int(truth_value))) else: return '{models} does not hold since {condition}.'.format( models=models(state, self, '$'), condition=self._truth_condition(state, int(truth_value)))
def _truth_condition(self, state): """ Return the condition under which this formula is true as a string. :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :return: String with the truth condition :rtype: String """ return '{lhs_models} and {rhs_models}'.format( lhs_models=models(state, self.lhs, '$'), rhs_models=models(state, self.rhs, '$'), )
def _conclusion(self, state, truth_value): """ Return the conclusion motivation the truth value of this formula :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :param truth_value: the truth value of this formula :type truth_value: bool :return: String with the motivation :rtype: String """ if (truth_value): return '{models} holds since {condition} does not hold.'.format( models=models(state, self, '$'), condition=models(state, self.lhs, '$')) else: return '{models} does not hold since {condition} holds.'.format( models=models(state, self, '$'), condition=models(state, self.lhs, '$'))
def _truth_condition(self, state): """ Return the condition under which this formula is true as a string. :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :return: String with the truth condition :rtype: String """ return '{lhs_models} for all $t$ with ${state} \longrightarrow t$'.format( lhs_models=models('t', self.lhs, '$'), state=state.name)
def _truth_condition(self, state, states=None): """ Return the condition under which this formula is true as a string. :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :return: String with the truth condition :rtype: String """ return '{lhs_models} for all $t$ with $({state}, t) \\in R_{{{agent}}}$'.format( lhs_models=models('t', self.lhs, '$'), agent=self.agent, state=state.name)
def _truth_condition(self, state): """ Return the condition under which this formula is true as a string. :param state: the state in which the formula should be evaluated. :type state: modelchecker.models.state :return: String with the truth condition :rtype: String """ return '{lhs_models} for all $t$ such that $({state}, t) \in {set}$'.format( lhs_models=models('t', self.lhs, '$'), state=state.name, set=self._agents_as_string(agents=list(state.model.agents), operator='\cap'))
def _condition(self, state): return '{models} iff {condition}.'.format( models=models(state, self, '$'), condition=self._truth_condition(state, 1))