1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org |
2 | * |
3 | * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>. |
4 | * |
5 | * "Hilbert II" is free software; you can redistribute |
6 | * it and/or modify it under the terms of the GNU General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. |
14 | */ |
15 | |
16 | package org.qedeq.kernel.bo.logic.model; |
17 | |
18 | /** |
19 | * A model for our mathematical world. It has only one entity. |
20 | * |
21 | * @author Michael Meyling |
22 | */ |
23 | public final class UnaryDynamicModel extends DynamicModel { |
24 | |
25 | /** "Zero" or empty class. */ |
26 | public static final Entity ZERO = new Entity(0, "0", "{} or empty set"); |
27 | |
28 | /** Map to zero. */ |
29 | public static final Function FUNCTION_ZERO = new Function(0, 99, "->0", "always 0") { |
30 | public Entity map(final Entity[] entities) { |
31 | return ZERO; |
32 | } |
33 | }; |
34 | |
35 | /** |
36 | * Constructor. |
37 | */ |
38 | public UnaryDynamicModel() { |
39 | super("one element"); |
40 | addEntity(ZERO); |
41 | |
42 | // we don't need to add functions because we always return FUNCTION_ZERO |
43 | |
44 | addPredicate(0, FALSE); |
45 | addPredicate(0, TRUE); |
46 | addPredicate(1, FALSE); |
47 | addPredicate(1, TRUE); |
48 | addPredicate(2, FALSE); |
49 | addPredicate(2, TRUE); |
50 | addPredicate(3, FALSE); |
51 | addPredicate(3, TRUE); |
52 | |
53 | addPredicateConstant(new ModelPredicateConstant("in", 2), FALSE); |
54 | |
55 | } |
56 | |
57 | public String getDescription() { |
58 | return "This model has only one entity. The \" is element of\" relation is never fullfilled."; |
59 | } |
60 | |
61 | public int getFunctionSize(final int size) { |
62 | return 1; |
63 | } |
64 | |
65 | public Function getFunction(final int size, final int number) { |
66 | return FUNCTION_ZERO; |
67 | } |
68 | |
69 | public Function getFunctionConstant(final ModelFunctionConstant con) { |
70 | return FUNCTION_ZERO; |
71 | } |
72 | |
73 | public Entity comprehension(final Entity[] array) { |
74 | return ZERO; |
75 | } |
76 | |
77 | } |