def testJsonData(self): state = ProofState.parse_init_state( thy, {'vars': {'A': 'bool', 'B': 'bool'}, 'prop': "A & B --> B & A"}) json_data = state.json_data() self.assertEqual(len(json_data['vars']), 2) self.assertEqual(len(json_data['proof']), 3) self.assertIn('report', json_data)
def init_empty_proof(): """Initialize empty proof.""" data = json.loads(request.get_data().decode("utf-8")) if data: thy = basic.load_theory(data['theory_name'], limit=('thm', data['thm_name']), user=user_info['username']) cell = ProofState.parse_init_state(thy, data) cells[data['id']] = cell return jsonify(cell.json_data()) return jsonify({})
def testParseInitState(self): state = ProofState.parse_init_state( thy, {'vars': {'A': 'bool', 'B': 'bool'}, 'prop': "A & B --> B & A"}) self.assertEqual(len(state.prf.items), 3) self.assertEqual(state.check_proof(), Thm.mk_implies(conj(A, B), conj(B, A)))