def non_contradiction_instance_2(person_list, place_list, n, vi_On_function=vi_On, not_vi_function=not_vi): """ T = {v(x, [P1,...,Pn])} new = not v(x*,Pi) or new = not v(x,P*) P* not in {P1,...,Pn} x* not in {x} ----------- 0 """ people = np.random.choice(person_list) places = get_n_different_items(place_list, n) sentence1 = vi_On_function(people, places) new_person = get_new_item([people], person_list) new_place = get_new_item(places, place_list) selected = np.random.choice(places) coin = np.random.choice([0, 1]) if coin == 0: sentence2 = not_vi_function(new_person, selected) else: sentence2 = not_vi_function(people, new_place) return sentence1, sentence2, 0
def non_contradiction_instance_1(person_list, place_list, n, vi_Sn_function=vi_Sn, not_vi_function=not_vi): """ T = {v([x1,...,xn], P)} new = not v(xi,P*) or new = not v(x*,P) P* not in {P} x* not in {x1, ..., xn} ----------- 0 """ people = get_n_different_items(person_list, n) place = np.random.choice(place_list) sentence1 = vi_Sn_function(people, place) new_person = get_new_item(people, person_list) new_place = get_new_item([place], place_list) selected = np.random.choice(people) coin = np.random.choice([0, 1]) if coin == 0: sentence2 = not_vi_function(selected, new_place) else: sentence2 = not_vi_function(new_person, place) return sentence1, sentence2, 0
def contradiction_instance_3(person_list, place_list, n, Rt_function=Rt, Rt_eq_function=Rt_eq, and_str="and"): """ T = {x > [x1, ....., xn], y >= x} new = xi > y ----------- 1 """ people = get_n_different_items(person_list, n + 1) new_person = get_new_item(people, person_list) chain = [] for i in range(n): chain.append(Rt_function(people[i], people[i + 1])) sentence1 = Rt_function(people[0], list2coordination(people[1:], and_str)) eq = [ Rt_eq_function(people[0], new_person), Rt_eq_function(new_person, people[0]) ] # noqa eq = np.random.choice(eq) sentence1 += " , " + eq selected = np.random.choice(people[1:]) sentence2 = Rt_function(selected, new_person) return sentence1, sentence2, 1
def non_contradiction_instance_1(person_list, place_list, n, vi_On_function=vi_On, not_vi_function=not_vi, Everyone_str="Everyone"): """ T = { every x v(x1,[P1, ..., Pn]} new = not v(xi,P*) ----------- 0 """ people = np.random.choice(person_list) places = get_n_different_items(place_list, n) sentence1 = vi_On_function(Everyone_str, places) new_place = get_new_item(places, place_list) sentence2 = not_vi_function(people, new_place) return sentence1, sentence2, 0
def non_contradiction_instance_2(person_list, place_list, n, vi_function=vi, not_vi_function=not_vi): """ T = {v(x1,P1), ..., v(xn,Pn)} new = not v(x*,Pi) ----------- 0 x* not in {x1, ..., xn} """ people = get_n_different_items(person_list, n) places = get_n_different_items(place_list, n) sentence1 = ", ".join([vi_function(x, y) for x, y in zip(people, places)]) id_ = np.random.choice(len(people)) new_person = get_new_item(people, person_list) sentence2 = not_vi_function(new_person, places[id_]) return sentence1, sentence2, 0
def contradiction_instance_2(person_list, place_list, n, Rt_function=Rt, Rt_eq_function=Rt_eq, and_str="and"): """ T = {x1 >= x2, x2 >= x3, ... , xn-1 >= xn xn > y} new = y > xi ----------- 1 """ people = get_n_different_items(person_list, n + 1) new_person = get_new_item(people, person_list) chain = [] for i in range(n): chain.append(Rt_eq_function(people[i], people[i + 1])) sentence1 = " , ".join(chain) sentence1 += " , " + Rt_function(people[-1], new_person) id_base = np.random.choice(range(n + 1)) sentence2 = Rt_function(new_person, people[id_base]) return sentence1, sentence2, 1