├── .gitignore ├── examples ├── irt-model.jbl ├── irt-item-coef.jbl ├── test_scores.py ├── test_lsat6_2pl.py └── lsat6.dat ├── test ├── resource │ ├── demo-irt-model.jbl │ └── demo-irt-item-coef.jbl └── irt_3pl_demo.py ├── README.md ├── src ├── irt_simulator.py └── irt.py └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | __pycache__ -------------------------------------------------------------------------------- /examples/irt-model.jbl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/irt-rpy/master/examples/irt-model.jbl -------------------------------------------------------------------------------- /examples/irt-item-coef.jbl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/irt-rpy/master/examples/irt-item-coef.jbl -------------------------------------------------------------------------------- /test/resource/demo-irt-model.jbl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/irt-rpy/master/test/resource/demo-irt-model.jbl -------------------------------------------------------------------------------- /test/resource/demo-irt-item-coef.jbl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/irt-rpy/master/test/resource/demo-irt-item-coef.jbl -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # irt-rpy 2 | 3 | 基于Item Response Theory(irt)项目反应理论,封装R语言的IRT库进行试题(item)参数估计、能力(theta)参数估计。 4 | 5 | # 简介 6 | 7 | + 支持根据专家经验直接设置试题参数创建IRT模型 8 | + 支持基于答题记录(response pattern)进行试题、能力参数联合估计 9 | + 单维IRT模型支持Rasch, 2PL, 3PL, 4PL等模型 10 | + 已知试题参数,估计能力参数 11 | + 已知试题参数,模拟答题记录 12 | 13 | # 功能 14 | 15 | # 使用 16 | 17 | ## 依赖 18 | 19 | + R语言环境(>=3.6.3) 20 | + R包mirt 21 | + R包mirtCAT 22 | 23 | # 致谢 24 | 25 | ## mirt 26 | 27 | https://github.com/philchalmers/mirt 28 | 29 | ## mirtCAT 30 | 31 | https://github.com/philchalmers/mirtCAT -------------------------------------------------------------------------------- /test/irt_3pl_demo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/4/16 15:42 4 | # @Author : hebin 5 | # @File : irt_3pl_demo.py 6 | import sys 7 | 8 | import json 9 | import joblib 10 | import numpy as np 11 | import pandas as pd 12 | 13 | sys.path.append("../") 14 | 15 | from src.irt import IRTModel 16 | 17 | 18 | def irt_3pl_demo(): 19 | # 模拟答题矩阵 20 | datas = pd.DataFrame(np.random.randint(0, 2, (1000, 10))) 21 | print("data shape={}".format(datas.shape)) 22 | irt = IRTModel(10, model=None, model_save_path="./resource/demo-irt-model.jbl", 23 | item_para_save_path="./resource/demo-irt-item-coef.jbl") 24 | irt.fit(datas, dims=1, itemtype="3PL", method="EM") 25 | irt.calc_coef(IRTpars="F") 26 | irt.extract_items_match_thetas() 27 | 28 | 29 | if __name__ == "__main__": 30 | irt_3pl_demo() 31 | -------------------------------------------------------------------------------- /examples/test_scores.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/4/16 16:01 4 | # @Author : hebin 5 | # @File : test_scores.py 6 | import sys 7 | 8 | import numpy as np 9 | import pandas as pd 10 | 11 | sys.path.append("../") 12 | 13 | from src.irt import IRTModel 14 | 15 | 16 | def test_scores(): 17 | datas = pd.DataFrame({"item_0": [0, 1, 1, 0, 1, 0, 1], 18 | "item_1": [0, 0, 1, 1, 1, 0, 1], 19 | "item_2": [0, 0, 1, 1, 1, 0, 1], 20 | "item_3": [0, 1, 1, 0, 1, 0, 1], 21 | "item_4": [0, 1, 1, 0, 1, 0, 1], 22 | }) 23 | print("data shape={}".format(datas.shape)) 24 | irt = IRTModel(5, model=None, model_save_path="./irt-model.jbl", 25 | item_para_save_path="./irt-item-coef.jbl") 26 | irt.fit(datas, dims=1, itemtype="Rasch", method="EM") 27 | irt.calc_scores("MAP", datas.values, True) 28 | 29 | response_pattern = np.array([np.nan, np.nan, np.nan, np.nan, 1]) 30 | irt.calc_scores("MAP", response_pattern, True) 31 | 32 | response_pattern = np.array([np.nan, np.nan, np.nan, np.nan, 1]) 33 | irt.calc_scores("MAP", response_pattern, True) 34 | 35 | response_pattern = np.array([np.nan, np.nan, np.nan, 0, 1]) 36 | irt.calc_scores("MAP", response_pattern, True) 37 | 38 | response_pattern = np.array([np.nan, np.nan, 0, 0, 1]) 39 | irt.calc_scores("MAP", response_pattern, True) 40 | 41 | response_pattern = np.array([np.nan, 0, 0, 0, 1]) 42 | irt.calc_scores("MAP", response_pattern, True) 43 | 44 | response_pattern = np.array([[np.nan, 0, 0, 0, 1], [0, 0, 0, 0, 1]]) 45 | irt.calc_scores("MAP", response_pattern, True) 46 | 47 | 48 | if __name__ == "__main__": 49 | test_scores() 50 | -------------------------------------------------------------------------------- /examples/test_lsat6_2pl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/4/16 15:45 4 | # @Author : hebin 5 | # @File : test_lsat6_2pl.py 6 | import sys 7 | 8 | import numpy as np 9 | import pandas as pd 10 | 11 | sys.path.append("../") 12 | 13 | from src.irt import IRTModel 14 | 15 | 16 | def test_lsat6(): 17 | # A data frame with the responses of 1000 individuals to 5 questions 18 | data = open("../examples/lsat6.dat", "r", encoding="utf-8").readlines() 19 | datas = pd.DataFrame() 20 | for it, i in enumerate(data): 21 | cols = i.strip().split("\t") 22 | cols = [int(i) for i in cols] 23 | datas = datas.append(pd.DataFrame([pd.Series(cols).add_prefix("item_")]), ignore_index=True) 24 | print("data shape={}".format(datas.shape)) 25 | irt = IRTModel(5, model=None, model_save_path="./irt-model.jbl", item_para_save_path="./irt-item-coef.jbl") 26 | # 试题、能力参数联合估计 27 | irt.fit(datas, dims=1, itemtype="2PL", method="EM") 28 | irt.calc_coef(IRTpars="F") 29 | # 能力参数估计 30 | scores = irt.calc_scores() 31 | print("scores={}".format(scores)) 32 | for i, p in enumerate(irt.item_paras): 33 | print("item {} paras: {}".format(i, p)) 34 | 35 | 36 | def test_lsat6_na(): 37 | # A data frame with the responses of 1000 individuals to 5 questions 38 | data = open("../examples/lsat6.dat", "r", encoding="utf-8").readlines() 39 | datas = pd.DataFrame() 40 | for it, i in enumerate(data): 41 | cols = i.strip().split("\t") 42 | cols = [int(i) for i in cols] 43 | if it == 0: 44 | # 答题数据缺失时,用np.nan填充 45 | cols = [0, 1, np.nan, 1, 1] 46 | datas = datas.append(pd.DataFrame([pd.Series(cols).add_prefix("item_")]), ignore_index=True) 47 | print("data shape={}".format(datas.shape)) 48 | 49 | # 答题数据缺失时 50 | datas.iloc[0]["item_1"] = np.nan 51 | datas.iloc[3]["item_2"] = np.nan 52 | 53 | irt = IRTModel(5, model=None, model_save_path="./irt-model.jbl", item_para_save_path="./irt-item-coef.jbl") 54 | # 试题、能力参数联合估计 55 | irt.fit(datas, dims=1, itemtype="2PL", method="EM") 56 | irt.calc_coef(IRTpars="F") 57 | for i, p in enumerate(irt.item_paras): 58 | print("item {} paras: {}".format(i, p)) 59 | 60 | 61 | if __name__ == "__main__": 62 | test_lsat6() 63 | test_lsat6_na() 64 | -------------------------------------------------------------------------------- /src/irt_simulator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/4/12 19:26 4 | # @Author : hebin 5 | # @File : irt_simulator.py 6 | import joblib 7 | import json 8 | import numpy as np 9 | 10 | from irt import IRTModel 11 | 12 | 13 | class IRTSimulator(object): 14 | """ 15 | 利用IRT理论进行自适应学习题目推荐效果评估. 16 | """ 17 | 18 | def __init__(self, item_num, model_save_path, item_index_path, item_para_save_path): 19 | model = joblib.load(open(model_save_path, "rb")) 20 | self.model = IRTModel(item_num, model, model_save_path=model_save_path, item_para_save_path=item_para_save_path) 21 | self.item_index = joblib.load(open(item_index_path, "rb")) 22 | self.item_responses = [np.nan for _ in range(item_num)] 23 | self.problem_id2item_id = {str(v): k for k, v in enumerate(self.item_index)} 24 | print("IRT simulator loaded (item num={})".format(len(self.problem_id2item_id))) 25 | 26 | def get_response_patterns(self, problem_seq, result_seq): 27 | value = self.item_responses[:] 28 | for p, a in zip(problem_seq, result_seq): 29 | if str(p) in self.problem_id2item_id: 30 | value[self.problem_id2item_id[str(p)]] = a 31 | return value 32 | 33 | def evaluate_theta(self, responses, method="EAP"): 34 | if len([i for i in responses if not np.isnan(i)]) == 0: 35 | return -1, -1, 0 36 | try: 37 | status = 0 38 | assert len(responses) == len(self.item_responses) 39 | theta = self.model.calc_scores(method, np.array(responses))[0][0] 40 | # 能力值归一化 41 | score = self.model.normalization(theta) 42 | except Exception: 43 | status = -1 44 | theta = -1 45 | score = 0 46 | return status, theta, score 47 | 48 | def get_item_prob_answers(self, theta, cur_problem_seq): 49 | answers = [] 50 | for i in cur_problem_seq: 51 | if str(i) in self.problem_id2item_id: 52 | # 基于当前能力估计答题概率 53 | item_id = self.problem_id2item_id[str(i)] 54 | ans = self.model.get_item_expected_value(item_id, theta) 55 | ans = 0 if ans < 0.5 else 1 56 | answers.append(ans) 57 | else: 58 | answers.append(0) 59 | return answers 60 | 61 | def evaluate_ep(self, history_problem_seq, history_result_seq, recommend_topic_seq, method="predict"): 62 | try: 63 | history_response_patterns = self.get_response_patterns(history_problem_seq, history_result_seq) 64 | # 估计历史答题记录的能力 65 | status, theta, Es = self.evaluate_theta(history_response_patterns) 66 | if status < 0: 67 | return status, 0 68 | cur_problem_seq = history_problem_seq + recommend_topic_seq 69 | if method == "predict": 70 | # 基于能力估计预测答题正确的概率,生成答题结果 71 | answers = self.get_item_prob_answers(theta, recommend_topic_seq) 72 | else: 73 | # 构造老师答题结果 74 | answers = [1 for i in recommend_topic_seq] 75 | cur_result_seq = history_result_seq + answers 76 | cur_response_patterns = self.get_response_patterns(cur_problem_seq, cur_result_seq) 77 | status, cur_theta, Ee = self.evaluate_theta(cur_response_patterns) 78 | if status < 0: 79 | return status, 0 80 | Ep = (Ee - Es) / (1 - Es) 81 | except Exception: 82 | status = -1 83 | Ep = -1 84 | return status, Ep 85 | -------------------------------------------------------------------------------- /src/irt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/2/24 15:11 4 | # @Author : hebin 5 | # @File : irt.py 6 | 7 | 8 | import joblib 9 | import time 10 | import numpy as np 11 | 12 | # python call R 13 | import rpy2.robjects as ro 14 | from rpy2.robjects.packages import importr 15 | from rpy2.robjects import pandas2ri, numpy2ri 16 | 17 | # activate 18 | pandas2ri.activate() 19 | numpy2ri.activate() 20 | 21 | # import package 22 | mirt = importr('mirt') 23 | mirtCAT = importr('mirtCAT') 24 | 25 | 26 | class IRTModel(object): 27 | 28 | def __init__(self, item_num, model=None, model_save_path="./resource/irt-model.jbl", 29 | item_para_save_path="./resource/irt-item-coef.jbl"): 30 | """ 31 | IRT类初始化. 32 | 33 | Args: 34 | item_num: int, 题库中试题数量 35 | model: int, 已估计完成的irt模型文件,使用joblib存储 36 | model_save_path: string, 估计模型后模型保存路径 37 | item_para_save_path: string, 估计模型后试题参数保存路径 38 | 39 | """ 40 | 41 | self.student_num = 0 42 | self.item_num = item_num 43 | # list of numpy.array 44 | self.item_paras = [] 45 | self.item_obj = [object] * item_num 46 | # 当前试题匹配的能力theta 47 | self.item_thetas = [] 48 | self.model_save_path = model_save_path 49 | self.item_para_save_path = item_para_save_path 50 | 51 | # 加载已完成参数估计的模型对象文件 52 | self.model = model 53 | if model is not None: 54 | # 已估计的模型参数重计算 55 | self.calc_coef() 56 | # 计算每道试题对应的最佳匹配能力值 57 | self.extract_items_match_thetas() 58 | 59 | def define_irt_model(self, data, itemtype="3PL", save=True): 60 | """ 61 | 根据人工经验设置irt参数(如3PL: a, d, g, u)来定义模型. 62 | 63 | Args: 64 | data: np.array, 已设置好的试题参数, 65 | item_1: a1, d, g, u 66 | item_2: a1, d, g, u 67 | ... 68 | itemtype: string, 模型类型, "3PL", "2PL" 69 | 70 | Returns: 71 | 72 | """ 73 | data = np.array(data) 74 | # 更新试题参数 75 | self.item_num = data.shape[0] 76 | # 需要对R变量赋值 77 | ro.r.assign("pars", numpy2ri.py2rpy(data)) 78 | self.model = ro.r("generate.mirt_object(pars, '%s')" % itemtype) 79 | if save: 80 | with open(self.model_save_path, "wb") as f: 81 | joblib.dump(self.model, f) 82 | print("{} model saved to {}".format(itemtype, self.model_save_path)) 83 | return self.model 84 | 85 | def simdata(self, num): 86 | """ 87 | 模拟答题数据response patterns. 88 | 89 | Args: 90 | num: int, 返回数据个数 91 | 92 | Returns: 93 | 94 | """ 95 | # 需要对R变量赋值 96 | ro.r.assign("model", self.model) 97 | # 运行R函数 98 | data = ro.r("simdata(model=model, N=%d)" % num) 99 | return data 100 | 101 | def fit(self, data, dims=1, itemtype="3PL", method="EM", save=True): 102 | """ 103 | 基于答题/响应数据进行IRT模型参数估计. 104 | 105 | Args: 106 | data: pandas.DataFrame, 行是学生,列是题目(item0, item1, item2, ...) 107 | dims: mirt.model模型对象或数字指示维度大小, 单维项目反映理论设置为1 108 | itemtype: 项目参数类型,包括'Rasch', '2PL', '3PL', '3PLu', '4PL'. 109 | Form must be: (discrimination, difficulty, lower-bound, upper-bound) 110 | method: "EM", "MCEM" 111 | save: boolean, 是否保存模型对象文件 112 | 113 | Returns: 114 | 115 | """ 116 | t_start = time.time() 117 | self.student_num, self.item_num = data.shape 118 | # pandas.DataFrame to R objects 119 | data = pandas2ri.py2rpy(data) 120 | # 需要对R变量赋值 121 | ro.r.assign("data", data) 122 | # 运行R函数 123 | self.model = ro.r( 124 | "mirt(data,model=%d,itemtype='%s',method='%s',removeEmptyRows=TRUE)" % (dims, itemtype, method)) 125 | print("{} model fit completed, elapsed time={}".format(itemtype, time.time() - t_start)) 126 | if save: 127 | with open(self.model_save_path, "wb") as f: 128 | joblib.dump(self.model, f) 129 | print("IRT model saved to {}".format(self.model_save_path)) 130 | 131 | def calc_coef(self, IRTpars="F", save=True): 132 | """ 133 | 计算已拟合模型的项目item参数. 134 | 135 | Args: 136 | IRTpars: string, 是否转换为原始IRT参数 137 | save: boolean, 是否保存参数文件 138 | 139 | Returns: 140 | 141 | """ 142 | t_start = time.time() 143 | ro.r.assign("model", self.model) 144 | coef = ro.r("paras <- coef(model, as.data.frame=F, IRTpars=%s)" % IRTpars) 145 | coef = coef[:self.item_num] 146 | self.item_paras = [i[0] for i in coef] 147 | self.item_obj = [object] * self.item_num 148 | if save: 149 | with open(self.item_para_save_path, "wb") as f: 150 | joblib.dump(self.item_paras, f) 151 | # print("coef calculated completed. time={}".format(time.time() - t_start)) 152 | return self.item_paras 153 | 154 | def normalization(self, x): 155 | """ 156 | 难度值b归一化. 157 | y = exp(x)/(1+exp(x)) 158 | x = log(y/(1-y)) 159 | 160 | Args: 161 | x: 162 | 163 | Returns: 164 | 165 | """ 166 | return np.exp(x) / (np.exp(x) + 1) 167 | 168 | def calc_scores(self, method="EAP", response_pattern=None, verbose=False): 169 | """ 170 | 已知试题参数,估计被试者的能力分数. 171 | 172 | Args: 173 | method: string, "EAP", "MAP", "ML" 174 | response_pattern: numpy, 答题结果,注意shape == item_nun, 如果为None, 则返回原模型的估计能力值 175 | 176 | Returns: 177 | scores: list of [f1 score, standard error] 178 | 179 | """ 180 | t_start = time.time() 181 | ro.r.assign("model", self.model) 182 | if response_pattern is not None: 183 | # print(response_pattern) 184 | rp = numpy2ri.py2rpy(response_pattern) 185 | ro.r.assign("response_pattern", rp) 186 | scores = ro.r( 187 | "fscores(model, method='%s', full.scores=TRUE, full.scores.SE=TRUE, response.pattern=response_pattern, append_response.pattern=FALSE)" % method) 188 | else: 189 | scores = ro.r( 190 | "fscores(model, method='%s', full.scores=TRUE, full.scores.SE=TRUE)" % method) 191 | if verbose: 192 | print("{} ability estimate {} completed, time={}, theta={}".format(method, len(scores.tolist()), 193 | time.time() - t_start, scores)) 194 | return scores 195 | 196 | def extract_items_match_thetas(self): 197 | """ 198 | 提取试题匹配的能力值. 199 | """ 200 | item_thetas = [] 201 | for i, p in enumerate(self.item_paras): 202 | self.item_obj[i] = self.extract_item(i) 203 | theta = self.extract_item_theta(self.item_obj[i]) 204 | item_thetas.append(theta) 205 | self.item_thetas = np.array(item_thetas) 206 | return self.item_thetas 207 | 208 | def extract_item(self, item_id): 209 | """ 210 | 根据试题id提取item对象. 211 | 212 | Args: 213 | item_id: 214 | 215 | Returns: 216 | 217 | """ 218 | ro.r.assign("model", self.model) 219 | ro.r.assign("item", item_id + 1) 220 | # R语言中数组是以1开始的 221 | extra = ro.r("extract.item(model, item, group=NULL, drop.zeros = FALSE)") 222 | return extra 223 | 224 | def get_item_info(self, item_id, theta): 225 | ro.r.assign("x", self.item_obj[item_id]) 226 | ro.r.assign("Theta", theta) 227 | value = ro.r("iteminfo(x, Theta, degrees = NULL, total.info = TRUE, multidim_matrix = FALSE)") 228 | return value 229 | 230 | def get_items_info(self, cur_theta): 231 | values = [[i, abs(self.item_thetas[i] - cur_theta)] for i, p in enumerate(self.item_paras)] 232 | return values 233 | 234 | def get_item_expected_value(self, item_id, theta): 235 | ro.r.assign("x", self.item_obj[item_id]) 236 | ro.r.assign("Theta", theta) 237 | value = ro.r("expected.item(x, Theta)") 238 | return value 239 | 240 | def extract_item_theta(self, x): 241 | ro.r.assign("x", x) 242 | theta = np.arange(-6, 6.01, 0.01) 243 | ro.r.assign("Theta", theta) 244 | value = ro.r("iteminfo(x, Theta, degrees = NULL, total.info = TRUE, multidim_matrix = FALSE)") 245 | value = [(i, j) for i, j in zip(theta, value)] 246 | # 计算最大信息对应的theta 247 | theta = sorted(value, key=lambda i: i[1], reverse=True)[0][0] 248 | return theta 249 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /examples/lsat6.dat: -------------------------------------------------------------------------------- 1 | 0 0 0 0 0 2 | 0 0 0 0 0 3 | 0 0 0 0 0 4 | 0 0 0 0 1 5 | 0 0 0 0 1 6 | 0 0 0 0 1 7 | 0 0 0 0 1 8 | 0 0 0 0 1 9 | 0 0 0 0 1 10 | 0 0 0 1 0 11 | 0 0 0 1 0 12 | 0 0 0 1 1 13 | 0 0 0 1 1 14 | 0 0 0 1 1 15 | 0 0 0 1 1 16 | 0 0 0 1 1 17 | 0 0 0 1 1 18 | 0 0 0 1 1 19 | 0 0 0 1 1 20 | 0 0 0 1 1 21 | 0 0 0 1 1 22 | 0 0 0 1 1 23 | 0 0 1 0 0 24 | 0 0 1 0 1 25 | 0 0 1 1 0 26 | 0 0 1 1 0 27 | 0 0 1 1 0 28 | 0 0 1 1 1 29 | 0 0 1 1 1 30 | 0 0 1 1 1 31 | 0 0 1 1 1 32 | 0 1 0 0 0 33 | 0 1 0 0 1 34 | 0 1 0 0 1 35 | 0 1 0 0 1 36 | 0 1 0 0 1 37 | 0 1 0 0 1 38 | 0 1 0 0 1 39 | 0 1 0 0 1 40 | 0 1 0 0 1 41 | 0 1 0 1 1 42 | 0 1 0 1 1 43 | 0 1 0 1 1 44 | 0 1 0 1 1 45 | 0 1 0 1 1 46 | 0 1 0 1 1 47 | 0 1 0 1 1 48 | 0 1 0 1 1 49 | 0 1 0 1 1 50 | 0 1 0 1 1 51 | 0 1 0 1 1 52 | 0 1 0 1 1 53 | 0 1 0 1 1 54 | 0 1 0 1 1 55 | 0 1 0 1 1 56 | 0 1 0 1 1 57 | 0 1 1 0 1 58 | 0 1 1 0 1 59 | 0 1 1 0 1 60 | 0 1 1 1 0 61 | 0 1 1 1 0 62 | 0 1 1 1 1 63 | 0 1 1 1 1 64 | 0 1 1 1 1 65 | 0 1 1 1 1 66 | 0 1 1 1 1 67 | 0 1 1 1 1 68 | 0 1 1 1 1 69 | 0 1 1 1 1 70 | 0 1 1 1 1 71 | 0 1 1 1 1 72 | 0 1 1 1 1 73 | 0 1 1 1 1 74 | 0 1 1 1 1 75 | 0 1 1 1 1 76 | 0 1 1 1 1 77 | 1 0 0 0 0 78 | 1 0 0 0 0 79 | 1 0 0 0 0 80 | 1 0 0 0 0 81 | 1 0 0 0 0 82 | 1 0 0 0 0 83 | 1 0 0 0 0 84 | 1 0 0 0 0 85 | 1 0 0 0 0 86 | 1 0 0 0 0 87 | 1 0 0 0 1 88 | 1 0 0 0 1 89 | 1 0 0 0 1 90 | 1 0 0 0 1 91 | 1 0 0 0 1 92 | 1 0 0 0 1 93 | 1 0 0 0 1 94 | 1 0 0 0 1 95 | 1 0 0 0 1 96 | 1 0 0 0 1 97 | 1 0 0 0 1 98 | 1 0 0 0 1 99 | 1 0 0 0 1 100 | 1 0 0 0 1 101 | 1 0 0 0 1 102 | 1 0 0 0 1 103 | 1 0 0 0 1 104 | 1 0 0 0 1 105 | 1 0 0 0 1 106 | 1 0 0 0 1 107 | 1 0 0 0 1 108 | 1 0 0 0 1 109 | 1 0 0 0 1 110 | 1 0 0 0 1 111 | 1 0 0 0 1 112 | 1 0 0 0 1 113 | 1 0 0 0 1 114 | 1 0 0 0 1 115 | 1 0 0 0 1 116 | 1 0 0 1 0 117 | 1 0 0 1 0 118 | 1 0 0 1 0 119 | 1 0 0 1 0 120 | 1 0 0 1 0 121 | 1 0 0 1 0 122 | 1 0 0 1 0 123 | 1 0 0 1 0 124 | 1 0 0 1 0 125 | 1 0 0 1 0 126 | 1 0 0 1 0 127 | 1 0 0 1 0 128 | 1 0 0 1 0 129 | 1 0 0 1 0 130 | 1 0 0 1 1 131 | 1 0 0 1 1 132 | 1 0 0 1 1 133 | 1 0 0 1 1 134 | 1 0 0 1 1 135 | 1 0 0 1 1 136 | 1 0 0 1 1 137 | 1 0 0 1 1 138 | 1 0 0 1 1 139 | 1 0 0 1 1 140 | 1 0 0 1 1 141 | 1 0 0 1 1 142 | 1 0 0 1 1 143 | 1 0 0 1 1 144 | 1 0 0 1 1 145 | 1 0 0 1 1 146 | 1 0 0 1 1 147 | 1 0 0 1 1 148 | 1 0 0 1 1 149 | 1 0 0 1 1 150 | 1 0 0 1 1 151 | 1 0 0 1 1 152 | 1 0 0 1 1 153 | 1 0 0 1 1 154 | 1 0 0 1 1 155 | 1 0 0 1 1 156 | 1 0 0 1 1 157 | 1 0 0 1 1 158 | 1 0 0 1 1 159 | 1 0 0 1 1 160 | 1 0 0 1 1 161 | 1 0 0 1 1 162 | 1 0 0 1 1 163 | 1 0 0 1 1 164 | 1 0 0 1 1 165 | 1 0 0 1 1 166 | 1 0 0 1 1 167 | 1 0 0 1 1 168 | 1 0 0 1 1 169 | 1 0 0 1 1 170 | 1 0 0 1 1 171 | 1 0 0 1 1 172 | 1 0 0 1 1 173 | 1 0 0 1 1 174 | 1 0 0 1 1 175 | 1 0 0 1 1 176 | 1 0 0 1 1 177 | 1 0 0 1 1 178 | 1 0 0 1 1 179 | 1 0 0 1 1 180 | 1 0 0 1 1 181 | 1 0 0 1 1 182 | 1 0 0 1 1 183 | 1 0 0 1 1 184 | 1 0 0 1 1 185 | 1 0 0 1 1 186 | 1 0 0 1 1 187 | 1 0 0 1 1 188 | 1 0 0 1 1 189 | 1 0 0 1 1 190 | 1 0 0 1 1 191 | 1 0 0 1 1 192 | 1 0 0 1 1 193 | 1 0 0 1 1 194 | 1 0 0 1 1 195 | 1 0 0 1 1 196 | 1 0 0 1 1 197 | 1 0 0 1 1 198 | 1 0 0 1 1 199 | 1 0 0 1 1 200 | 1 0 0 1 1 201 | 1 0 0 1 1 202 | 1 0 0 1 1 203 | 1 0 0 1 1 204 | 1 0 0 1 1 205 | 1 0 0 1 1 206 | 1 0 0 1 1 207 | 1 0 0 1 1 208 | 1 0 0 1 1 209 | 1 0 0 1 1 210 | 1 0 0 1 1 211 | 1 0 1 0 0 212 | 1 0 1 0 0 213 | 1 0 1 0 0 214 | 1 0 1 0 1 215 | 1 0 1 0 1 216 | 1 0 1 0 1 217 | 1 0 1 0 1 218 | 1 0 1 0 1 219 | 1 0 1 0 1 220 | 1 0 1 0 1 221 | 1 0 1 0 1 222 | 1 0 1 0 1 223 | 1 0 1 0 1 224 | 1 0 1 0 1 225 | 1 0 1 0 1 226 | 1 0 1 0 1 227 | 1 0 1 0 1 228 | 1 0 1 0 1 229 | 1 0 1 0 1 230 | 1 0 1 0 1 231 | 1 0 1 0 1 232 | 1 0 1 0 1 233 | 1 0 1 0 1 234 | 1 0 1 0 1 235 | 1 0 1 0 1 236 | 1 0 1 0 1 237 | 1 0 1 0 1 238 | 1 0 1 0 1 239 | 1 0 1 0 1 240 | 1 0 1 0 1 241 | 1 0 1 0 1 242 | 1 0 1 1 0 243 | 1 0 1 1 0 244 | 1 0 1 1 0 245 | 1 0 1 1 0 246 | 1 0 1 1 0 247 | 1 0 1 1 0 248 | 1 0 1 1 0 249 | 1 0 1 1 0 250 | 1 0 1 1 0 251 | 1 0 1 1 0 252 | 1 0 1 1 0 253 | 1 0 1 1 0 254 | 1 0 1 1 0 255 | 1 0 1 1 0 256 | 1 0 1 1 0 257 | 1 0 1 1 1 258 | 1 0 1 1 1 259 | 1 0 1 1 1 260 | 1 0 1 1 1 261 | 1 0 1 1 1 262 | 1 0 1 1 1 263 | 1 0 1 1 1 264 | 1 0 1 1 1 265 | 1 0 1 1 1 266 | 1 0 1 1 1 267 | 1 0 1 1 1 268 | 1 0 1 1 1 269 | 1 0 1 1 1 270 | 1 0 1 1 1 271 | 1 0 1 1 1 272 | 1 0 1 1 1 273 | 1 0 1 1 1 274 | 1 0 1 1 1 275 | 1 0 1 1 1 276 | 1 0 1 1 1 277 | 1 0 1 1 1 278 | 1 0 1 1 1 279 | 1 0 1 1 1 280 | 1 0 1 1 1 281 | 1 0 1 1 1 282 | 1 0 1 1 1 283 | 1 0 1 1 1 284 | 1 0 1 1 1 285 | 1 0 1 1 1 286 | 1 0 1 1 1 287 | 1 0 1 1 1 288 | 1 0 1 1 1 289 | 1 0 1 1 1 290 | 1 0 1 1 1 291 | 1 0 1 1 1 292 | 1 0 1 1 1 293 | 1 0 1 1 1 294 | 1 0 1 1 1 295 | 1 0 1 1 1 296 | 1 0 1 1 1 297 | 1 0 1 1 1 298 | 1 0 1 1 1 299 | 1 0 1 1 1 300 | 1 0 1 1 1 301 | 1 0 1 1 1 302 | 1 0 1 1 1 303 | 1 0 1 1 1 304 | 1 0 1 1 1 305 | 1 0 1 1 1 306 | 1 0 1 1 1 307 | 1 0 1 1 1 308 | 1 0 1 1 1 309 | 1 0 1 1 1 310 | 1 0 1 1 1 311 | 1 0 1 1 1 312 | 1 0 1 1 1 313 | 1 0 1 1 1 314 | 1 0 1 1 1 315 | 1 0 1 1 1 316 | 1 0 1 1 1 317 | 1 0 1 1 1 318 | 1 0 1 1 1 319 | 1 0 1 1 1 320 | 1 0 1 1 1 321 | 1 0 1 1 1 322 | 1 0 1 1 1 323 | 1 0 1 1 1 324 | 1 0 1 1 1 325 | 1 0 1 1 1 326 | 1 0 1 1 1 327 | 1 0 1 1 1 328 | 1 0 1 1 1 329 | 1 0 1 1 1 330 | 1 0 1 1 1 331 | 1 0 1 1 1 332 | 1 0 1 1 1 333 | 1 0 1 1 1 334 | 1 0 1 1 1 335 | 1 0 1 1 1 336 | 1 0 1 1 1 337 | 1 1 0 0 0 338 | 1 1 0 0 0 339 | 1 1 0 0 0 340 | 1 1 0 0 0 341 | 1 1 0 0 0 342 | 1 1 0 0 0 343 | 1 1 0 0 0 344 | 1 1 0 0 0 345 | 1 1 0 0 0 346 | 1 1 0 0 0 347 | 1 1 0 0 0 348 | 1 1 0 0 0 349 | 1 1 0 0 0 350 | 1 1 0 0 0 351 | 1 1 0 0 0 352 | 1 1 0 0 0 353 | 1 1 0 0 1 354 | 1 1 0 0 1 355 | 1 1 0 0 1 356 | 1 1 0 0 1 357 | 1 1 0 0 1 358 | 1 1 0 0 1 359 | 1 1 0 0 1 360 | 1 1 0 0 1 361 | 1 1 0 0 1 362 | 1 1 0 0 1 363 | 1 1 0 0 1 364 | 1 1 0 0 1 365 | 1 1 0 0 1 366 | 1 1 0 0 1 367 | 1 1 0 0 1 368 | 1 1 0 0 1 369 | 1 1 0 0 1 370 | 1 1 0 0 1 371 | 1 1 0 0 1 372 | 1 1 0 0 1 373 | 1 1 0 0 1 374 | 1 1 0 0 1 375 | 1 1 0 0 1 376 | 1 1 0 0 1 377 | 1 1 0 0 1 378 | 1 1 0 0 1 379 | 1 1 0 0 1 380 | 1 1 0 0 1 381 | 1 1 0 0 1 382 | 1 1 0 0 1 383 | 1 1 0 0 1 384 | 1 1 0 0 1 385 | 1 1 0 0 1 386 | 1 1 0 0 1 387 | 1 1 0 0 1 388 | 1 1 0 0 1 389 | 1 1 0 0 1 390 | 1 1 0 0 1 391 | 1 1 0 0 1 392 | 1 1 0 0 1 393 | 1 1 0 0 1 394 | 1 1 0 0 1 395 | 1 1 0 0 1 396 | 1 1 0 0 1 397 | 1 1 0 0 1 398 | 1 1 0 0 1 399 | 1 1 0 0 1 400 | 1 1 0 0 1 401 | 1 1 0 0 1 402 | 1 1 0 0 1 403 | 1 1 0 0 1 404 | 1 1 0 0 1 405 | 1 1 0 0 1 406 | 1 1 0 0 1 407 | 1 1 0 0 1 408 | 1 1 0 0 1 409 | 1 1 0 1 0 410 | 1 1 0 1 0 411 | 1 1 0 1 0 412 | 1 1 0 1 0 413 | 1 1 0 1 0 414 | 1 1 0 1 0 415 | 1 1 0 1 0 416 | 1 1 0 1 0 417 | 1 1 0 1 0 418 | 1 1 0 1 0 419 | 1 1 0 1 0 420 | 1 1 0 1 0 421 | 1 1 0 1 0 422 | 1 1 0 1 0 423 | 1 1 0 1 0 424 | 1 1 0 1 0 425 | 1 1 0 1 0 426 | 1 1 0 1 0 427 | 1 1 0 1 0 428 | 1 1 0 1 0 429 | 1 1 0 1 0 430 | 1 1 0 1 1 431 | 1 1 0 1 1 432 | 1 1 0 1 1 433 | 1 1 0 1 1 434 | 1 1 0 1 1 435 | 1 1 0 1 1 436 | 1 1 0 1 1 437 | 1 1 0 1 1 438 | 1 1 0 1 1 439 | 1 1 0 1 1 440 | 1 1 0 1 1 441 | 1 1 0 1 1 442 | 1 1 0 1 1 443 | 1 1 0 1 1 444 | 1 1 0 1 1 445 | 1 1 0 1 1 446 | 1 1 0 1 1 447 | 1 1 0 1 1 448 | 1 1 0 1 1 449 | 1 1 0 1 1 450 | 1 1 0 1 1 451 | 1 1 0 1 1 452 | 1 1 0 1 1 453 | 1 1 0 1 1 454 | 1 1 0 1 1 455 | 1 1 0 1 1 456 | 1 1 0 1 1 457 | 1 1 0 1 1 458 | 1 1 0 1 1 459 | 1 1 0 1 1 460 | 1 1 0 1 1 461 | 1 1 0 1 1 462 | 1 1 0 1 1 463 | 1 1 0 1 1 464 | 1 1 0 1 1 465 | 1 1 0 1 1 466 | 1 1 0 1 1 467 | 1 1 0 1 1 468 | 1 1 0 1 1 469 | 1 1 0 1 1 470 | 1 1 0 1 1 471 | 1 1 0 1 1 472 | 1 1 0 1 1 473 | 1 1 0 1 1 474 | 1 1 0 1 1 475 | 1 1 0 1 1 476 | 1 1 0 1 1 477 | 1 1 0 1 1 478 | 1 1 0 1 1 479 | 1 1 0 1 1 480 | 1 1 0 1 1 481 | 1 1 0 1 1 482 | 1 1 0 1 1 483 | 1 1 0 1 1 484 | 1 1 0 1 1 485 | 1 1 0 1 1 486 | 1 1 0 1 1 487 | 1 1 0 1 1 488 | 1 1 0 1 1 489 | 1 1 0 1 1 490 | 1 1 0 1 1 491 | 1 1 0 1 1 492 | 1 1 0 1 1 493 | 1 1 0 1 1 494 | 1 1 0 1 1 495 | 1 1 0 1 1 496 | 1 1 0 1 1 497 | 1 1 0 1 1 498 | 1 1 0 1 1 499 | 1 1 0 1 1 500 | 1 1 0 1 1 501 | 1 1 0 1 1 502 | 1 1 0 1 1 503 | 1 1 0 1 1 504 | 1 1 0 1 1 505 | 1 1 0 1 1 506 | 1 1 0 1 1 507 | 1 1 0 1 1 508 | 1 1 0 1 1 509 | 1 1 0 1 1 510 | 1 1 0 1 1 511 | 1 1 0 1 1 512 | 1 1 0 1 1 513 | 1 1 0 1 1 514 | 1 1 0 1 1 515 | 1 1 0 1 1 516 | 1 1 0 1 1 517 | 1 1 0 1 1 518 | 1 1 0 1 1 519 | 1 1 0 1 1 520 | 1 1 0 1 1 521 | 1 1 0 1 1 522 | 1 1 0 1 1 523 | 1 1 0 1 1 524 | 1 1 0 1 1 525 | 1 1 0 1 1 526 | 1 1 0 1 1 527 | 1 1 0 1 1 528 | 1 1 0 1 1 529 | 1 1 0 1 1 530 | 1 1 0 1 1 531 | 1 1 0 1 1 532 | 1 1 0 1 1 533 | 1 1 0 1 1 534 | 1 1 0 1 1 535 | 1 1 0 1 1 536 | 1 1 0 1 1 537 | 1 1 0 1 1 538 | 1 1 0 1 1 539 | 1 1 0 1 1 540 | 1 1 0 1 1 541 | 1 1 0 1 1 542 | 1 1 0 1 1 543 | 1 1 0 1 1 544 | 1 1 0 1 1 545 | 1 1 0 1 1 546 | 1 1 0 1 1 547 | 1 1 0 1 1 548 | 1 1 0 1 1 549 | 1 1 0 1 1 550 | 1 1 0 1 1 551 | 1 1 0 1 1 552 | 1 1 0 1 1 553 | 1 1 0 1 1 554 | 1 1 0 1 1 555 | 1 1 0 1 1 556 | 1 1 0 1 1 557 | 1 1 0 1 1 558 | 1 1 0 1 1 559 | 1 1 0 1 1 560 | 1 1 0 1 1 561 | 1 1 0 1 1 562 | 1 1 0 1 1 563 | 1 1 0 1 1 564 | 1 1 0 1 1 565 | 1 1 0 1 1 566 | 1 1 0 1 1 567 | 1 1 0 1 1 568 | 1 1 0 1 1 569 | 1 1 0 1 1 570 | 1 1 0 1 1 571 | 1 1 0 1 1 572 | 1 1 0 1 1 573 | 1 1 0 1 1 574 | 1 1 0 1 1 575 | 1 1 0 1 1 576 | 1 1 0 1 1 577 | 1 1 0 1 1 578 | 1 1 0 1 1 579 | 1 1 0 1 1 580 | 1 1 0 1 1 581 | 1 1 0 1 1 582 | 1 1 0 1 1 583 | 1 1 0 1 1 584 | 1 1 0 1 1 585 | 1 1 0 1 1 586 | 1 1 0 1 1 587 | 1 1 0 1 1 588 | 1 1 0 1 1 589 | 1 1 0 1 1 590 | 1 1 0 1 1 591 | 1 1 0 1 1 592 | 1 1 0 1 1 593 | 1 1 0 1 1 594 | 1 1 0 1 1 595 | 1 1 0 1 1 596 | 1 1 0 1 1 597 | 1 1 0 1 1 598 | 1 1 0 1 1 599 | 1 1 0 1 1 600 | 1 1 0 1 1 601 | 1 1 0 1 1 602 | 1 1 0 1 1 603 | 1 1 1 0 0 604 | 1 1 1 0 0 605 | 1 1 1 0 0 606 | 1 1 1 0 0 607 | 1 1 1 0 0 608 | 1 1 1 0 0 609 | 1 1 1 0 0 610 | 1 1 1 0 0 611 | 1 1 1 0 0 612 | 1 1 1 0 0 613 | 1 1 1 0 0 614 | 1 1 1 0 1 615 | 1 1 1 0 1 616 | 1 1 1 0 1 617 | 1 1 1 0 1 618 | 1 1 1 0 1 619 | 1 1 1 0 1 620 | 1 1 1 0 1 621 | 1 1 1 0 1 622 | 1 1 1 0 1 623 | 1 1 1 0 1 624 | 1 1 1 0 1 625 | 1 1 1 0 1 626 | 1 1 1 0 1 627 | 1 1 1 0 1 628 | 1 1 1 0 1 629 | 1 1 1 0 1 630 | 1 1 1 0 1 631 | 1 1 1 0 1 632 | 1 1 1 0 1 633 | 1 1 1 0 1 634 | 1 1 1 0 1 635 | 1 1 1 0 1 636 | 1 1 1 0 1 637 | 1 1 1 0 1 638 | 1 1 1 0 1 639 | 1 1 1 0 1 640 | 1 1 1 0 1 641 | 1 1 1 0 1 642 | 1 1 1 0 1 643 | 1 1 1 0 1 644 | 1 1 1 0 1 645 | 1 1 1 0 1 646 | 1 1 1 0 1 647 | 1 1 1 0 1 648 | 1 1 1 0 1 649 | 1 1 1 0 1 650 | 1 1 1 0 1 651 | 1 1 1 0 1 652 | 1 1 1 0 1 653 | 1 1 1 0 1 654 | 1 1 1 0 1 655 | 1 1 1 0 1 656 | 1 1 1 0 1 657 | 1 1 1 0 1 658 | 1 1 1 0 1 659 | 1 1 1 0 1 660 | 1 1 1 0 1 661 | 1 1 1 0 1 662 | 1 1 1 0 1 663 | 1 1 1 0 1 664 | 1 1 1 0 1 665 | 1 1 1 0 1 666 | 1 1 1 0 1 667 | 1 1 1 0 1 668 | 1 1 1 0 1 669 | 1 1 1 0 1 670 | 1 1 1 0 1 671 | 1 1 1 0 1 672 | 1 1 1 0 1 673 | 1 1 1 0 1 674 | 1 1 1 0 1 675 | 1 1 1 1 0 676 | 1 1 1 1 0 677 | 1 1 1 1 0 678 | 1 1 1 1 0 679 | 1 1 1 1 0 680 | 1 1 1 1 0 681 | 1 1 1 1 0 682 | 1 1 1 1 0 683 | 1 1 1 1 0 684 | 1 1 1 1 0 685 | 1 1 1 1 0 686 | 1 1 1 1 0 687 | 1 1 1 1 0 688 | 1 1 1 1 0 689 | 1 1 1 1 0 690 | 1 1 1 1 0 691 | 1 1 1 1 0 692 | 1 1 1 1 0 693 | 1 1 1 1 0 694 | 1 1 1 1 0 695 | 1 1 1 1 0 696 | 1 1 1 1 0 697 | 1 1 1 1 0 698 | 1 1 1 1 0 699 | 1 1 1 1 0 700 | 1 1 1 1 0 701 | 1 1 1 1 0 702 | 1 1 1 1 0 703 | 1 1 1 1 1 704 | 1 1 1 1 1 705 | 1 1 1 1 1 706 | 1 1 1 1 1 707 | 1 1 1 1 1 708 | 1 1 1 1 1 709 | 1 1 1 1 1 710 | 1 1 1 1 1 711 | 1 1 1 1 1 712 | 1 1 1 1 1 713 | 1 1 1 1 1 714 | 1 1 1 1 1 715 | 1 1 1 1 1 716 | 1 1 1 1 1 717 | 1 1 1 1 1 718 | 1 1 1 1 1 719 | 1 1 1 1 1 720 | 1 1 1 1 1 721 | 1 1 1 1 1 722 | 1 1 1 1 1 723 | 1 1 1 1 1 724 | 1 1 1 1 1 725 | 1 1 1 1 1 726 | 1 1 1 1 1 727 | 1 1 1 1 1 728 | 1 1 1 1 1 729 | 1 1 1 1 1 730 | 1 1 1 1 1 731 | 1 1 1 1 1 732 | 1 1 1 1 1 733 | 1 1 1 1 1 734 | 1 1 1 1 1 735 | 1 1 1 1 1 736 | 1 1 1 1 1 737 | 1 1 1 1 1 738 | 1 1 1 1 1 739 | 1 1 1 1 1 740 | 1 1 1 1 1 741 | 1 1 1 1 1 742 | 1 1 1 1 1 743 | 1 1 1 1 1 744 | 1 1 1 1 1 745 | 1 1 1 1 1 746 | 1 1 1 1 1 747 | 1 1 1 1 1 748 | 1 1 1 1 1 749 | 1 1 1 1 1 750 | 1 1 1 1 1 751 | 1 1 1 1 1 752 | 1 1 1 1 1 753 | 1 1 1 1 1 754 | 1 1 1 1 1 755 | 1 1 1 1 1 756 | 1 1 1 1 1 757 | 1 1 1 1 1 758 | 1 1 1 1 1 759 | 1 1 1 1 1 760 | 1 1 1 1 1 761 | 1 1 1 1 1 762 | 1 1 1 1 1 763 | 1 1 1 1 1 764 | 1 1 1 1 1 765 | 1 1 1 1 1 766 | 1 1 1 1 1 767 | 1 1 1 1 1 768 | 1 1 1 1 1 769 | 1 1 1 1 1 770 | 1 1 1 1 1 771 | 1 1 1 1 1 772 | 1 1 1 1 1 773 | 1 1 1 1 1 774 | 1 1 1 1 1 775 | 1 1 1 1 1 776 | 1 1 1 1 1 777 | 1 1 1 1 1 778 | 1 1 1 1 1 779 | 1 1 1 1 1 780 | 1 1 1 1 1 781 | 1 1 1 1 1 782 | 1 1 1 1 1 783 | 1 1 1 1 1 784 | 1 1 1 1 1 785 | 1 1 1 1 1 786 | 1 1 1 1 1 787 | 1 1 1 1 1 788 | 1 1 1 1 1 789 | 1 1 1 1 1 790 | 1 1 1 1 1 791 | 1 1 1 1 1 792 | 1 1 1 1 1 793 | 1 1 1 1 1 794 | 1 1 1 1 1 795 | 1 1 1 1 1 796 | 1 1 1 1 1 797 | 1 1 1 1 1 798 | 1 1 1 1 1 799 | 1 1 1 1 1 800 | 1 1 1 1 1 801 | 1 1 1 1 1 802 | 1 1 1 1 1 803 | 1 1 1 1 1 804 | 1 1 1 1 1 805 | 1 1 1 1 1 806 | 1 1 1 1 1 807 | 1 1 1 1 1 808 | 1 1 1 1 1 809 | 1 1 1 1 1 810 | 1 1 1 1 1 811 | 1 1 1 1 1 812 | 1 1 1 1 1 813 | 1 1 1 1 1 814 | 1 1 1 1 1 815 | 1 1 1 1 1 816 | 1 1 1 1 1 817 | 1 1 1 1 1 818 | 1 1 1 1 1 819 | 1 1 1 1 1 820 | 1 1 1 1 1 821 | 1 1 1 1 1 822 | 1 1 1 1 1 823 | 1 1 1 1 1 824 | 1 1 1 1 1 825 | 1 1 1 1 1 826 | 1 1 1 1 1 827 | 1 1 1 1 1 828 | 1 1 1 1 1 829 | 1 1 1 1 1 830 | 1 1 1 1 1 831 | 1 1 1 1 1 832 | 1 1 1 1 1 833 | 1 1 1 1 1 834 | 1 1 1 1 1 835 | 1 1 1 1 1 836 | 1 1 1 1 1 837 | 1 1 1 1 1 838 | 1 1 1 1 1 839 | 1 1 1 1 1 840 | 1 1 1 1 1 841 | 1 1 1 1 1 842 | 1 1 1 1 1 843 | 1 1 1 1 1 844 | 1 1 1 1 1 845 | 1 1 1 1 1 846 | 1 1 1 1 1 847 | 1 1 1 1 1 848 | 1 1 1 1 1 849 | 1 1 1 1 1 850 | 1 1 1 1 1 851 | 1 1 1 1 1 852 | 1 1 1 1 1 853 | 1 1 1 1 1 854 | 1 1 1 1 1 855 | 1 1 1 1 1 856 | 1 1 1 1 1 857 | 1 1 1 1 1 858 | 1 1 1 1 1 859 | 1 1 1 1 1 860 | 1 1 1 1 1 861 | 1 1 1 1 1 862 | 1 1 1 1 1 863 | 1 1 1 1 1 864 | 1 1 1 1 1 865 | 1 1 1 1 1 866 | 1 1 1 1 1 867 | 1 1 1 1 1 868 | 1 1 1 1 1 869 | 1 1 1 1 1 870 | 1 1 1 1 1 871 | 1 1 1 1 1 872 | 1 1 1 1 1 873 | 1 1 1 1 1 874 | 1 1 1 1 1 875 | 1 1 1 1 1 876 | 1 1 1 1 1 877 | 1 1 1 1 1 878 | 1 1 1 1 1 879 | 1 1 1 1 1 880 | 1 1 1 1 1 881 | 1 1 1 1 1 882 | 1 1 1 1 1 883 | 1 1 1 1 1 884 | 1 1 1 1 1 885 | 1 1 1 1 1 886 | 1 1 1 1 1 887 | 1 1 1 1 1 888 | 1 1 1 1 1 889 | 1 1 1 1 1 890 | 1 1 1 1 1 891 | 1 1 1 1 1 892 | 1 1 1 1 1 893 | 1 1 1 1 1 894 | 1 1 1 1 1 895 | 1 1 1 1 1 896 | 1 1 1 1 1 897 | 1 1 1 1 1 898 | 1 1 1 1 1 899 | 1 1 1 1 1 900 | 1 1 1 1 1 901 | 1 1 1 1 1 902 | 1 1 1 1 1 903 | 1 1 1 1 1 904 | 1 1 1 1 1 905 | 1 1 1 1 1 906 | 1 1 1 1 1 907 | 1 1 1 1 1 908 | 1 1 1 1 1 909 | 1 1 1 1 1 910 | 1 1 1 1 1 911 | 1 1 1 1 1 912 | 1 1 1 1 1 913 | 1 1 1 1 1 914 | 1 1 1 1 1 915 | 1 1 1 1 1 916 | 1 1 1 1 1 917 | 1 1 1 1 1 918 | 1 1 1 1 1 919 | 1 1 1 1 1 920 | 1 1 1 1 1 921 | 1 1 1 1 1 922 | 1 1 1 1 1 923 | 1 1 1 1 1 924 | 1 1 1 1 1 925 | 1 1 1 1 1 926 | 1 1 1 1 1 927 | 1 1 1 1 1 928 | 1 1 1 1 1 929 | 1 1 1 1 1 930 | 1 1 1 1 1 931 | 1 1 1 1 1 932 | 1 1 1 1 1 933 | 1 1 1 1 1 934 | 1 1 1 1 1 935 | 1 1 1 1 1 936 | 1 1 1 1 1 937 | 1 1 1 1 1 938 | 1 1 1 1 1 939 | 1 1 1 1 1 940 | 1 1 1 1 1 941 | 1 1 1 1 1 942 | 1 1 1 1 1 943 | 1 1 1 1 1 944 | 1 1 1 1 1 945 | 1 1 1 1 1 946 | 1 1 1 1 1 947 | 1 1 1 1 1 948 | 1 1 1 1 1 949 | 1 1 1 1 1 950 | 1 1 1 1 1 951 | 1 1 1 1 1 952 | 1 1 1 1 1 953 | 1 1 1 1 1 954 | 1 1 1 1 1 955 | 1 1 1 1 1 956 | 1 1 1 1 1 957 | 1 1 1 1 1 958 | 1 1 1 1 1 959 | 1 1 1 1 1 960 | 1 1 1 1 1 961 | 1 1 1 1 1 962 | 1 1 1 1 1 963 | 1 1 1 1 1 964 | 1 1 1 1 1 965 | 1 1 1 1 1 966 | 1 1 1 1 1 967 | 1 1 1 1 1 968 | 1 1 1 1 1 969 | 1 1 1 1 1 970 | 1 1 1 1 1 971 | 1 1 1 1 1 972 | 1 1 1 1 1 973 | 1 1 1 1 1 974 | 1 1 1 1 1 975 | 1 1 1 1 1 976 | 1 1 1 1 1 977 | 1 1 1 1 1 978 | 1 1 1 1 1 979 | 1 1 1 1 1 980 | 1 1 1 1 1 981 | 1 1 1 1 1 982 | 1 1 1 1 1 983 | 1 1 1 1 1 984 | 1 1 1 1 1 985 | 1 1 1 1 1 986 | 1 1 1 1 1 987 | 1 1 1 1 1 988 | 1 1 1 1 1 989 | 1 1 1 1 1 990 | 1 1 1 1 1 991 | 1 1 1 1 1 992 | 1 1 1 1 1 993 | 1 1 1 1 1 994 | 1 1 1 1 1 995 | 1 1 1 1 1 996 | 1 1 1 1 1 997 | 1 1 1 1 1 998 | 1 1 1 1 1 999 | 1 1 1 1 1 1000 | 1 1 1 1 1 1001 | --------------------------------------------------------------------------------