|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| Lbool.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | /* | |
| 2 | * SAT4J: a SATisfiability library for Java | |
| 3 | * Copyright (C) 2004 Daniel Le Berre | |
| 4 | * | |
| 5 | * Based on the original minisat specification from: | |
| 6 | * | |
| 7 | * An extensible SAT solver. Niklas Eᅵn and Niklas Sᅵrensson. | |
| 8 | * Proceedings of the Sixth International Conference on Theory | |
| 9 | * and Applications of Satisfiability Testing, LNCS 2919, | |
| 10 | * pp 502-518, 2003. | |
| 11 | * | |
| 12 | * This library is free software; you can redistribute it and/or | |
| 13 | * modify it under the terms of the GNU Lesser General Public | |
| 14 | * License as published by the Free Software Foundation; either | |
| 15 | * version 2.1 of the License, or (at your option) any later version. | |
| 16 | * | |
| 17 | * This library is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 20 | * Lesser General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU Lesser General Public | |
| 23 | * License along with this library; if not, write to the Free Software | |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 25 | * | |
| 26 | */ | |
| 27 | ||
| 28 | package org.sat4j.minisat.core; | |
| 29 | ||
| 30 | /* | |
| 31 | * Created on 9 oct. 2003 Problᅵme : comment rendre opposite final ? | |
| 32 | */ | |
| 33 | ||
| 34 | /** | |
| 35 | * @author leberre Cette classe reprᅵsente les valeurs boolᅵennes qui | |
| 36 | * peuvent ᅵtre associᅵes aux littᅵraux. | |
| 37 | */ | |
| 38 | public enum Lbool { | |
| 39 | ||
| 40 | FALSE("F"), TRUE("T"), UNDEFINED("U"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ | |
| 41 | ||
| 42 | static { | |
| 43 | // on crᅵe ici les rᅵgles de la nᅵgation | |
| 44 | 41 | FALSE.opposite = TRUE; |
| 45 | 41 | TRUE.opposite = FALSE; |
| 46 | 41 | UNDEFINED.opposite = UNDEFINED; |
| 47 | } | |
| 48 | ||
| 49 | 123 | private Lbool(String symbol) { |
| 50 | 123 | this.symbol = symbol; |
| 51 | } | |
| 52 | ||
| 53 | /** | |
| 54 | * Nᅵgation boolᅵenne | |
| 55 | * | |
| 56 | * @return la nᅵgation de la valeur boolᅵnne. La nᅵgation de la valeur | |
| 57 | * UNDEFINED est UNDEFINED. | |
| 58 | */ | |
| 59 | 3 | public Lbool not() { |
| 60 | 3 | return opposite; |
| 61 | } | |
| 62 | ||
| 63 | /** | |
| 64 | * Une valeur boolᅵenne est reprᅵsentᅵe par T,F ou U. | |
| 65 | * | |
| 66 | * @return l'une des trois lettres | |
| 67 | */ | |
| 68 | 3 | @Override |
| 69 | public String toString() { | |
| 70 | 3 | return symbol; |
| 71 | } | |
| 72 | ||
| 73 | /** | |
| 74 | * Le symbole reprᅵsentant la valeur boolᅵenne | |
| 75 | */ | |
| 76 | private final String symbol; | |
| 77 | ||
| 78 | /** | |
| 79 | * la valeur boolᅵenne opposᅵe | |
| 80 | */ | |
| 81 | private Lbool opposite; | |
| 82 | ||
| 83 | } |
|
||||||||||