├── .github └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── codecov.yml ├── doc ├── logo │ └── logo_big.png └── tutorial │ ├── BicycleShopData.java │ └── BicycleShopTutorial.java ├── pom.xml └── src ├── main ├── java │ └── org │ │ └── logicng │ │ ├── LogicNGVersion.java │ │ ├── backbones │ │ ├── Backbone.java │ │ ├── BackboneGeneration.java │ │ └── BackboneType.java │ │ ├── cardinalityconstraints │ │ ├── CCALKCardinalityNetwork.java │ │ ├── CCALKModularTotalizer.java │ │ ├── CCALKTotalizer.java │ │ ├── CCAMKCardinalityNetwork.java │ │ ├── CCAMKModularTotalizer.java │ │ ├── CCAMKTotalizer.java │ │ ├── CCAMOBimander.java │ │ ├── CCAMOBinary.java │ │ ├── CCAMOCommander.java │ │ ├── CCAMOLadder.java │ │ ├── CCAMONested.java │ │ ├── CCAMOProduct.java │ │ ├── CCAMOPure.java │ │ ├── CCAtLeastK.java │ │ ├── CCAtMostK.java │ │ ├── CCAtMostOne.java │ │ ├── CCCardinalityNetworks.java │ │ ├── CCConfig.java │ │ ├── CCEXKCardinalityNetwork.java │ │ ├── CCEXKTotalizer.java │ │ ├── CCEncoder.java │ │ ├── CCExactlyK.java │ │ ├── CCIncrementalData.java │ │ ├── CCModularTotalizer.java │ │ ├── CCSorting.java │ │ └── CCTotalizer.java │ │ ├── collections │ │ ├── LNGBooleanVector.java │ │ ├── LNGByteVector.java │ │ ├── LNGDoublePriorityQueue.java │ │ ├── LNGDoubleVector.java │ │ ├── LNGIntVector.java │ │ ├── LNGLongPriorityQueue.java │ │ ├── LNGLongVector.java │ │ └── LNGVector.java │ │ ├── configurations │ │ ├── Configuration.java │ │ └── ConfigurationType.java │ │ ├── datastructures │ │ ├── Assignment.java │ │ ├── EncodingAuxiliaryVariable.java │ │ ├── EncodingResult.java │ │ ├── Substitution.java │ │ ├── Tristate.java │ │ └── ubtrees │ │ │ ├── UBNode.java │ │ │ └── UBTree.java │ │ ├── explanations │ │ ├── UNSATCore.java │ │ ├── drup │ │ │ └── DRUPTrim.java │ │ ├── mus │ │ │ ├── DeletionBasedMUS.java │ │ │ ├── MUSAlgorithm.java │ │ │ ├── MUSConfig.java │ │ │ ├── MUSGeneration.java │ │ │ └── PlainInsertionBasedMUS.java │ │ └── smus │ │ │ └── SmusComputation.java │ │ ├── formulas │ │ ├── And.java │ │ ├── BinaryOperator.java │ │ ├── CFalse.java │ │ ├── CTrue.java │ │ ├── CType.java │ │ ├── CardinalityConstraint.java │ │ ├── Constant.java │ │ ├── Equivalence.java │ │ ├── ExtendedFormulaFactory.java │ │ ├── FType.java │ │ ├── Formula.java │ │ ├── FormulaFactory.java │ │ ├── FormulaFactoryConfig.java │ │ ├── FormulaFactoryState.java │ │ ├── FormulaFunction.java │ │ ├── FormulaPredicate.java │ │ ├── FormulaTransformation.java │ │ ├── Implication.java │ │ ├── Literal.java │ │ ├── NAryOperator.java │ │ ├── Not.java │ │ ├── Or.java │ │ ├── PBConstraint.java │ │ ├── Variable.java │ │ ├── cache │ │ │ ├── CacheEntry.java │ │ │ ├── FunctionCacheEntry.java │ │ │ ├── PredicateCacheEntry.java │ │ │ └── TransformationCacheEntry.java │ │ └── printer │ │ │ ├── DefaultStringRepresentation.java │ │ │ ├── FormulaStringRepresentation.java │ │ │ ├── LatexStringRepresentation.java │ │ │ ├── SortedStringRepresentation.java │ │ │ └── UTF8StringRepresentation.java │ │ ├── functions │ │ ├── FormulaDepthFunction.java │ │ ├── LiteralProfileFunction.java │ │ ├── LiteralsFunction.java │ │ ├── MinimumPrimeImplicantFunction.java │ │ ├── NumberOfAtomsFunction.java │ │ ├── NumberOfNodesFunction.java │ │ ├── SubNodeFunction.java │ │ ├── VariableProfileFunction.java │ │ └── VariablesFunction.java │ │ ├── graphs │ │ ├── algorithms │ │ │ ├── BronKerbosch.java │ │ │ └── ConnectedComponentsComputation.java │ │ ├── datastructures │ │ │ ├── Graph.java │ │ │ ├── Hypergraph.java │ │ │ ├── HypergraphEdge.java │ │ │ ├── HypergraphNode.java │ │ │ └── Node.java │ │ ├── generators │ │ │ ├── ConstraintGraphGenerator.java │ │ │ └── HypergraphGenerator.java │ │ └── io │ │ │ ├── GraphDimacsFileWriter.java │ │ │ └── GraphDotFileWriter.java │ │ ├── handlers │ │ ├── BDDHandler.java │ │ ├── ComputationHandler.java │ │ ├── DnnfCompilationHandler.java │ │ ├── FactorizationHandler.java │ │ ├── Handler.java │ │ ├── MaxSATHandler.java │ │ ├── ModelEnumerationHandler.java │ │ ├── NumberOfModelsHandler.java │ │ ├── NumberOfNodesBDDHandler.java │ │ ├── OptimizationHandler.java │ │ ├── SATHandler.java │ │ ├── TimeoutBDDHandler.java │ │ ├── TimeoutHandler.java │ │ ├── TimeoutMaxSATHandler.java │ │ ├── TimeoutModelEnumerationHandler.java │ │ ├── TimeoutOptimizationHandler.java │ │ └── TimeoutSATHandler.java │ │ ├── io │ │ ├── graphical │ │ │ ├── GraphicalColor.java │ │ │ ├── GraphicalDotWriter.java │ │ │ ├── GraphicalEdge.java │ │ │ ├── GraphicalEdgeStyle.java │ │ │ ├── GraphicalMermaidWriter.java │ │ │ ├── GraphicalNode.java │ │ │ ├── GraphicalNodeStyle.java │ │ │ ├── GraphicalRepresentation.java │ │ │ ├── GraphicalRepresentationWriter.java │ │ │ └── generators │ │ │ │ ├── BddEdgeStyleMapper.java │ │ │ │ ├── BddGraphicalGenerator.java │ │ │ │ ├── BddLabelMapper.java │ │ │ │ ├── BddMapper.java │ │ │ │ ├── BddNodeStyleMapper.java │ │ │ │ ├── EdgeStyleMapper.java │ │ │ │ ├── FormulaAstGraphicalGenerator.java │ │ │ │ ├── FormulaDagGraphicalGenerator.java │ │ │ │ ├── GraphGraphicalGenerator.java │ │ │ │ ├── GraphicalGenerator.java │ │ │ │ ├── GraphicalGeneratorBuilder.java │ │ │ │ ├── LabelMapper.java │ │ │ │ └── NodeStyleMapper.java │ │ ├── readers │ │ │ └── DimacsReader.java │ │ └── writers │ │ │ ├── FormulaDimacsFileWriter.java │ │ │ ├── FormulaDotFileWriter.java │ │ │ └── FormulaWriter.java │ │ ├── knowledgecompilation │ │ ├── bdds │ │ │ ├── BDD.java │ │ │ ├── BDDFactory.java │ │ │ ├── datastructures │ │ │ │ ├── BDDConstant.java │ │ │ │ ├── BDDInnerNode.java │ │ │ │ └── BDDNode.java │ │ │ ├── functions │ │ │ │ ├── BDDCNFFunction.java │ │ │ │ ├── BDDDNFFunction.java │ │ │ │ ├── BDDFunction.java │ │ │ │ ├── BDDModelEnumerationFunction.java │ │ │ │ ├── BDDNormalFormFunction.java │ │ │ │ └── LngBDDFunction.java │ │ │ ├── io │ │ │ │ └── BDDDotFileWriter.java │ │ │ ├── jbuddy │ │ │ │ ├── BDDCache.java │ │ │ │ ├── BDDCacheEntry.java │ │ │ │ ├── BDDConstruction.java │ │ │ │ ├── BDDKernel.java │ │ │ │ ├── BDDOperations.java │ │ │ │ ├── BDDPrime.java │ │ │ │ ├── BDDReordering.java │ │ │ │ ├── BDDReorderingMethod.java │ │ │ │ └── BDDTree.java │ │ │ └── orderings │ │ │ │ ├── BFSOrdering.java │ │ │ │ ├── DFSOrdering.java │ │ │ │ ├── ForceOrdering.java │ │ │ │ ├── MaxToMinOrdering.java │ │ │ │ ├── MinToMaxOrdering.java │ │ │ │ ├── VariableOrdering.java │ │ │ │ └── VariableOrderingProvider.java │ │ └── dnnf │ │ │ ├── DnnfCompiler.java │ │ │ ├── DnnfFactory.java │ │ │ ├── DnnfMiniSatStyleSolver.java │ │ │ ├── DnnfSatSolver.java │ │ │ ├── datastructures │ │ │ ├── Dnnf.java │ │ │ └── dtree │ │ │ │ ├── DTree.java │ │ │ │ ├── DTreeGenerator.java │ │ │ │ ├── DTreeLeaf.java │ │ │ │ ├── DTreeNode.java │ │ │ │ ├── EliminatingOrderDTreeGenerator.java │ │ │ │ └── MinFillDTreeGenerator.java │ │ │ └── functions │ │ │ ├── DnnfFunction.java │ │ │ └── DnnfModelCountFunction.java │ │ ├── modelcounting │ │ └── ModelCounter.java │ │ ├── np │ │ └── SetCover.java │ │ ├── predicates │ │ ├── AIGPredicate.java │ │ ├── CNFPredicate.java │ │ ├── ContainsPBCPredicate.java │ │ ├── DNFPredicate.java │ │ ├── EvaluatesToConstantPredicate.java │ │ ├── NNFPredicate.java │ │ ├── TermPredicate.java │ │ └── satisfiability │ │ │ ├── ContingencyPredicate.java │ │ │ ├── ContradictionPredicate.java │ │ │ ├── SATPredicate.java │ │ │ └── TautologyPredicate.java │ │ ├── primecomputation │ │ ├── NaivePrimeReduction.java │ │ ├── PrimeCompiler.java │ │ └── PrimeResult.java │ │ ├── propositions │ │ ├── ExtendedProposition.java │ │ ├── Proposition.java │ │ ├── PropositionBackpack.java │ │ └── StandardProposition.java │ │ ├── pseudobooleans │ │ ├── PBAdderNetworks.java │ │ ├── PBBinaryMerge.java │ │ ├── PBConfig.java │ │ ├── PBEncoder.java │ │ ├── PBEncoding.java │ │ └── PBSWC.java │ │ ├── solvers │ │ ├── MaxSATSolver.java │ │ ├── MiniSat.java │ │ ├── SATSolver.java │ │ ├── SolverState.java │ │ ├── datastructures │ │ │ ├── LNGBoundedIntQueue.java │ │ │ ├── LNGBoundedLongQueue.java │ │ │ ├── LNGHeap.java │ │ │ ├── MSClause.java │ │ │ ├── MSHardClause.java │ │ │ ├── MSSoftClause.java │ │ │ ├── MSVariable.java │ │ │ └── MSWatcher.java │ │ ├── functions │ │ │ ├── BackboneFunction.java │ │ │ ├── FormulaOnSolverFunction.java │ │ │ ├── ModelEnumerationFunction.java │ │ │ ├── OptimizationFunction.java │ │ │ ├── SolverFunction.java │ │ │ ├── UnsatCoreFunction.java │ │ │ └── UpZeroLiteralsFunction.java │ │ ├── maxsat │ │ │ ├── OptimizationConfig.java │ │ │ ├── algorithms │ │ │ │ ├── IncWBO.java │ │ │ │ ├── LinearSU.java │ │ │ │ ├── LinearUS.java │ │ │ │ ├── MSU3.java │ │ │ │ ├── MaxSAT.java │ │ │ │ ├── MaxSATConfig.java │ │ │ │ ├── OLL.java │ │ │ │ ├── WBO.java │ │ │ │ └── WMSU3.java │ │ │ └── encodings │ │ │ │ ├── Encoder.java │ │ │ │ ├── Encoding.java │ │ │ │ ├── Ladder.java │ │ │ │ ├── ModularTotalizer.java │ │ │ │ ├── SequentialWeightCounter.java │ │ │ │ └── Totalizer.java │ │ └── sat │ │ │ ├── GlucoseConfig.java │ │ │ ├── GlucoseSyrup.java │ │ │ ├── MiniCard.java │ │ │ ├── MiniSat2Solver.java │ │ │ ├── MiniSatConfig.java │ │ │ └── MiniSatStyleSolver.java │ │ ├── transformations │ │ ├── AIGTransformation.java │ │ ├── Anonymizer.java │ │ ├── BDDNormalFormTransformation.java │ │ ├── CanonicalEnumeration.java │ │ ├── FormulaFactoryImporter.java │ │ ├── LiteralSubstitution.java │ │ ├── NNFTransformation.java │ │ ├── PureExpansionTransformation.java │ │ ├── Subsumption.java │ │ ├── UnitPropagation.java │ │ ├── cnf │ │ │ ├── BDDCNFTransformation.java │ │ │ ├── CNFConfig.java │ │ │ ├── CNFEncoder.java │ │ │ ├── CNFFactorization.java │ │ │ ├── CNFSubsumption.java │ │ │ ├── CanonicalCNFEnumeration.java │ │ │ ├── PlaistedGreenbaumTransformation.java │ │ │ ├── PlaistedGreenbaumTransformationSolver.java │ │ │ └── TseitinTransformation.java │ │ ├── dnf │ │ │ ├── BDDDNFTransformation.java │ │ │ ├── CanonicalDNFEnumeration.java │ │ │ ├── DNFFactorization.java │ │ │ └── DNFSubsumption.java │ │ ├── qe │ │ │ ├── ExistentialQuantifierElimination.java │ │ │ └── UniversalQuantifierElimination.java │ │ ├── qmc │ │ │ ├── QuineMcCluskeyAlgorithm.java │ │ │ ├── Term.java │ │ │ └── TermTable.java │ │ └── simplification │ │ │ ├── AdvancedSimplifier.java │ │ │ ├── AdvancedSimplifierConfig.java │ │ │ ├── BackboneSimplifier.java │ │ │ ├── DefaultRatingFunction.java │ │ │ ├── DistributiveSimplifier.java │ │ │ ├── FactorOutSimplifier.java │ │ │ ├── NegationSimplifier.java │ │ │ └── RatingFunction.java │ │ └── util │ │ ├── CollectionHelper.java │ │ ├── ComparablePair.java │ │ ├── FormulaCornerCases.java │ │ ├── FormulaHelper.java │ │ ├── FormulaRandomizer.java │ │ ├── FormulaRandomizerConfig.java │ │ └── Pair.java └── resources │ └── org │ └── logicng │ └── version.txt └── test ├── antlr ├── LogicNGPropositional.g4 └── LogicNGPseudoBoolean.g4 ├── java └── org │ └── logicng │ ├── LogicNGTest.java │ ├── LogicNGVersionTest.java │ ├── LongRunningTag.java │ ├── RandomTag.java │ ├── TestWithExampleFormulas.java │ ├── backbones │ ├── BackboneGenerationTest.java │ └── BackboneTest.java │ ├── cardinalityconstraints │ ├── CCALKTest.java │ ├── CCAMKTest.java │ ├── CCAMOTest.java │ ├── CCEXKTest.java │ ├── CCEXOTest.java │ ├── CCIncrementalFormulaTest.java │ ├── CCIncrementalSolverTest.java │ └── CCPerformanceTest.java │ ├── collections │ ├── LNGBooleanVectorTest.java │ ├── LNGByteVectorTest.java │ ├── LNGDoublePriorityQueueTest.java │ ├── LNGDoubleVectorTest.java │ ├── LNGIntVectorTest.java │ ├── LNGLongPriorityQueueTest.java │ ├── LNGLongVectorTest.java │ └── LNGVectorTest.java │ ├── configurations │ └── ConfigurationsTest.java │ ├── datastructures │ ├── AssignmentTest.java │ ├── DatastructuresTest.java │ └── ubtrees │ │ ├── UBNodeTest.java │ │ └── UBTreeTest.java │ ├── explanations │ ├── UNSATCoreTest.java │ ├── drup │ │ └── DRUPTest.java │ ├── mus │ │ ├── MUSConfigTest.java │ │ └── MUSGenerationTest.java │ └── smus │ │ └── SmusComputationTest.java │ ├── formulas │ ├── AndTest.java │ ├── CFalseTest.java │ ├── CTrueTest.java │ ├── CacheTest.java │ ├── EquivalenceTest.java │ ├── EvaluationTest.java │ ├── ExtendedFormulaFactoryTest.java │ ├── FTypeTest.java │ ├── FormulaFactoryTest.java │ ├── FormulaFactoryWithoutContradictionCheckTest.java │ ├── FormulaIteratorTest.java │ ├── FormulaMergeTest.java │ ├── FormulaTest.java │ ├── ImplicationTest.java │ ├── LiteralTest.java │ ├── NNFTest.java │ ├── NotTest.java │ ├── OrTest.java │ ├── PBConstraintTest.java │ ├── RestrictionTest.java │ ├── SubstitutionTest.java │ └── printer │ │ ├── DefaultStringRepresentationTest.java │ │ ├── LatexStringRepresentationTest.java │ │ ├── SortedStringRepresentationTest.java │ │ └── UTF8StringRepresentationTest.java │ ├── functions │ ├── FormulaDepthFunctionTest.java │ ├── LiteralProfileTest.java │ ├── MinimumPrimeImplicantTest.java │ ├── SubformulaTest.java │ └── VariableProfileTest.java │ ├── graphs │ ├── algorithms │ │ ├── BronKerboschTest.java │ │ └── ConnectedComponentsComputerTest.java │ ├── datastructures │ │ ├── GraphTest.java │ │ ├── HypergraphEdgeTest.java │ │ ├── HypergraphNodeTest.java │ │ └── HypergraphTest.java │ ├── generators │ │ ├── ConstraintGraphGeneratorTest.java │ │ └── HypergraphGeneratorTest.java │ └── io │ │ ├── GraphDimacsFileWriterTest.java │ │ └── conditions │ │ └── ContainsCondition.java │ ├── handlers │ ├── BoundedOptimizationHandler.java │ ├── BoundedSatHandler.java │ ├── NumberOfNodesBDDHandlerTest.java │ ├── TimeoutBDDHandlerTest.java │ ├── TimeoutMaxSATHandlerTest.java │ ├── TimeoutModelEnumerationHandlerTest.java │ ├── TimeoutOptimizationHandlerTest.java │ ├── TimeoutSATHandlerTest.java │ └── TimerTypeTest.java │ ├── io │ ├── FormulaWriterReaderTest.java │ ├── graphical │ │ ├── GraphicalEdgeTest.java │ │ ├── GraphicalNodeTest.java │ │ └── generators │ │ │ ├── BddGraphicalGeneratorTest.java │ │ │ ├── FormulaAstGraphicalGeneratorTest.java │ │ │ ├── FormulaDagGraphicalGeneratorTest.java │ │ │ └── GraphGraphicalGeneratorTest.java │ ├── parsers │ │ ├── FormulaParser.java │ │ ├── LexerException.java │ │ ├── ParserException.java │ │ ├── ParserWithFormula.java │ │ ├── PropositionalLexer.java │ │ ├── PropositionalParser.java │ │ ├── PseudoBooleanLexer.java │ │ └── PseudoBooleanParser.java │ ├── readers │ │ ├── DimacsReaderTest.java │ │ └── FormulaReader.java │ └── writers │ │ └── FormulaDimacsFileWriterTest.java │ ├── knowledgecompilation │ ├── bdds │ │ ├── BDDConstructionTests.java │ │ ├── BDDLowLevelTest.java │ │ ├── BDDModelEnumerationTest.java │ │ ├── BDDOperationsTest.java │ │ ├── BDDReorderingTest.java │ │ ├── FormulaBDDTest.java │ │ ├── LargeBDDTest.java │ │ ├── SimpleBDDTest.java │ │ ├── datastructures │ │ │ └── BDDNodeTest.java │ │ ├── jbuddy │ │ │ ├── BDDPrimeTest.java │ │ │ └── BDDVerification.java │ │ └── orderings │ │ │ ├── BFSOrderingTest.java │ │ │ ├── DFSOrderingTest.java │ │ │ ├── ForceOrderingTest.java │ │ │ └── OccurrenceOrderingTest.java │ └── dnnf │ │ ├── DnnfCompilerTest.java │ │ └── datastructures │ │ └── dtree │ │ └── DTreeNodeTest.java │ ├── modelcounting │ └── ModelCounterTest.java │ ├── np │ └── SetCoverTest.java │ ├── predicates │ ├── CNFPredicateTest.java │ ├── ContainsPBCPredicateTest.java │ ├── DNFPredicateTest.java │ ├── EvaluatesToConstantPredicateTest.java │ ├── NNFPredicateTest.java │ ├── TermPredicateTest.java │ └── satisfiability │ │ └── PredicatesTest.java │ ├── primecomputation │ ├── PrimeCompilerTest.java │ ├── PrimeImplicantReductionTest.java │ ├── PrimeImplicateReductionTest.java │ └── PrimeResultTest.java │ ├── propositions │ ├── ExtendedPropositionTest.java │ └── StandardPropositionTest.java │ ├── pseudobooleans │ ├── PBEncoderTest.java │ └── PBSolvingTest.java │ ├── solvers │ ├── ModelTest.java │ ├── datastructures │ │ ├── LNGHeapTest.java │ │ └── SolversDatastructuresTest.java │ ├── functions │ │ ├── BackboneFunctionTest.java │ │ ├── ModelEnumerationFunctionTest.java │ │ ├── OptimizationFunctionTest.java │ │ └── UnsatCoreFunctionTest.java │ ├── maxsat │ │ ├── MaxSATClassTest.java │ │ ├── MaxSATReader.java │ │ ├── MaxSatLongRunningTest.java │ │ ├── PartialMaxSATTest.java │ │ ├── PartialWeightedMaxSATTest.java │ │ ├── PureMaxSATTest.java │ │ └── encodings │ │ │ └── EncodingsTest.java │ └── sat │ │ ├── AssumeTest.java │ │ ├── ConfigurationsTest.java │ │ ├── GlucoseSyrupTest.java │ │ ├── IncDecTest.java │ │ ├── MiniCardTest.java │ │ ├── MiniSatTest.java │ │ └── SATTest.java │ ├── testutils │ ├── NQueensGenerator.java │ ├── PigeonHoleGenerator.java │ └── TestUtil.java │ ├── transformations │ ├── AIGTest.java │ ├── AnonymizerTest.java │ ├── FormulaFactoryImporterTest.java │ ├── LiteralSubstitutionTest.java │ ├── PureExpansionTransformationTest.java │ ├── UnitPropagationTest.java │ ├── cnf │ │ ├── BDDCNFTest.java │ │ ├── CNFEncoderTest.java │ │ ├── CNFSubsumptionTest.java │ │ ├── CNFTest.java │ │ ├── CanonicalCNFEnumerationTest.java │ │ ├── CnfMethodComparisonTest.java │ │ ├── PlaistedGreenbaumTest.java │ │ ├── PlaistedGreenbaumTransformationSolverTest.java │ │ └── TseitinTest.java │ ├── dnf │ │ ├── BDDDNFTest.java │ │ ├── CanonicalDNFEnumerationTest.java │ │ ├── DNFFactorizationTest.java │ │ └── DNFSubsumptionTest.java │ ├── qe │ │ └── QETest.java │ ├── qmc │ │ ├── QuineMcCluskeyTest.java │ │ ├── TermTableTest.java │ │ └── TermTest.java │ └── simplification │ │ ├── AdvancedSimplifierTest.java │ │ ├── BackboneSimplifierTest.java │ │ ├── DistributiveSimplifierTest.java │ │ ├── FactorOutSimplificationTest.java │ │ └── NegationMinimizerTest.java │ └── util │ ├── CollectionHelperTest.java │ ├── ComparablePairTest.java │ ├── FormulaHelperTest.java │ ├── FormulaRandomizerTest.java │ └── PairTest.java └── resources ├── backbones ├── backbone_large_formula.txt └── backbone_small_formulas.txt ├── dimacs └── malformed │ └── contains-line-without-zero.cnf ├── dnnf ├── both_bdd_dnnf_1.cnf ├── both_bdd_dnnf_2.cnf ├── both_bdd_dnnf_3.cnf ├── both_bdd_dnnf_4.cnf └── both_bdd_dnnf_5.cnf ├── drup ├── avg_input.cnf ├── pg4_input.cnf └── simple_input.cnf ├── formulas ├── formula1.txt ├── formula2.txt ├── formula3.txt ├── large_formula.txt ├── simplify_formulas.txt └── small_formulas.txt ├── graphs ├── graph30.txt ├── graph50.txt └── io │ ├── graphs-dimacs │ ├── 30_f.col │ ├── 30_t.col │ ├── 30_t.map │ ├── 50p1_f.col │ ├── 50p1_t.col │ ├── 50p1_t.map │ ├── small_f.col │ ├── small_t.col │ └── small_t.map │ └── temp │ ├── .empty │ ├── 30_f.col │ ├── 30_t.col │ ├── 30_t.map │ ├── 50p1_f.col │ ├── 50p1_t.col │ ├── 50p1_t.map │ ├── small_f.col │ ├── small_t.col │ └── small_t.map ├── longrunning └── wms │ ├── file_rwms_wcnf_L2_V100_C300_0.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_0.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_1.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_2.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_3.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_4.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_5.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_6.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_7.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_8.wcnf │ ├── file_rwms_wcnf_L3_V70_C300_9.wcnf │ ├── frb10-6-1.wcnf │ ├── frb10-6-2.wcnf │ ├── frb10-6-3.wcnf │ ├── frb10-6-4.wcnf │ ├── frb15-9-1.wcnf │ ├── frb15-9-2.wcnf │ ├── frb15-9-3.wcnf │ ├── frb15-9-4.wcnf │ ├── frb15-9-5.wcnf │ ├── frb20-11-1.wcnf │ ├── frb20-11-2.wcnf │ ├── frb20-11-3.wcnf │ ├── frb20-11-4.wcnf │ ├── frb20-11-5.wcnf │ ├── frb25-13-1.wcnf │ ├── frb25-13-2.wcnf │ ├── frb25-13-3.wcnf │ ├── frb25-13-4.wcnf │ ├── frb25-13-5.wcnf │ ├── ram_k3_n4.ra1.wcnf │ ├── ram_k3_n5.ra1.wcnf │ ├── ram_k3_n6.ra1.wcnf │ └── result.txt ├── maxsat ├── c-fat200-2.clq.cnf ├── c5315-bug-gate-0.dimacs.seq.filtered.cnf ├── c6288-bug-gate-0.dimacs.seq.filtered.cnf ├── c7552-bug-gate-0.dimacs.seq.filtered.cnf ├── mot_comb1._red-gate-0.dimacs.seq.filtered.cnf ├── mot_comb2._red-gate-0.dimacs.seq.filtered.cnf ├── mot_comb3._red-gate-0.dimacs.seq.filtered.cnf └── s15850-bug-onevec-gate-0.dimacs.seq.filtered.cnf ├── partialmaxsat ├── c1355_F1001gat-1048gat@1.wcnf ├── c1355_F1183gat-1262gat@1.wcnf ├── c1355_F1229gat@1.wcnf ├── c1355_F176gat-1278gat@1.wcnf ├── normalized-s3-3-3-1pb.wcnf ├── normalized-s3-3-3-2pb.wcnf ├── normalized-s3-3-3-3pb.wcnf └── term1_gr_2pin_w4.shuffled.cnf ├── partialweightedmaxsat ├── 404.wcsp.log.wcnf ├── 54.wcsp.log.wcnf ├── 8.wcsp.log.wcnf ├── bmo │ ├── normalized-factor-size=9-P=11-Q=283.opb.wcnf │ ├── normalized-factor-size=9-P=11-Q=53.opb.wcnf │ ├── normalized-factor-size=9-P=13-Q=179.opb.wcnf │ ├── normalized-factor-size=9-P=17-Q=347.opb.wcnf │ ├── normalized-factor-size=9-P=17-Q=487.opb.wcnf │ └── normalized-factor-size=9-P=23-Q=293.opb.wcnf ├── large │ ├── large_industrial.wcnf │ ├── large_weights.wcnf │ └── t3g3-5555.spn.wcnf └── term1_gr_2pin_w4.shuffled.cnf ├── sat ├── 3col40_5_10.shuffled.cnf ├── 9symml_gr_rcs_w5.shuffled.cnf ├── 9symml_gr_rcs_w6.shuffled.cnf ├── D1119_M23.cnf ├── apex7_gr_rcs_w5.shuffled.cnf ├── avg-checker-4-23.shuffled.cnf ├── bart30.shuffled.cnf ├── c499_gr_rcs_w6.shuffled.cnf ├── ca032.shuffled.cnf ├── ca064.shuffled.cnf ├── ca128.shuffled.cnf ├── dp02s02.shuffled.cnf ├── example2_gr_rcs_w6.shuffled.cnf ├── grid_10_20.shuffled.cnf ├── med19.shuffled.cnf ├── results.txt ├── term1_gr_rcs_w3.shuffled.cnf ├── term1_gr_rcs_w4.shuffled.cnf ├── too_large_gr_rcs_w5.shuffled.cnf ├── too_large_gr_rcs_w6.shuffled.cnf ├── unsat │ ├── aim-100-1_6-no-1.cnf │ ├── aim-100-1_6-no-2.cnf │ ├── aim-100-1_6-no-3.cnf │ ├── aim-100-1_6-no-4.cnf │ ├── aim-100-2_0-no-1.cnf │ ├── aim-100-2_0-no-2.cnf │ ├── aim-100-2_0-no-3.cnf │ ├── aim-100-2_0-no-4.cnf │ ├── aim-200-1_6-no-1.cnf │ ├── aim-200-1_6-no-2.cnf │ ├── aim-200-1_6-no-3.cnf │ ├── aim-200-1_6-no-4.cnf │ ├── aim-200-2_0-no-1.cnf │ ├── aim-200-2_0-no-2.cnf │ ├── aim-200-2_0-no-3.cnf │ ├── aim-200-2_0-no-4.cnf │ ├── aim-50-1_6-no-1.cnf │ ├── aim-50-1_6-no-2.cnf │ ├── aim-50-1_6-no-3.cnf │ ├── aim-50-1_6-no-4.cnf │ ├── aim-50-2_0-no-1.cnf │ ├── aim-50-2_0-no-2.cnf │ ├── aim-50-2_0-no-3.cnf │ ├── aim-50-2_0-no-4.cnf │ ├── bf0432-007.cnf │ ├── bf1355-075.cnf │ ├── bf1355-638.cnf │ ├── bf2670-001.cnf │ ├── pret150_25.cnf │ ├── pret150_40.cnf │ ├── pret150_60.cnf │ ├── pret150_75.cnf │ ├── pret60_25.cnf │ ├── pret60_40.cnf │ ├── pret60_60.cnf │ └── pret60_75.cnf └── x1_16.shuffled.cnf └── writers ├── bdd ├── a_bdd.dot ├── a_bdd.txt ├── and_bdd.dot ├── and_bdd.txt ├── equiv_bdd.dot ├── equiv_bdd.txt ├── false_bdd.dot ├── false_bdd.txt ├── formula-dynamic_bdd.dot ├── formula-dynamic_bdd.txt ├── formula-fixedStyle_bdd.dot ├── formula-fixedStyle_bdd.txt ├── formula_bdd.dot ├── formula_bdd.txt ├── impl_bdd.dot ├── impl_bdd.txt ├── not_a_bdd.dot ├── not_a_bdd.txt ├── not_bdd.dot ├── not_bdd.txt ├── or_bdd.dot ├── or_bdd.txt ├── true_bdd.dot └── true_bdd.txt ├── formulas-ast ├── f1-ast.dot ├── f1-ast.txt ├── f10-ast.dot ├── f10-ast.txt ├── f2-ast.dot ├── f2-ast.txt ├── f3-ast.dot ├── f3-ast.txt ├── f4-ast.dot ├── f4-ast.txt ├── f5-ast.dot ├── f5-ast.txt ├── f6-ast.dot ├── f6-ast.txt ├── f7-ast.dot ├── f7-ast.txt ├── f8-ast.dot ├── f8-ast.txt ├── f8-ownLabels-ast.dot ├── f8-ownLabels-ast.txt ├── f9-ast.dot ├── f9-ast.txt ├── false-ast.dot ├── false-ast.txt ├── not_x-ast.dot ├── not_x-ast.txt ├── true-ast.dot ├── true-ast.txt ├── x-ast.dot └── x-ast.txt ├── formulas-dag ├── f1.dot ├── f1.txt ├── f10.dot ├── f10.txt ├── f2.dot ├── f2.txt ├── f3.dot ├── f3.txt ├── f4.dot ├── f4.txt ├── f5.dot ├── f5.txt ├── f6.dot ├── f6.txt ├── f7.dot ├── f7.txt ├── f8.dot ├── f8.txt ├── f9.dot ├── f9.txt ├── false.dot ├── false.txt ├── not_x.dot ├── not_x.txt ├── true.dot ├── true.txt ├── x.dot └── x.txt ├── formulas-dimacs ├── f1_f.cnf ├── f1_t.cnf ├── f1_t.map ├── f2_f.cnf ├── f2_t.cnf ├── f2_t.map ├── f3_f.cnf ├── f3_t.cnf ├── f3_t.map ├── f4_f.cnf ├── f4_t.cnf ├── f4_t.map ├── f5_f.cnf ├── f5_t.cnf ├── f5_t.map ├── f6_f.cnf ├── f6_t.cnf ├── f6_t.map ├── f7_f.cnf ├── f7_t.cnf ├── f7_t.map ├── false_f.cnf ├── false_t.cnf ├── false_t.map ├── not_x_f.cnf ├── not_x_t.cnf ├── not_x_t.map ├── true_f.cnf ├── true_t.cnf ├── true_t.map ├── x_f.cnf ├── x_t.cnf └── x_t.map ├── graph ├── 30-dynamic.dot ├── 30-dynamic.txt ├── 30.dot ├── 30.txt ├── 50p1.dot ├── 50p1.txt ├── small-fixedStyle.dot ├── small-fixedStyle.txt ├── small.dot └── small.txt └── temp └── .empty /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | build: 7 | runs-on: ${{ matrix.os }} 8 | strategy: 9 | matrix: 10 | os: [ ubuntu-latest, macos-latest, windows-latest ] 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Set up JDK 1.8 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 1.8 17 | - name: Build with Maven 18 | run: mvn -B package 19 | - name: Upload coverage reports to Codecov 20 | uses: codecov/codecov-action@v4.0.1 21 | with: 22 | token: ${{ secrets.CODECOV_TOKEN }} 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # IntelliJ IDEA files 5 | .idea/ 6 | .idea_modules/ 7 | *.iml 8 | 9 | # vim swap files 10 | *.swp 11 | 12 | # encode files 13 | target/ 14 | .sonar/ 15 | 16 | # test logs 17 | src/test/resources/maxsat/log.txt 18 | src/test/resources/partialmaxsat/log.txt 19 | src/test/resources/partialweightedmaxsat/log.txt 20 | 21 | # test temporary files 22 | src/test/resources/writers/temp/*.dot 23 | src/test/resources/writers/temp/*.txt 24 | src/test/resources/writers/temp/*.cnf 25 | src/test/resources/writers/temp/*.map 26 | 27 | # LSP 28 | .settings 29 | .classpath 30 | .project 31 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: yes 3 | 4 | coverage: 5 | precision: 1 6 | round: down 7 | range: "70...100" 8 | 9 | parsers: 10 | gcov: 11 | branch_detection: 12 | conditional: no 13 | loop: no 14 | method: no 15 | macro: no 16 | 17 | comment: 18 | layout: "reach,diff,flags,tree" 19 | behavior: default 20 | require_changes: no 21 | -------------------------------------------------------------------------------- /doc/logo/logo_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/doc/logo/logo_big.png -------------------------------------------------------------------------------- /src/main/java/org/logicng/cardinalityconstraints/CCAtMostOne.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.cardinalityconstraints; 30 | 31 | import org.logicng.datastructures.EncodingResult; 32 | import org.logicng.formulas.Variable; 33 | 34 | /** 35 | * The interface for at-most-one (AMO) cardinality constraints. 36 | * @version 2.0.0 37 | * @since 1.0 38 | */ 39 | public interface CCAtMostOne { 40 | 41 | /** 42 | * Builds a cardinality constraint of the form {@code var_1 + var_2 + ... + var_n <= 1}. 43 | * @param result the result for the encoding 44 | * @param vars the variables {@code var_1 ... var_n} 45 | */ 46 | void build(final EncodingResult result, final Variable... vars); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/configurations/Configuration.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.configurations; 30 | 31 | /** 32 | * A configuration in LogicNG. 33 | * @version 1.0 34 | * @since 1.0 35 | */ 36 | public abstract class Configuration { 37 | protected final ConfigurationType type; 38 | 39 | /** 40 | * Constructs a new configuration with a given type. 41 | * @param type the configuration type 42 | */ 43 | protected Configuration(final ConfigurationType type) { 44 | this.type = type; 45 | } 46 | 47 | /** 48 | * Returns the type of this configuration. 49 | * @return the type of this configuration 50 | */ 51 | public ConfigurationType type() { 52 | return this.type; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/configurations/ConfigurationType.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.configurations; 30 | 31 | /** 32 | * The different types of configurations in LogicNG. 33 | * @version 2.0.0 34 | * @since 1.1 35 | */ 36 | public enum ConfigurationType { 37 | FORMULA_FACTORY, 38 | CNF, 39 | MINISAT, 40 | GLUCOSE, 41 | MAXSAT, 42 | MUS, 43 | CC_ENCODER, 44 | PB_ENCODER, 45 | FORMULA_RANDOMIZER, 46 | ADVANCED_SIMPLIFIER 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/CType.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas; 30 | 31 | /** 32 | * Comparison types for pseudo-Boolean constraints. 33 | * @version 1.0 34 | * @since 1.0 35 | */ 36 | public enum CType { 37 | EQ, 38 | GT, 39 | GE, 40 | LT, 41 | LE 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/FormulaFunction.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas; 30 | 31 | /** 32 | * A function on a formula. 33 | * @param the result type of the function 34 | * @version 2.0.0 35 | * @since 1.0 36 | */ 37 | @FunctionalInterface 38 | public interface FormulaFunction { 39 | 40 | /** 41 | * Applies this function to a given formula. 42 | * @param formula the input formula 43 | * @param cache indicates whether the result should be cached in this formula's cache 44 | * @return the result of the application 45 | */ 46 | T apply(Formula formula, boolean cache); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/FormulaPredicate.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas; 30 | 31 | /** 32 | * A predicate on a formula. 33 | * @version 2.0.0 34 | * @since 1.0 35 | */ 36 | @FunctionalInterface 37 | public interface FormulaPredicate { 38 | 39 | /** 40 | * Tests the predicate on a given formula. 41 | * @param formula the input formula 42 | * @param cache indicates whether the result should be cached in the formula's cache 43 | * @return {@code true} if the formula holds, {@code false} otherwise 44 | */ 45 | boolean test(Formula formula, boolean cache); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/FormulaTransformation.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas; 30 | 31 | /** 32 | * A transformation on a formula. 33 | * @version 2.0.0 34 | * @since 1.0 35 | */ 36 | @FunctionalInterface 37 | public interface FormulaTransformation { 38 | 39 | /** 40 | * Returns the transformed formula. 41 | * @param formula the input formula 42 | * @param cache indicated whether the result (and associated predicates) should be cached in the formula's cache. 43 | * @return the transformed formula 44 | */ 45 | Formula apply(Formula formula, boolean cache); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/Variable.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas; 30 | 31 | /** 32 | * Boolean variables. 33 | *

34 | * A variable is a shortcut for a positive literal. 35 | * @version 1.0 36 | * @since 1.0 37 | */ 38 | public class Variable extends Literal { 39 | 40 | /** 41 | * Constructor. 42 | * @param name the literal name 43 | * @param f the factory which created this literal 44 | */ 45 | protected Variable(final String name, FormulaFactory f) { 46 | super(name, true, f); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/formulas/cache/CacheEntry.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.formulas.cache; 30 | 31 | /** 32 | * Interface for a cache entry in the formula cache. 33 | * @version 1.0 34 | * @since 1.0 35 | */ 36 | public interface CacheEntry { 37 | /** 38 | * Returns the description for this entry. 39 | * @return the description for this entry 40 | */ 41 | String description(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/functions/NumberOfAtomsFunction.java: -------------------------------------------------------------------------------- 1 | package org.logicng.functions; 2 | 3 | import static org.logicng.formulas.cache.FunctionCacheEntry.NUMBER_OF_ATOMS; 4 | 5 | import org.logicng.formulas.BinaryOperator; 6 | import org.logicng.formulas.Formula; 7 | import org.logicng.formulas.FormulaFunction; 8 | import org.logicng.formulas.NAryOperator; 9 | import org.logicng.formulas.Not; 10 | 11 | /** 12 | * A function that computes the number of atoms occurring in a given formula. 13 | * @version 2.2.0 14 | * @since 2.2.0 15 | */ 16 | public class NumberOfAtomsFunction implements FormulaFunction { 17 | 18 | private final static NumberOfAtomsFunction INSTANCE = new NumberOfAtomsFunction(); 19 | 20 | /** 21 | * Private empty constructor. Singleton class. 22 | */ 23 | private NumberOfAtomsFunction() { 24 | // Intentionally left empty 25 | } 26 | 27 | /** 28 | * Returns the singleton of the function. 29 | * @return the function instance 30 | */ 31 | public static NumberOfAtomsFunction get() { 32 | return INSTANCE; 33 | } 34 | 35 | @Override 36 | public Long apply(final Formula formula, final boolean cache) { 37 | final Object cached = formula.functionCacheEntry(NUMBER_OF_ATOMS); 38 | if (cached != null) { 39 | return (Long) cached; 40 | } 41 | long result = 0L; 42 | switch (formula.type()) { 43 | case FALSE: 44 | case TRUE: 45 | case LITERAL: 46 | case PBC: 47 | result = 1L; 48 | break; 49 | case NOT: 50 | result = apply(((Not) formula).operand(), cache); 51 | break; 52 | case IMPL: 53 | case EQUIV: 54 | final BinaryOperator binary = (BinaryOperator) formula; 55 | result = apply(binary.left(), cache) + apply(binary.right(), cache); 56 | break; 57 | case OR: 58 | case AND: 59 | final NAryOperator nary = (NAryOperator) formula; 60 | for (final Formula op : nary) { 61 | result += apply(op, cache); 62 | } 63 | break; 64 | default: 65 | throw new IllegalStateException("Unknown formula type " + formula.type()); 66 | } 67 | if (cache) { 68 | formula.setFunctionCacheEntry(NUMBER_OF_ATOMS, result); 69 | } 70 | return result; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/functions/NumberOfNodesFunction.java: -------------------------------------------------------------------------------- 1 | package org.logicng.functions; 2 | 3 | import static org.logicng.formulas.cache.FunctionCacheEntry.NUMBER_OF_NODES; 4 | 5 | import org.logicng.formulas.BinaryOperator; 6 | import org.logicng.formulas.Formula; 7 | import org.logicng.formulas.FormulaFunction; 8 | import org.logicng.formulas.NAryOperator; 9 | import org.logicng.formulas.Not; 10 | import org.logicng.formulas.PBConstraint; 11 | 12 | /** 13 | * A function that computes the number of nodes of a given formula. 14 | * @version 2.2.0 15 | * @since 2.2.0 16 | */ 17 | public class NumberOfNodesFunction implements FormulaFunction { 18 | 19 | private final static NumberOfNodesFunction INSTANCE = new NumberOfNodesFunction(); 20 | 21 | /** 22 | * Private empty constructor. Singleton class. 23 | */ 24 | private NumberOfNodesFunction() { 25 | // Intentionally left empty 26 | } 27 | 28 | /** 29 | * Returns the singleton of the function. 30 | * @return the function instance 31 | */ 32 | public static NumberOfNodesFunction get() { 33 | return INSTANCE; 34 | } 35 | 36 | @Override 37 | public Long apply(final Formula formula, final boolean cache) { 38 | final Object cached = formula.functionCacheEntry(NUMBER_OF_NODES); 39 | if (cached != null) { 40 | return (Long) cached; 41 | } 42 | long result; 43 | switch (formula.type()) { 44 | case FALSE: 45 | case TRUE: 46 | case LITERAL: 47 | result = 1L; 48 | break; 49 | case NOT: 50 | result = apply(((Not) formula).operand(), cache) + 1L; 51 | break; 52 | case IMPL: 53 | case EQUIV: 54 | final BinaryOperator binary = (BinaryOperator) formula; 55 | result = apply(binary.left(), cache) + apply(binary.right(), cache) + 1L; 56 | break; 57 | case OR: 58 | case AND: 59 | final NAryOperator nary = (NAryOperator) formula; 60 | result = 1L; 61 | for (final Formula op : nary) { 62 | result += apply(op, cache); 63 | } 64 | break; 65 | case PBC: 66 | final PBConstraint pbc = (PBConstraint) formula; 67 | result = 1L + pbc.operands().length; 68 | break; 69 | default: 70 | throw new IllegalStateException("Unknown formula type " + formula.type()); 71 | } 72 | if (cache) { 73 | formula.setFunctionCacheEntry(NUMBER_OF_NODES, result); 74 | } 75 | return result; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/handlers/BDDHandler.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.handlers; 30 | 31 | /** 32 | * Interface for a handler for the BDD factory. 33 | * @version 2.1.0 34 | * @since 1.6.2 35 | */ 36 | public interface BDDHandler extends Handler { 37 | 38 | /** 39 | * This method is called every time a new reference is added, i.e. the method 40 | * {@link org.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel#addRef(int, BDDHandler)} is called. 41 | * @return {@code true} if the BDD generation should be continued, otherwise {@code false} 42 | */ 43 | default boolean newRefAdded() { 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/handlers/ComputationHandler.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.handlers; 30 | 31 | /** 32 | * A computation handler. 33 | * @version 1.6.2 34 | * @since 1.6.2 35 | */ 36 | public abstract class ComputationHandler implements Handler { 37 | 38 | protected boolean aborted; 39 | 40 | @Override 41 | public boolean aborted() { 42 | return this.aborted; 43 | } 44 | 45 | @Override 46 | public void started() { 47 | this.aborted = false; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/handlers/DnnfCompilationHandler.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.handlers; 30 | 31 | /** 32 | * Interface for a handler for DNNF compilations. 33 | * @version 2.1.0 34 | * @since 2.0.0 35 | */ 36 | public interface DnnfCompilationHandler extends Handler { 37 | 38 | /** 39 | * This method is called when a Shannon expansion was performed. 40 | * @return {@code true} when the computation should be continued, {@code false} if it should be aborted with a {@link java.util.concurrent.TimeoutException} 41 | */ 42 | default boolean shannonExpansion() { 43 | return true; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/handlers/OptimizationHandler.java: -------------------------------------------------------------------------------- 1 | package org.logicng.handlers; 2 | 3 | import org.logicng.datastructures.Assignment; 4 | 5 | import java.util.function.Supplier; 6 | 7 | /** 8 | * Interface for an optimization handler. 9 | * @version 2.1.0 10 | * @since 2.1.0 11 | */ 12 | public interface OptimizationHandler extends Handler { 13 | 14 | /** 15 | * Returns a SAT handler which can be used to cancel internal SAT calls of the optimization function. 16 | * @return a SAT handler 17 | */ 18 | SATHandler satHandler(); 19 | 20 | @Override 21 | default boolean aborted() { 22 | return satHandler() != null && satHandler().aborted(); 23 | } 24 | 25 | /** 26 | * This method is called when the solver found a better bound for the optimization. 27 | * @param currentResultProvider a provider for the current result, can be used to examine 28 | * the current result or to use this result if the 29 | * optimization should be aborted 30 | * @return {@code true} if the optimization process should be continued, otherwise {@code false} 31 | */ 32 | default boolean foundBetterBound(final Supplier currentResultProvider) { 33 | return true; 34 | } 35 | 36 | /** 37 | * Returns a SAT handler if the optimization handler is not {@code null}. 38 | * @param handler the optimization handler 39 | * @return The SAT handler if the optimization handler is not {@code null}, otherwise {@code null} 40 | */ 41 | static SATHandler satHandler(final OptimizationHandler handler) { 42 | return handler == null ? null : handler.satHandler(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/io/graphical/generators/BddLabelMapper.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.io.graphical.generators; 30 | 31 | import org.logicng.knowledgecompilation.bdds.jbuddy.BDDKernel; 32 | 33 | /** 34 | * An abstract super class for a label mapper for a graphical representation of a BDD. 35 | * @version 2.4.0 36 | * @since 2.4.0 37 | */ 38 | public abstract class BddLabelMapper extends BddMapper implements LabelMapper { 39 | 40 | /** 41 | * Constructs a new BDD label mapper for a given BDD kernel. The BDDs must be constructed with this kernel. 42 | * @param kernel a BDD kernel 43 | */ 44 | public BddLabelMapper(final BDDKernel kernel) { 45 | super(kernel); 46 | } 47 | 48 | @Override 49 | public abstract String computeLabel(final Integer content); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/io/graphical/generators/EdgeStyleMapper.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.io.graphical.generators; 30 | 31 | import org.logicng.io.graphical.GraphicalEdgeStyle; 32 | 33 | /** 34 | * A style mapper for generating graphical representations of formulas, BDDs and graphs. 35 | * This mapper can be used to compute an edge style for the given edge between two node contents. 36 | * @param the type of the node content 37 | * @version 2.4.0 38 | * @since 2.4.0 39 | */ 40 | public interface EdgeStyleMapper { 41 | 42 | /** 43 | * Computes a style for the given edge between two node contents. 44 | * @param source the content of the source node 45 | * @param destination the content of the destination node 46 | * @return the style for the node with this content 47 | */ 48 | GraphicalEdgeStyle computeStyle(T source, T destination); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/io/graphical/generators/LabelMapper.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.io.graphical.generators; 30 | 31 | /** 32 | * A label mapper for generating graphical representations of formulas, BDDs and graphs. 33 | * This mapper can be used to compute a label for the given node content. 34 | * @param the type of the node content 35 | * @version 2.4.0 36 | * @since 2.4.0 37 | */ 38 | @FunctionalInterface 39 | public interface LabelMapper { 40 | 41 | /** 42 | * Computes a label for the given node content. 43 | * @param content the content of the node 44 | * @return the label for the node with this content 45 | */ 46 | String computeLabel(T content); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/knowledgecompilation/bdds/functions/BDDFunction.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.bdds.functions; 30 | 31 | import org.logicng.knowledgecompilation.bdds.BDD; 32 | 33 | /** 34 | * A function on a BDD. 35 | * @param the result type of the function 36 | * @version 2.0.0 37 | * @since 2.0.0 38 | */ 39 | @FunctionalInterface 40 | public interface BDDFunction { 41 | 42 | /** 43 | * Applies this function on a given BDD. 44 | * @param bdd the BDD 45 | * @return the result of the application 46 | */ 47 | T apply(BDD bdd); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/knowledgecompilation/bdds/jbuddy/BDDReorderingMethod.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.bdds.jbuddy; 30 | 31 | /** 32 | * Enumeration of BDD reordering algorithms. 33 | * @version 2.0.0 34 | * @since 2.0.0 35 | */ 36 | public enum BDDReorderingMethod { 37 | BDD_REORDER_NONE, 38 | BDD_REORDER_WIN2, 39 | BDD_REORDER_WIN2ITE, 40 | BDD_REORDER_SIFT, 41 | BDD_REORDER_SIFTITE, 42 | BDD_REORDER_WIN3, 43 | BDD_REORDER_WIN3ITE, 44 | BDD_REORDER_RANDOM 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeGenerator.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.dnnf.datastructures.dtree; 30 | 31 | import org.logicng.formulas.Formula; 32 | 33 | /** 34 | * A generator for a DTree. 35 | * @version 2.0.0 36 | * @since 2.0.0 37 | */ 38 | public interface DTreeGenerator { 39 | 40 | /** 41 | * Generates a DTree for the given CNF. 42 | * @param cnf the CNF 43 | * @return the DTree 44 | */ 45 | DTree generate(final Formula cnf); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/knowledgecompilation/dnnf/functions/DnnfFunction.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.dnnf.functions; 30 | 31 | import org.logicng.formulas.Formula; 32 | import org.logicng.formulas.Variable; 33 | 34 | import java.util.SortedSet; 35 | 36 | /** 37 | * A function which can be applied on a DNNF. 38 | * @param the result type of the function 39 | * @version 2.0.0 40 | * @since 2.0.0 41 | */ 42 | public interface DnnfFunction { 43 | 44 | /** 45 | * Applies this function to a given DNNF 46 | * @param originalVariables the original variables of the DNNF 47 | * @param formula the formula of the DNNF 48 | * @return the result of the function application 49 | */ 50 | RESULT apply(final SortedSet originalVariables, final Formula formula); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/predicates/TermPredicate.java: -------------------------------------------------------------------------------- 1 | package org.logicng.predicates; 2 | 3 | import org.logicng.formulas.FType; 4 | import org.logicng.formulas.Formula; 5 | import org.logicng.formulas.FormulaPredicate; 6 | import org.logicng.formulas.NAryOperator; 7 | 8 | /** 9 | * Term predicate. Indicates whether a formula is a minterm (conjunction of literals) or maxterm (disjunction of literals). 10 | * @version 2.3.0 11 | * @since 2.2.0 12 | */ 13 | public final class TermPredicate implements FormulaPredicate { 14 | 15 | private final static TermPredicate MINTERM_PREDICATE = new TermPredicate(true); 16 | private final static TermPredicate MAXTERM_PREDICATE = new TermPredicate(false); 17 | 18 | private final boolean mintermPredicate; 19 | 20 | /** 21 | * Private empty constructor. Singleton class. 22 | */ 23 | private TermPredicate(final boolean mintermPredicate) { 24 | this.mintermPredicate = mintermPredicate; 25 | } 26 | 27 | /** 28 | * Returns the singleton minterm predicate. 29 | * @return the minterm predicate instance 30 | */ 31 | public static TermPredicate minterm() { 32 | return MINTERM_PREDICATE; 33 | } 34 | 35 | /** 36 | * Returns the singleton maxterm predicate. 37 | * @return the maxterm predicate instance 38 | */ 39 | public static TermPredicate maxterm() { 40 | return MAXTERM_PREDICATE; 41 | } 42 | 43 | @Override 44 | public boolean test(final Formula formula, final boolean cache) { 45 | switch (formula.type()) { 46 | case TRUE: 47 | case FALSE: 48 | case LITERAL: 49 | return true; 50 | case IMPL: 51 | case EQUIV: 52 | case PBC: 53 | case NOT: 54 | return false; 55 | case OR: 56 | if (this.mintermPredicate) { 57 | return false; 58 | } 59 | return onlyLiteralOperands((NAryOperator) formula); 60 | case AND: 61 | if (!this.mintermPredicate) { 62 | return false; 63 | } 64 | return onlyLiteralOperands((NAryOperator) formula); 65 | default: 66 | throw new IllegalArgumentException("Unknown formula type: " + formula.type()); 67 | } 68 | } 69 | 70 | private boolean onlyLiteralOperands(final NAryOperator nary) { 71 | for (final Formula op : nary) { 72 | if (op.type() != FType.LITERAL) { 73 | return false; 74 | } 75 | } 76 | return true; 77 | } 78 | 79 | @Override 80 | public String toString() { 81 | return this.getClass().getSimpleName(); 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/propositions/Proposition.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.propositions; 30 | 31 | import org.logicng.formulas.Formula; 32 | 33 | /** 34 | * An interface for a proposition in LogicNG. A proposition is a formula with an additional information 35 | * like a textual description or a user-provided object. 36 | * @version 2.0.0 37 | * @since 1.0 38 | */ 39 | public abstract class Proposition { 40 | 41 | /** 42 | * Returns the formula of this proposition. 43 | * @return the formula of this proposition 44 | */ 45 | public abstract Formula formula(); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/propositions/PropositionBackpack.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.propositions; 30 | 31 | /** 32 | * The type for a proposition backpack. An object of a class implementing this interface can be added to a proposition 33 | * in order to transport additional information. 34 | * @version 1.0 35 | * @since 1.0 36 | */ 37 | public interface PropositionBackpack { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/logicng/transformations/simplification/RatingFunction.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.transformations.simplification; 30 | 31 | import org.logicng.formulas.FormulaFunction; 32 | 33 | /** 34 | * A rating function for a formula. 35 | * @param the number type to which the formula is rated 36 | * @version 2.0.0 37 | * @since 2.0.0 38 | */ 39 | @FunctionalInterface 40 | public interface RatingFunction extends FormulaFunction { 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/org/logicng/version.txt: -------------------------------------------------------------------------------- 1 | ${project.version} 2 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/LogicNGTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng; 30 | 31 | import static org.assertj.core.api.Assertions.assertThat; 32 | 33 | import org.logicng.datastructures.Tristate; 34 | import org.logicng.solvers.SATSolver; 35 | 36 | public interface LogicNGTest { 37 | default void assertSolverSat(final SATSolver solver) { 38 | assertThat(solver.sat()).isEqualTo(Tristate.TRUE); 39 | } 40 | 41 | default void assertSolverUnsat(final SATSolver solver) { 42 | assertThat(solver.sat()).isEqualTo(Tristate.FALSE); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/LongRunningTag.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng; 30 | 31 | import org.junit.jupiter.api.Tag; 32 | 33 | import java.lang.annotation.ElementType; 34 | import java.lang.annotation.Retention; 35 | import java.lang.annotation.RetentionPolicy; 36 | import java.lang.annotation.Target; 37 | 38 | @Target(ElementType.METHOD) 39 | @Retention(RetentionPolicy.RUNTIME) 40 | @Tag("longRunning") 41 | public @interface LongRunningTag { 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/RandomTag.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng; 30 | 31 | import org.junit.jupiter.api.Tag; 32 | 33 | import java.lang.annotation.ElementType; 34 | import java.lang.annotation.Retention; 35 | import java.lang.annotation.RetentionPolicy; 36 | import java.lang.annotation.Target; 37 | 38 | @Target(ElementType.METHOD) 39 | @Retention(RetentionPolicy.RUNTIME) 40 | @Tag("random") 41 | public @interface RandomTag { 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/configurations/ConfigurationsTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.configurations; 30 | 31 | import static org.assertj.core.api.Assertions.assertThat; 32 | 33 | import org.junit.jupiter.api.Test; 34 | 35 | /** 36 | * Unit tests for the package configurations. 37 | * @version 2.0.0 38 | * @since 1.1 39 | */ 40 | public class ConfigurationsTest { 41 | 42 | @Test 43 | public void testValueOf() { 44 | assertThat(ConfigurationType.valueOf("CNF")).isEqualTo(ConfigurationType.CNF); 45 | assertThat(ConfigurationType.valueOf("GLUCOSE")).isEqualTo(ConfigurationType.GLUCOSE); 46 | assertThat(ConfigurationType.valueOf("MAXSAT")).isEqualTo(ConfigurationType.MAXSAT); 47 | assertThat(ConfigurationType.valueOf("CC_ENCODER")).isEqualTo(ConfigurationType.CC_ENCODER); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/explanations/mus/MUSConfigTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.explanations.mus; 30 | 31 | import static org.assertj.core.api.Assertions.assertThat; 32 | 33 | import org.junit.jupiter.api.Test; 34 | import org.logicng.transformations.cnf.CNFConfig; 35 | 36 | import java.util.Arrays; 37 | 38 | /** 39 | * Unit tests for the class {@link MUSConfig}. 40 | * @version 2.0.0 41 | * @since 1.1 42 | */ 43 | public class MUSConfigTest { 44 | 45 | @Test 46 | public void testMUSConfiguration() { 47 | final MUSConfig config = MUSConfig.builder().algorithm(MUSConfig.Algorithm.valueOf("DELETION")).build(); 48 | assertThat(config.toString()).isEqualTo(String.format("MUSConfig{%nalgorithm=DELETION%n}%n")); 49 | assertThat(Arrays.asList(CNFConfig.Algorithm.values())).contains(CNFConfig.Algorithm.valueOf("TSEITIN")); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/graphs/io/conditions/ContainsCondition.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.graphs.io.conditions; 30 | 31 | import org.assertj.core.api.Condition; 32 | 33 | import java.util.List; 34 | 35 | /** 36 | * A condition needed for AssertJ-Assertions for {@link org.logicng.graphs.io.GraphDimacsFileWriterTest}. 37 | * @version 1.2 38 | * @since 1.2 39 | */ 40 | public class ContainsCondition extends Condition> { 41 | 42 | private final String element; 43 | 44 | public ContainsCondition(String element) { 45 | this.element = element; 46 | } 47 | 48 | @Override 49 | public boolean matches(List strings) { 50 | return strings.contains(element); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/handlers/BoundedOptimizationHandler.java: -------------------------------------------------------------------------------- 1 | package org.logicng.handlers; 2 | 3 | import org.logicng.datastructures.Assignment; 4 | 5 | import java.util.function.Supplier; 6 | 7 | /** 8 | * Bounded optimization handler for testing purposes. 9 | *

10 | * The handler aborts the optimization if a certain number of starts or a certain number of SAT handler starts is reached. 11 | * @version 2.1.0 12 | * @since 2.1.0 13 | */ 14 | public class BoundedOptimizationHandler implements OptimizationHandler { 15 | private final SATHandler satHandler; 16 | private final int startsLimit; 17 | private int numStarts; 18 | private boolean aborted; 19 | 20 | /** 21 | * Constructs a new instance with the given starts limits. 22 | * @param satHandlerStartsLimit the number of starts limit for the SAT handler, if -1 then no limit is set 23 | * @param startsLimit the number of starts limit, if -1 then no limit is set 24 | */ 25 | public BoundedOptimizationHandler(final int satHandlerStartsLimit, final int startsLimit) { 26 | this.satHandler = new BoundedSatHandler(satHandlerStartsLimit); 27 | this.startsLimit = startsLimit; 28 | this.numStarts = 0; 29 | } 30 | 31 | @Override 32 | public boolean aborted() { 33 | return satHandler.aborted() || this.aborted; 34 | } 35 | 36 | @Override 37 | public void started() { 38 | this.aborted = startsLimit != -1 && ++numStarts >= startsLimit; 39 | } 40 | 41 | @Override 42 | public SATHandler satHandler() { 43 | return satHandler; 44 | } 45 | 46 | @Override 47 | public boolean foundBetterBound(final Supplier currentResultProvider) { 48 | return !aborted; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/handlers/BoundedSatHandler.java: -------------------------------------------------------------------------------- 1 | package org.logicng.handlers; 2 | 3 | /** 4 | * Bounded SAT handler for testing purposes. 5 | *

6 | * The handler aborts the computation if a certain number of starts is reached. 7 | * @version 2.1.0 8 | * @since 2.1.0 9 | */ 10 | public class BoundedSatHandler implements SATHandler { 11 | private final int startsLimit; 12 | private int numStarts; 13 | private boolean aborted; 14 | 15 | /** 16 | * Constructs a new instance with the given starts limit. 17 | * @param startsLimit the number of starts limit, if -1 then no limit is set 18 | */ 19 | public BoundedSatHandler(final int startsLimit) { 20 | this.startsLimit = startsLimit; 21 | this.numStarts = 0; 22 | } 23 | 24 | @Override 25 | public boolean aborted() { 26 | return this.aborted; 27 | } 28 | 29 | @Override 30 | public void started() { 31 | this.aborted = startsLimit != -1 && ++numStarts >= startsLimit; 32 | } 33 | 34 | @Override 35 | public boolean detectedConflict() { 36 | return !aborted; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/handlers/NumberOfNodesBDDHandlerTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.handlers; 30 | 31 | import static org.assertj.core.api.Assertions.assertThatThrownBy; 32 | 33 | import org.junit.jupiter.api.Test; 34 | 35 | /** 36 | * Unit tests for {@link NumberOfNodesBDDHandler}. 37 | * @version 2.0.0 38 | * @since 2.0.0 39 | */ 40 | public class NumberOfNodesBDDHandlerTest { 41 | 42 | @Test 43 | public void testInvalidBound() { 44 | assertThatThrownBy(() -> new NumberOfNodesBDDHandler(-2)) 45 | .isInstanceOf(IllegalArgumentException.class) 46 | .hasMessage("The bound for added nodes must be equal or greater than 0."); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/io/parsers/LexerException.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.io.parsers; 30 | 31 | /** 32 | * A lexer exception for the lexers. 33 | * @version 1.0 34 | * @since 1.0 35 | */ 36 | public final class LexerException extends RuntimeException { 37 | 38 | /** 39 | * Constructs a new lexer exception with a given message. 40 | * @param message the message 41 | */ 42 | public LexerException(final String message) { 43 | super(message); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/io/parsers/ParserException.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.io.parsers; 30 | 31 | /** 32 | * A parser exception for the LogicNG parsers. 33 | * @version 1.0 34 | * @since 1.0 35 | */ 36 | public final class ParserException extends Exception { 37 | 38 | /** 39 | * Constructs a new parser exception with a given message and inner exception. 40 | * @param message the message 41 | * @param exception the inner exception 42 | */ 43 | public ParserException(final String message, final Exception exception) { 44 | super(message, exception); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/knowledgecompilation/bdds/jbuddy/BDDPrimeTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.bdds.jbuddy; 30 | 31 | import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; 32 | 33 | import org.junit.jupiter.api.Test; 34 | 35 | public class BDDPrimeTest { 36 | 37 | @Test 38 | public void testNumberOfBits() { 39 | assertThat(BDDPrime.numberOfBits(0)).isEqualTo(0); 40 | assertThat(BDDPrime.numberOfBits(1)).isEqualTo(1); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/knowledgecompilation/dnnf/datastructures/dtree/DTreeNodeTest.java: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // __ _ _ ________ // 3 | // / / ____ ____ _(_)____/ | / / ____/ // 4 | // / / / __ \/ __ `/ / ___/ |/ / / __ // 5 | // / /___/ /_/ / /_/ / / /__/ /| / /_/ / // 6 | // /_____/\____/\__, /_/\___/_/ |_/\____/ // 7 | // /____/ // 8 | // // 9 | // The Next Generation Logic Library // 10 | // // 11 | /////////////////////////////////////////////////////////////////////////// 12 | // // 13 | // Copyright 2015-20xx Christoph Zengler // 14 | // // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); // 16 | // you may not use this file except in compliance with the License. // 17 | // You may obtain a copy of the License at // 18 | // // 19 | // http://www.apache.org/licenses/LICENSE-2.0 // 20 | // // 21 | // Unless required by applicable law or agreed to in writing, software // 22 | // distributed under the License is distributed on an "AS IS" BASIS, // 23 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // 24 | // implied. See the License for the specific language governing // 25 | // permissions and limitations under the License. // 26 | // // 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | package org.logicng.knowledgecompilation.dnnf.datastructures.dtree; 30 | 31 | import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; 32 | 33 | import org.junit.jupiter.api.Test; 34 | import org.logicng.TestWithExampleFormulas; 35 | 36 | /** 37 | * Unit tests for {@link DTreeNode}. 38 | * @version 2.0.0 39 | * @since 2.0.0 40 | */ 41 | public class DTreeNodeTest extends TestWithExampleFormulas { 42 | 43 | @Test 44 | public void testToString() { 45 | final DTreeNode node = new DTreeNode(new DTreeLeaf(1, parse(this.f, "a | b")), new DTreeLeaf(2, parse(this.f, "c | d"))); 46 | assertThat(node.toString()).isEqualTo("DTreeNode: [DTreeLeaf: 1, a | b, DTreeLeaf: 2, c | d]"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/solvers/functions/ModelEnumerationFunctionTest.java: -------------------------------------------------------------------------------- 1 | package org.logicng.solvers.functions; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | import static org.logicng.TestWithExampleFormulas.parse; 5 | 6 | import org.junit.jupiter.api.Test; 7 | import org.logicng.datastructures.Assignment; 8 | import org.logicng.formulas.FormulaFactory; 9 | import org.logicng.solvers.MiniSat; 10 | import org.logicng.solvers.SATSolver; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Units tests for {@link ModelEnumerationFunction}. 16 | * @version 2.3.0 17 | * @since 2.3.0 18 | */ 19 | public class ModelEnumerationFunctionTest { 20 | 21 | private final FormulaFactory f; 22 | 23 | public ModelEnumerationFunctionTest() { 24 | this.f = new FormulaFactory(); 25 | } 26 | 27 | @Test 28 | public void testModelEnumerationSimple() { 29 | final SATSolver solver = MiniSat.miniSat(this.f); 30 | solver.add(parse(this.f, "A & (B | C)")); 31 | final List models = solver.execute(ModelEnumerationFunction.builder().build()); 32 | assertThat(models).containsExactlyInAnyOrder( 33 | new Assignment(this.f.variable("A"), this.f.variable("B"), this.f.variable("C")), 34 | new Assignment(this.f.variable("A"), this.f.variable("B"), this.f.literal("C", false)), 35 | new Assignment(this.f.variable("A"), this.f.literal("B", false), this.f.variable("C")) 36 | ); 37 | } 38 | 39 | @Test 40 | public void testFastEvaluable() { 41 | final SATSolver solver = MiniSat.miniSat(this.f); 42 | solver.add(parse(this.f, "A & (B | C)")); 43 | List models = solver.execute(ModelEnumerationFunction.builder().build()); 44 | assertThat(models).extracting(Assignment::fastEvaluable).containsOnly(false); 45 | models = solver.execute(ModelEnumerationFunction.builder().fastEvaluable(false).build()); 46 | assertThat(models).extracting(Assignment::fastEvaluable).containsOnly(false); 47 | models = solver.execute(ModelEnumerationFunction.builder().fastEvaluable(true).build()); 48 | assertThat(models).extracting(Assignment::fastEvaluable).containsOnly(true); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/solvers/maxsat/MaxSATReader.java: -------------------------------------------------------------------------------- 1 | package org.logicng.solvers.maxsat; 2 | 3 | import org.logicng.formulas.FormulaFactory; 4 | import org.logicng.formulas.Literal; 5 | import org.logicng.solvers.MaxSATSolver; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.FileReader; 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | /** 14 | * Helper class for reading MaxSAT input files in the WDIMACS format. 15 | * @version 2.4.0 16 | * @since 2.4.0 17 | */ 18 | public class MaxSATReader { 19 | 20 | /** 21 | * Read a WDIMACS file to a MaxSAT solver. 22 | * @param solver the MaxSAT solver 23 | * @param fileName the file name to read 24 | * @throws IOException if something goes wrong 25 | */ 26 | static void readCnfToSolver(final MaxSATSolver solver, final String fileName) throws IOException { 27 | final FormulaFactory f = solver.factory(); 28 | final BufferedReader reader = new BufferedReader(new FileReader(fileName)); 29 | boolean pureMaxSat = false; 30 | int hardWeight = -1; 31 | while (reader.ready()) { 32 | final String line = reader.readLine(); 33 | if (line.startsWith("p wcnf")) { 34 | final String[] header = line.trim().split(" ", -1); 35 | if (header.length > 4) { 36 | hardWeight = Integer.parseInt(header[4]); 37 | } 38 | break; 39 | } else if (line.startsWith("p cnf")) { 40 | pureMaxSat = true; 41 | break; 42 | } 43 | } 44 | String[] tokens; 45 | final List literals = new ArrayList<>(); 46 | while (reader.ready()) { 47 | tokens = reader.readLine().trim().split(" "); 48 | assert pureMaxSat ? tokens.length >= 2 : tokens.length >= 3; 49 | assert "0".equals(tokens[tokens.length - 1]); 50 | literals.clear(); 51 | final int weight = Integer.parseInt(tokens[0]); 52 | for (int i = pureMaxSat ? 0 : 1; i < tokens.length - 1; i++) { 53 | if (!tokens[i].isEmpty()) { 54 | final int parsedLit = Integer.parseInt(tokens[i]); 55 | final String var = "v" + Math.abs(parsedLit); 56 | literals.add(parsedLit > 0 ? f.literal(var, true) : f.literal(var, false)); 57 | } 58 | } 59 | if (pureMaxSat) { 60 | solver.addSoftFormula(f.or(literals), 1); 61 | } else if (weight == hardWeight) { 62 | solver.addHardFormula(f.or(literals)); 63 | } else { 64 | solver.addSoftFormula(f.or(literals), weight); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/solvers/maxsat/MaxSatLongRunningTest.java: -------------------------------------------------------------------------------- 1 | package org.logicng.solvers.maxsat; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | import static org.logicng.solvers.maxsat.MaxSATReader.readCnfToSolver; 5 | 6 | import org.junit.jupiter.api.Test; 7 | import org.logicng.LongRunningTag; 8 | import org.logicng.formulas.FormulaFactory; 9 | import org.logicng.solvers.MaxSATSolver; 10 | import org.logicng.solvers.maxsat.algorithms.MaxSATConfig; 11 | 12 | import java.io.File; 13 | import java.io.IOException; 14 | import java.nio.file.Files; 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | import java.util.Objects; 19 | 20 | /** 21 | * MaxSat tests with a long running time. 22 | * @version 2.4.0 23 | * @since 2.4.0 24 | */ 25 | public class MaxSatLongRunningTest { 26 | 27 | @LongRunningTag 28 | @Test 29 | public void testWeightedMaxSat() throws IOException { 30 | final FormulaFactory f = new FormulaFactory(); 31 | final File folder = new File("src/test/resources/longrunning/wms"); 32 | final Map result = readResult(new File("src/test/resources/longrunning/wms/result.txt")); 33 | final MaxSATSolver[] solvers = new MaxSATSolver[3]; 34 | solvers[0] = MaxSATSolver.oll(f); 35 | solvers[1] = MaxSATSolver.incWBO(f, MaxSATConfig.builder().weight(MaxSATConfig.WeightStrategy.DIVERSIFY).build()); 36 | solvers[2] = MaxSATSolver.incWBO(f); 37 | for (final MaxSATSolver solver : solvers) { 38 | final long start = System.currentTimeMillis(); 39 | for (final File file : Objects.requireNonNull(folder.listFiles())) { 40 | if (file.getName().endsWith("wcnf")) { 41 | solver.reset(); 42 | readCnfToSolver(solver, file.getAbsolutePath()); 43 | solver.solve(); 44 | assertThat(solver.result()).isEqualTo(result.get(file.getName())); 45 | } 46 | } 47 | final long stop = System.currentTimeMillis(); 48 | System.out.printf("%-8s: %.2f sec%n", solver.getAlgorithm(), (stop - start) / 1000.0); 49 | } 50 | } 51 | 52 | private Map readResult(final File file) throws IOException { 53 | final Map result = new HashMap<>(); 54 | final List lines = Files.readAllLines(file.toPath()); 55 | for (final String line : lines) { 56 | final String[] tokens = line.split(";"); 57 | result.put(tokens[0], Integer.parseInt(tokens[1])); 58 | } 59 | return result; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/test/java/org/logicng/testutils/TestUtil.java: -------------------------------------------------------------------------------- 1 | package org.logicng.testutils; 2 | 3 | import org.logicng.datastructures.Assignment; 4 | import org.logicng.formulas.Formula; 5 | import org.logicng.formulas.Variable; 6 | import org.logicng.solvers.MiniSat; 7 | import org.logicng.solvers.SATSolver; 8 | 9 | import java.util.List; 10 | import java.util.SortedSet; 11 | 12 | /** 13 | * Help methods for unit testing. 14 | * @version 2.3.0 15 | * @since 2.3.0 16 | */ 17 | public final class TestUtil { 18 | 19 | /** 20 | * Private empty constructor. Class only contains static utility methods. 21 | */ 22 | private TestUtil() { 23 | // Intentionally left empty 24 | } 25 | 26 | /** 27 | * Tests if the two given formulas have the same models when projected to the given set of variables. 28 | * @param f1 first formula 29 | * @param f2 second formula 30 | * @param vars the set of variables to which the models should be projected 31 | * @return {@code true} if the two formulas have the same models when projected to the given set of variables, otherwise {@code false} 32 | */ 33 | public static boolean equivalentModels(final Formula f1, final Formula f2, final SortedSet vars) { 34 | final SATSolver s = MiniSat.miniSat(f1.factory()); 35 | s.add(f1); 36 | final List models1 = s.enumerateAllModels(vars); 37 | s.reset(); 38 | s.add(f2); 39 | final List models2 = s.enumerateAllModels(vars); 40 | if (models1.size() != models2.size()) { 41 | return false; 42 | } 43 | for (final Assignment model : models1) { 44 | if (!models2.contains(model)) { 45 | return false; 46 | } 47 | } 48 | return true; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/resources/dimacs/malformed/contains-line-without-zero.cnf: -------------------------------------------------------------------------------- 1 | 1 2 0 2 | 2 -3 3 | 3 0 4 | -------------------------------------------------------------------------------- /src/test/resources/drup/pg4_input.cnf: -------------------------------------------------------------------------------- 1 | p cnf 20 45 2 | 1 2 3 4 0 3 | 5 6 7 8 0 4 | 9 10 11 12 0 5 | 13 14 15 16 0 6 | 17 18 19 20 0 7 | -1 -5 0 8 | -1 -9 0 9 | -1 -13 0 10 | -1 -17 0 11 | -5 -9 0 12 | -5 -13 0 13 | -5 -17 0 14 | -9 -13 0 15 | -9 -17 0 16 | -13 -17 0 17 | -2 -6 0 18 | -2 -10 0 19 | -2 -14 0 20 | -2 -18 0 21 | -6 -10 0 22 | -6 -14 0 23 | -6 -18 0 24 | -10 -14 0 25 | -10 -18 0 26 | -14 -18 0 27 | -3 -7 0 28 | -3 -11 0 29 | -3 -15 0 30 | -3 -19 0 31 | -7 -11 0 32 | -7 -15 0 33 | -7 -19 0 34 | -11 -15 0 35 | -11 -19 0 36 | -15 -19 0 37 | -4 -8 0 38 | -4 -12 0 39 | -4 -16 0 40 | -4 -20 0 41 | -8 -12 0 42 | -8 -16 0 43 | -8 -20 0 44 | -12 -16 0 45 | -12 -20 0 46 | -16 -20 0 47 | -------------------------------------------------------------------------------- /src/test/resources/drup/simple_input.cnf: -------------------------------------------------------------------------------- 1 | p cnf 4 8 2 | 1 2 -3 0 3 | -1 -2 3 0 4 | 2 3 -4 0 5 | -2 -3 4 0 6 | 1 3 4 0 7 | -1 -3 -4 0 8 | -1 2 4 0 9 | 1 -2 -4 0 10 | -------------------------------------------------------------------------------- /src/test/resources/graphs/graph30.txt: -------------------------------------------------------------------------------- 1 | 0:6 2 | 0:13 3 | 1:21 4 | 2:28 5 | 3:16 6 | 4:28 7 | 5:8 8 | 6:13 9 | 6:19 10 | 6:28 11 | 7:21 12 | 8:17 13 | 8:23 14 | 8:25 15 | 9:12 16 | 9:16 17 | 9:20 18 | 10:16 19 | 10:18 20 | 12:14 21 | 14:16 22 | 15:21 23 | 15:29 24 | 17:24 25 | 17:27 26 | 18:20 27 | 24:27 -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/30_f.col: -------------------------------------------------------------------------------- 1 | p edge 30 27 2 | e 1 2 3 | e 1 3 4 | e 2 3 5 | e 2 13 6 | e 2 7 7 | e 4 5 8 | e 5 14 9 | e 5 24 10 | e 6 7 11 | e 7 10 12 | e 8 9 13 | e 9 18 14 | e 9 21 15 | e 9 23 16 | e 11 12 17 | e 12 15 18 | e 12 16 19 | e 12 17 20 | e 15 26 21 | e 15 27 22 | e 18 19 23 | e 18 20 24 | e 19 23 25 | e 20 22 26 | e 21 22 27 | e 24 25 28 | e 26 27 29 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/30_t.col: -------------------------------------------------------------------------------- 1 | p edge 30 27 2 | e 1 2 3 | e 1 3 4 | e 2 3 5 | e 2 13 6 | e 2 7 7 | e 4 5 8 | e 5 14 9 | e 5 24 10 | e 6 7 11 | e 7 10 12 | e 8 9 13 | e 9 18 14 | e 9 21 15 | e 9 23 16 | e 11 12 17 | e 12 15 18 | e 12 16 19 | e 12 17 20 | e 15 26 21 | e 15 27 22 | e 18 19 23 | e 18 20 24 | e 19 23 25 | e 20 22 26 | e 21 22 27 | e 24 25 28 | e 26 27 29 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/30_t.map: -------------------------------------------------------------------------------- 1 | 0;1 2 | 6;2 3 | 13;3 4 | 1;4 5 | 21;5 6 | 2;6 7 | 28;7 8 | 3;8 9 | 16;9 10 | 4;10 11 | 5;11 12 | 8;12 13 | 19;13 14 | 7;14 15 | 17;15 16 | 23;16 17 | 25;17 18 | 9;18 19 | 12;19 20 | 20;20 21 | 10;21 22 | 18;22 23 | 14;23 24 | 15;24 25 | 29;25 26 | 24;26 27 | 27;27 28 | 11;28 29 | 22;29 30 | 26;30 31 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/50p1_t.map: -------------------------------------------------------------------------------- 1 | 1;1 2 | 0;2 3 | 3;3 4 | 2;4 5 | 4;5 6 | 5;6 7 | 6;7 8 | 7;8 9 | 8;9 10 | 9;10 11 | 10;11 12 | 11;12 13 | 12;13 14 | 13;14 15 | 14;15 16 | 15;16 17 | 16;17 18 | 17;18 19 | 18;19 20 | 19;20 21 | 20;21 22 | 21;22 23 | 22;23 24 | 23;24 25 | 24;25 26 | 25;26 27 | 26;27 28 | 27;28 29 | 28;29 30 | 29;30 31 | 30;31 32 | 31;32 33 | 32;33 34 | 33;34 35 | 34;35 36 | 35;36 37 | 36;37 38 | 37;38 39 | 38;39 40 | 39;40 41 | 40;41 42 | 41;42 43 | 42;43 44 | 43;44 45 | 44;45 46 | 45;46 47 | 46;47 48 | 47;48 49 | 48;49 50 | 49;50 51 | 51;51 52 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/small_f.col: -------------------------------------------------------------------------------- 1 | p edge 3 1 2 | e 1 2 3 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/small_t.col: -------------------------------------------------------------------------------- 1 | p edge 3 1 2 | e 1 2 3 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/graphs-dimacs/small_t.map: -------------------------------------------------------------------------------- 1 | A;1 2 | B;2 3 | C;3 4 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/src/test/resources/graphs/io/temp/.empty -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/30_f.col: -------------------------------------------------------------------------------- 1 | p edge 30 27 2 | e 1 2 3 | e 1 3 4 | e 2 3 5 | e 2 13 6 | e 2 7 7 | e 4 5 8 | e 5 14 9 | e 5 24 10 | e 6 7 11 | e 7 10 12 | e 8 9 13 | e 9 18 14 | e 9 21 15 | e 9 23 16 | e 11 12 17 | e 12 15 18 | e 12 16 19 | e 12 17 20 | e 15 26 21 | e 15 27 22 | e 18 19 23 | e 18 20 24 | e 19 23 25 | e 20 22 26 | e 21 22 27 | e 24 25 28 | e 26 27 29 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/30_t.col: -------------------------------------------------------------------------------- 1 | p edge 30 27 2 | e 1 2 3 | e 1 3 4 | e 2 3 5 | e 2 13 6 | e 2 7 7 | e 4 5 8 | e 5 14 9 | e 5 24 10 | e 6 7 11 | e 7 10 12 | e 8 9 13 | e 9 18 14 | e 9 21 15 | e 9 23 16 | e 11 12 17 | e 12 15 18 | e 12 16 19 | e 12 17 20 | e 15 26 21 | e 15 27 22 | e 18 19 23 | e 18 20 24 | e 19 23 25 | e 20 22 26 | e 21 22 27 | e 24 25 28 | e 26 27 29 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/30_t.map: -------------------------------------------------------------------------------- 1 | 0;1 2 | 6;2 3 | 13;3 4 | 1;4 5 | 21;5 6 | 2;6 7 | 28;7 8 | 3;8 9 | 16;9 10 | 4;10 11 | 5;11 12 | 8;12 13 | 19;13 14 | 7;14 15 | 17;15 16 | 23;16 17 | 25;17 18 | 9;18 19 | 12;19 20 | 20;20 21 | 10;21 22 | 18;22 23 | 14;23 24 | 15;24 25 | 29;25 26 | 24;26 27 | 27;27 28 | 11;28 29 | 22;29 30 | 26;30 31 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/50p1_t.map: -------------------------------------------------------------------------------- 1 | 1;1 2 | 0;2 3 | 3;3 4 | 2;4 5 | 4;5 6 | 5;6 7 | 6;7 8 | 7;8 9 | 8;9 10 | 9;10 11 | 10;11 12 | 11;12 13 | 12;13 14 | 13;14 15 | 14;15 16 | 15;16 17 | 16;17 18 | 17;18 19 | 18;19 20 | 19;20 21 | 20;21 22 | 21;22 23 | 22;23 24 | 23;24 25 | 24;25 26 | 25;26 27 | 26;27 28 | 27;28 29 | 28;29 30 | 29;30 31 | 30;31 32 | 31;32 33 | 32;33 34 | 33;34 35 | 34;35 36 | 35;36 37 | 36;37 38 | 37;38 39 | 38;39 40 | 39;40 41 | 40;41 42 | 41;42 43 | 42;43 44 | 43;44 45 | 44;45 46 | 45;46 47 | 46;47 48 | 47;48 49 | 48;49 50 | 49;50 51 | 51;51 52 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/small_f.col: -------------------------------------------------------------------------------- 1 | p edge 3 1 2 | e 1 2 3 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/small_t.col: -------------------------------------------------------------------------------- 1 | p edge 3 1 2 | e 1 2 3 | -------------------------------------------------------------------------------- /src/test/resources/graphs/io/temp/small_t.map: -------------------------------------------------------------------------------- 1 | A;1 2 | B;2 3 | C;3 4 | -------------------------------------------------------------------------------- /src/test/resources/longrunning/wms/ram_k3_n4.ra1.wcnf: -------------------------------------------------------------------------------- 1 | p wcnf 6 5 2 | 956 1 2 4 0 3 | 696 1 3 5 0 4 | 141 2 3 6 0 5 | 741 4 5 6 0 6 | 928 -1 -2 -3 -4 -5 -6 0 7 | -------------------------------------------------------------------------------- /src/test/resources/longrunning/wms/ram_k3_n5.ra1.wcnf: -------------------------------------------------------------------------------- 1 | p wcnf 10 15 2 | 445 1 2 5 0 3 | 119 1 3 6 0 4 | 676 2 3 8 0 5 | 927 5 6 8 0 6 | 660 1 4 7 0 7 | 565 2 4 9 0 8 | 328 5 7 9 0 9 | 935 3 4 10 0 10 | 544 6 7 10 0 11 | 353 8 9 10 0 12 | 208 -1 -2 -3 -5 -6 -8 0 13 | 478 -1 -2 -4 -5 -7 -9 0 14 | 28 -1 -3 -4 -6 -7 -10 0 15 | 89 -2 -3 -4 -8 -9 -10 0 16 | 305 -5 -6 -7 -8 -9 -10 0 17 | -------------------------------------------------------------------------------- /src/test/resources/longrunning/wms/ram_k3_n6.ra1.wcnf: -------------------------------------------------------------------------------- 1 | p wcnf 15 35 2 | 934 1 2 6 0 3 | 543 1 3 7 0 4 | 212 2 3 10 0 5 | 112 6 7 10 0 6 | 392 1 4 8 0 7 | 878 2 4 11 0 8 | 594 6 8 11 0 9 | 722 3 4 13 0 10 | 453 7 8 13 0 11 | 423 10 11 13 0 12 | 249 1 5 9 0 13 | 373 2 5 12 0 14 | 434 6 9 12 0 15 | 507 3 5 14 0 16 | 166 7 9 14 0 17 | 649 10 12 14 0 18 | 144 4 5 15 0 19 | 698 8 9 15 0 20 | 636 11 12 15 0 21 | 460 13 14 15 0 22 | 674 -1 -2 -3 -6 -7 -10 0 23 | 31 -1 -2 -4 -6 -8 -11 0 24 | 363 -1 -3 -4 -7 -8 -13 0 25 | 915 -2 -3 -4 -10 -11 -13 0 26 | 676 -6 -7 -8 -10 -11 -13 0 27 | 994 -1 -2 -5 -6 -9 -12 0 28 | 506 -1 -3 -5 -7 -9 -14 0 29 | 654 -2 -3 -5 -10 -12 -14 0 30 | 506 -6 -7 -9 -10 -12 -14 0 31 | 170 -1 -4 -5 -8 -9 -15 0 32 | 24 -2 -4 -5 -11 -12 -15 0 33 | 510 -6 -8 -9 -11 -12 -15 0 34 | 614 -3 -4 -5 -13 -14 -15 0 35 | 398 -7 -8 -9 -13 -14 -15 0 36 | 698 -10 -11 -12 -13 -14 -15 0 37 | -------------------------------------------------------------------------------- /src/test/resources/longrunning/wms/result.txt: -------------------------------------------------------------------------------- 1 | file_rwms_wcnf_L2_V100_C300_0.wcnf;40 2 | file_rwms_wcnf_L3_V70_C300_0.wcnf;0 3 | file_rwms_wcnf_L3_V70_C300_1.wcnf;1 4 | file_rwms_wcnf_L3_V70_C300_2.wcnf;0 5 | file_rwms_wcnf_L3_V70_C300_3.wcnf;0 6 | file_rwms_wcnf_L3_V70_C300_4.wcnf;1 7 | file_rwms_wcnf_L3_V70_C300_5.wcnf;0 8 | file_rwms_wcnf_L3_V70_C300_6.wcnf;1 9 | file_rwms_wcnf_L3_V70_C300_7.wcnf;0 10 | file_rwms_wcnf_L3_V70_C300_8.wcnf;0 11 | file_rwms_wcnf_L3_V70_C300_9.wcnf;0 12 | frb10-6-1.wcnf;37027 13 | frb10-6-2.wcnf;38186 14 | frb10-6-3.wcnf;36661 15 | frb10-6-4.wcnf;38918 16 | frb15-9-1.wcnf;341768 17 | frb15-9-2.wcnf;341904 18 | frb15-9-3.wcnf;339456 19 | frb15-9-4.wcnf;340544 20 | frb15-9-5.wcnf;348296 21 | frb20-11-1.wcnf;1245114 22 | frb20-11-2.wcnf;1231854 23 | frb20-11-3.wcnf;1240473 24 | frb20-11-4.wcnf;1231633 25 | frb20-11-5.wcnf;1237821 26 | frb25-13-1.wcnf;3455274 27 | frb25-13-2.wcnf;3461468 28 | frb25-13-3.wcnf;3481680 29 | frb25-13-4.wcnf;3402462 30 | frb25-13-5.wcnf;3425608 31 | frb30-15-1.wcnf;8072900 32 | frb30-15-2.wcnf;8091842 33 | frb30-15-3.wcnf;8072449 34 | frb30-15-4.wcnf;8071547 35 | frb30-15-5.wcnf;8061625 36 | ram_k3_n4.ra1.wcnf;0 37 | ram_k3_n5.ra1.wcnf;0 38 | ram_k3_n6.ra1.wcnf;0 39 | -------------------------------------------------------------------------------- /src/test/resources/partialweightedmaxsat/8.wcsp.log.wcnf: -------------------------------------------------------------------------------- 1 | c ./../WCSP/SPOT5/8.wcsp 2 | p wcnf 12 25 13 3 | 13 1 2 3 4 0 4 | 13 -1 2 -3 4 0 5 | 13 1 -2 3 -4 0 6 | 13 1 2 5 6 0 7 | 13 -1 2 -5 6 0 8 | 13 1 -2 5 -6 0 9 | 13 1 2 7 8 0 10 | 13 -1 2 -7 8 0 11 | 13 1 -2 7 -8 0 12 | 13 3 4 5 6 0 13 | 13 -3 4 -5 6 0 14 | 13 3 -4 5 -6 0 15 | 13 3 4 7 8 0 16 | 13 -3 4 -7 8 0 17 | 13 3 -4 7 -8 0 18 | 13 9 10 0 19 | 13 10 11 0 20 | 1 -1 -2 0 21 | 1 -3 -4 0 22 | 1 -5 -6 0 23 | 1 -7 -8 0 24 | 2 -9 0 25 | 2 -10 0 26 | 2 -11 0 27 | 2 -12 0 28 | -------------------------------------------------------------------------------- /src/test/resources/sat/results.txt: -------------------------------------------------------------------------------- 1 | 3col40_5_1.shuffled.cnf;false 2 | 3col40_5_10.shuffled.cnf;false 3 | 3col40_5_2.shuffled.cnf;false 4 | 3col40_5_3.shuffled.cnf;false 5 | 3col40_5_4.shuffled.cnf;false 6 | 3col40_5_5.shuffled.cnf;false 7 | 3col40_5_6.shuffled.cnf;false 8 | 3col40_5_7.shuffled.cnf;false 9 | 3col40_5_8.shuffled.cnf;false 10 | 3col40_5_9.shuffled.cnf;false 11 | 9symml_gr_rcs_w5.shuffled.cnf;false 12 | 9symml_gr_rcs_w6.shuffled.cnf;true 13 | apex7_gr_2pin_w4.shuffled.cnf;false 14 | apex7_gr_2pin_w5.shuffled.cnf;true 15 | apex7_gr_rcs_w5.shuffled.cnf;true 16 | avg-checker-4-23.shuffled.cnf;false 17 | bart28.shuffled.cnf;true 18 | bart29.shuffled.cnf;true 19 | bart30.shuffled.cnf;true 20 | c499_gr_rcs_w5.shuffled.cnf;false 21 | c499_gr_rcs_w6.shuffled.cnf;true 22 | ca032.shuffled.cnf;false 23 | ca064.shuffled.cnf;false 24 | ca128.shuffled.cnf;false 25 | D1119_M20.cnf;true 26 | D1119_M23.cnf;true 27 | dp02s02.shuffled.cnf;true 28 | example2_gr_rcs_w5.shuffled.cnf;false 29 | example2_gr_rcs_w6.shuffled.cnf;true 30 | grid_10_15.shuffled.cnf;false 31 | grid_10_20.shuffled.cnf;false 32 | med11.shuffled.cnf;true 33 | med17.shuffled.cnf;true 34 | med19.shuffled.cnf;true 35 | term1_gr_2pin_w3.shuffled.cnf;false 36 | term1_gr_2pin_w4.shuffled.cnf;true 37 | term1_gr_rcs_w3.shuffled.cnf;false 38 | term1_gr_rcs_w4.shuffled.cnf;true 39 | too_large_gr_rcs_w5.shuffled.cnf;false 40 | too_large_gr_rcs_w6.shuffled.cnf;false 41 | x1_16.shuffled.cnf;false 42 | -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-1_6-no-1.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-1_6-no-1.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 80 12 | 16 23 42 0 13 | -16 23 42 0 14 | 26 41 -42 0 15 | -26 41 -42 0 16 | 32 -41 -42 0 17 | 6 15 -41 0 18 | -6 15 -32 0 19 | 1 -32 46 0 20 | -1 -32 46 0 21 | -15 -41 -46 0 22 | -15 -21 -46 0 23 | -23 33 38 0 24 | -23 -33 38 0 25 | 8 22 33 0 26 | 8 22 -33 0 27 | -22 37 -38 0 28 | 13 36 -37 0 29 | 13 -22 -36 0 30 | -13 -22 -37 0 31 | 11 -23 47 0 32 | -8 11 -47 0 33 | -8 -11 39 0 34 | -11 27 -39 0 35 | -8 -11 -39 0 36 | -7 26 29 0 37 | -7 -26 29 0 38 | -13 20 36 0 39 | -13 17 20 0 40 | 5 -17 20 0 41 | 5 -19 -45 0 42 | -5 -10 -45 0 43 | 6 25 47 0 44 | -6 -10 25 0 45 | -2 -27 37 0 46 | -27 -36 40 0 47 | 18 39 -40 0 48 | -2 -19 31 0 49 | 5 18 -30 0 50 | -31 -43 -50 0 51 | 10 -30 43 0 52 | 10 -41 43 0 53 | 19 21 29 0 54 | 37 42 45 0 55 | -20 27 40 0 56 | -21 -36 48 0 57 | 31 -36 -48 0 58 | 3 -9 -18 0 59 | 16 -40 -47 0 60 | 1 -18 21 0 61 | 2 28 32 0 62 | -1 -24 -50 0 63 | -12 35 49 0 64 | -6 -36 45 0 65 | 7 12 -43 0 66 | 7 30 -43 0 67 | -5 9 -17 0 68 | 3 14 50 0 69 | -12 17 -49 0 70 | 24 34 49 0 71 | 14 -20 24 0 72 | -9 35 -49 0 73 | -4 -47 50 0 74 | 4 44 -44 0 75 | 28 -28 -38 0 76 | 2 4 -48 0 77 | -20 35 -44 0 78 | 30 -31 -43 0 79 | -14 -29 35 0 80 | -20 35 -35 0 81 | 19 -22 -24 0 82 | -25 -28 48 0 83 | -14 -34 44 0 84 | 9 20 44 0 85 | -3 9 -29 0 86 | 17 34 -34 0 87 | 12 48 0 88 | -12 -25 -43 0 89 | -25 -31 48 0 90 | 14 -16 49 0 91 | -3 -4 -35 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-1_6-no-2.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-1_6-no-2.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 80 12 | 5 17 37 0 13 | 24 28 37 0 14 | 24 -28 40 0 15 | 4 -28 -40 0 16 | 4 -24 29 0 17 | 13 -24 -29 0 18 | -13 -24 -29 0 19 | -4 10 -17 0 20 | -4 -10 -17 0 21 | 26 33 -37 0 22 | 5 -26 34 0 23 | 33 -34 48 0 24 | 33 -37 -48 0 25 | 5 -33 -37 0 26 | 2 -5 10 0 27 | 2 -5 -10 0 28 | -2 15 47 0 29 | 15 30 -47 0 30 | -2 -15 30 0 31 | 20 -30 42 0 32 | -2 20 -30 0 33 | 13 -20 29 0 34 | 13 16 -20 0 35 | -13 -20 31 0 36 | -13 16 -31 0 37 | -16 23 38 0 38 | -16 19 -38 0 39 | -19 23 -38 0 40 | 14 -23 34 0 41 | 1 14 -34 0 42 | -1 9 14 0 43 | -1 -9 -23 0 44 | -14 21 -23 0 45 | -14 -16 -21 0 46 | 25 -35 41 0 47 | -25 41 50 0 48 | -35 49 -50 0 49 | -25 -49 -50 0 50 | -19 -48 -49 0 51 | 3 -39 44 0 52 | 1 3 -44 0 53 | 9 35 44 0 54 | -9 -31 44 0 55 | 22 25 -44 0 56 | -12 -43 46 0 57 | -12 -28 -46 0 58 | 6 35 48 0 59 | 11 18 -48 0 60 | 22 38 -42 0 61 | 22 -35 -42 0 62 | -3 11 41 0 63 | 27 28 -43 0 64 | -15 -21 31 0 65 | -33 39 50 0 66 | -8 -22 -47 0 67 | -22 -40 -47 0 68 | 39 44 -46 0 69 | -25 -26 47 0 70 | 38 43 45 0 71 | -6 -14 -45 0 72 | -7 12 36 0 73 | 8 -11 45 0 74 | 27 -38 -50 0 75 | 7 -11 -36 0 76 | -7 -41 42 0 77 | 7 21 23 0 78 | -18 32 46 0 79 | 8 19 -36 0 80 | -32 -45 -50 0 81 | 7 17 21 0 82 | 6 18 43 0 83 | -6 24 -27 0 84 | 40 -41 49 0 85 | -11 12 26 0 86 | -3 32 -36 0 87 | -6 36 -44 0 88 | -3 36 42 0 89 | -8 -11 -32 0 90 | -18 -27 -38 0 91 | -18 -27 -39 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-1_6-no-3.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-1_6-no-3.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 80 12 | 15 20 41 0 13 | -15 20 41 0 14 | 7 8 -41 0 15 | 7 -8 -41 0 16 | -7 42 50 0 17 | -7 -42 50 0 18 | 22 35 -50 0 19 | 22 -35 45 0 20 | 18 -22 45 0 21 | -18 -22 45 0 22 | 33 -45 -50 0 23 | -7 -33 -50 0 24 | 19 -20 21 0 25 | -20 21 -41 0 26 | 19 -20 -21 0 27 | 1 14 36 0 28 | -1 14 36 0 29 | 13 -14 36 0 30 | 3 13 -36 0 31 | -3 5 -36 0 32 | -3 -5 13 0 33 | 4 44 49 0 34 | -4 17 49 0 35 | -4 -17 44 0 36 | -13 31 -44 0 37 | -13 -31 -44 0 38 | 23 33 -49 0 39 | 23 -33 -49 0 40 | -19 37 42 0 41 | -19 37 -42 0 42 | -23 29 -37 0 43 | -23 -29 -37 0 44 | -24 -26 32 0 45 | 2 -12 -31 0 46 | 17 28 40 0 47 | -15 -17 40 0 48 | 2 28 47 0 49 | 26 -28 -39 0 50 | 21 -26 -28 0 51 | 16 24 29 0 52 | 12 -34 -39 0 53 | 10 31 40 0 54 | -6 -32 35 0 55 | 16 -24 34 0 56 | -24 -31 38 0 57 | -16 -24 -38 0 58 | -2 -10 -47 0 59 | 4 -16 27 0 60 | -1 24 -30 0 61 | -18 26 -46 0 62 | 27 30 -45 0 63 | 4 -14 -44 0 64 | -29 43 47 0 65 | -8 -10 -46 0 66 | -11 39 -43 0 67 | -11 -40 -43 0 68 | 6 -21 26 0 69 | 8 -25 46 0 70 | -25 -38 46 0 71 | 10 -46 -47 0 72 | 25 -32 -40 0 73 | 5 6 -40 0 74 | 11 15 16 0 75 | 12 39 43 0 76 | 5 11 32 0 77 | -5 17 32 0 78 | -12 -40 -48 0 79 | -2 18 -30 0 80 | 3 10 -34 0 81 | -2 -9 30 0 82 | -3 -5 -28 0 83 | -9 26 48 0 84 | 22 -27 -48 0 85 | 1 9 38 0 86 | 3 -6 48 0 87 | 1 -6 34 0 88 | 15 -35 48 0 89 | 15 26 -27 0 90 | -9 -27 0 91 | 1 9 25 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-1_6-no-4.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-1_6-no-4.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 80 12 | 1 32 34 0 13 | 4 5 32 0 14 | -4 5 -34 0 15 | -5 32 -34 0 16 | 29 -32 43 0 17 | 29 36 -43 0 18 | 29 -32 -36 0 19 | 1 3 -29 0 20 | -3 -29 -32 0 21 | -1 24 39 0 22 | -1 24 -39 0 23 | 7 18 -24 0 24 | -7 18 28 0 25 | -7 -21 28 0 26 | -7 17 -28 0 27 | 18 -24 -28 0 28 | 2 17 40 0 29 | -17 -18 40 0 30 | 2 39 -40 0 31 | 2 -39 -40 0 32 | -2 -18 35 0 33 | -2 -18 -35 0 34 | 9 -32 41 0 35 | -9 41 45 0 36 | -1 -9 -45 0 37 | -5 27 43 0 38 | 14 16 26 0 39 | 14 -16 49 0 40 | 12 -14 26 0 41 | -12 26 35 0 42 | 26 30 -35 0 43 | -26 30 49 0 44 | 9 13 25 0 45 | 5 -17 25 0 46 | 15 30 47 0 47 | -20 27 -49 0 48 | 13 -20 -27 0 49 | -13 -30 -49 0 50 | 3 8 37 0 51 | 8 23 -43 0 52 | 10 19 22 0 53 | 10 -19 22 0 54 | -10 -19 36 0 55 | 4 21 38 0 56 | -4 38 46 0 57 | 21 -38 -47 0 58 | -21 45 46 0 59 | -14 -33 -38 0 60 | -10 11 -26 0 61 | -14 16 -50 0 62 | -14 -16 -23 0 63 | -2 -23 -50 0 64 | 12 -47 50 0 65 | 7 10 48 0 66 | -6 -13 -41 0 67 | 11 -41 -48 0 68 | 23 -41 -48 0 69 | -15 42 48 0 70 | -15 -21 -42 0 71 | 11 34 44 0 72 | -27 -34 -46 0 73 | 19 28 50 0 74 | -3 6 -35 0 75 | -22 -40 -44 0 76 | -25 -37 -42 0 77 | -26 -30 -37 0 78 | 6 -31 42 0 79 | 6 -31 -33 0 80 | -44 -45 47 0 81 | 4 20 47 0 82 | -6 44 -46 0 83 | -11 12 20 0 84 | -8 10 28 0 85 | -22 31 -36 0 86 | 7 -25 37 0 87 | -11 31 47 0 88 | -4 10 -12 0 89 | -30 -31 44 0 90 | 7 15 33 0 91 | -8 -11 33 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-2_0-no-1.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-2_0-no-1.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 100 12 | 7 11 19 0 13 | 7 -11 27 0 14 | 7 16 -27 0 15 | -11 25 48 0 16 | -16 17 -48 0 17 | -17 25 -48 0 18 | -16 -25 -27 0 19 | 19 36 49 0 20 | -7 -36 49 0 21 | -7 19 -49 0 22 | 4 12 44 0 23 | 4 -12 44 0 24 | 1 -44 47 0 25 | -1 4 47 0 26 | 20 34 48 0 27 | -19 20 34 0 28 | 24 -34 -44 0 29 | -24 -34 -44 0 30 | -24 -32 41 0 31 | -34 -41 -47 0 32 | -4 -19 20 0 33 | 30 39 41 0 34 | -30 39 50 0 35 | -20 -30 -50 0 36 | -20 -39 41 0 37 | -19 32 -41 0 38 | -20 -32 -41 0 39 | 1 18 -35 0 40 | -14 18 -35 0 41 | -14 -18 27 0 42 | -1 25 -46 0 43 | -4 16 -47 0 44 | 11 16 -25 0 45 | -4 11 -25 0 46 | -27 -35 -47 0 47 | 15 31 40 0 48 | 10 39 -49 0 49 | -8 -10 21 0 50 | -21 -26 30 0 51 | 6 -11 29 0 52 | 6 31 50 0 53 | 45 49 -50 0 54 | 31 -45 -50 0 55 | 21 30 33 0 56 | 2 37 -49 0 57 | -2 17 37 0 58 | -8 14 32 0 59 | -14 -15 32 0 60 | -1 37 47 0 61 | 6 -38 45 0 62 | -21 -38 45 0 63 | -13 -18 -42 0 64 | 2 -6 22 0 65 | -2 -6 22 0 66 | 9 -28 -36 0 67 | 8 29 -39 0 68 | -8 -38 -39 0 69 | -12 17 38 0 70 | 1 -15 -26 0 71 | -7 -15 -26 0 72 | -9 36 42 0 73 | 12 -16 21 0 74 | -10 -23 -46 0 75 | -9 -29 34 0 76 | -9 -21 42 0 77 | -12 -23 38 0 78 | -30 38 40 0 79 | 18 23 33 0 80 | -6 15 33 0 81 | 9 27 -43 0 82 | 22 40 -48 0 83 | 8 -22 26 0 84 | -5 -33 -36 0 85 | 2 -33 46 0 86 | 5 10 -42 0 87 | 14 -29 -31 0 88 | 12 -23 26 0 89 | 8 35 36 0 90 | -10 -17 -18 0 91 | 10 -22 -28 0 92 | 15 -17 -43 0 93 | 23 -29 -37 0 94 | 13 -33 35 0 95 | -2 23 42 0 96 | 9 43 46 0 97 | 5 -24 -45 0 98 | -5 43 46 0 99 | -3 -13 -40 0 100 | 3 -28 -42 0 101 | 24 -31 43 0 102 | 14 -22 -32 0 103 | 3 24 26 0 104 | -13 -43 44 0 105 | -3 -31 -40 0 106 | -5 -40 50 0 107 | 35 -37 -45 0 108 | -3 5 28 0 109 | 13 28 -46 0 110 | 3 28 -37 0 111 | 13 29 48 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-2_0-no-2.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-2_0-no-2.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 100 12 | 4 21 34 0 13 | 21 -34 40 0 14 | 1 -21 40 0 15 | -21 39 40 0 16 | 20 29 41 0 17 | -20 39 41 0 18 | 39 -40 41 0 19 | -40 -41 42 0 20 | -40 -41 -42 0 21 | 1 25 -39 0 22 | 2 -25 -39 0 23 | -2 5 -39 0 24 | -1 4 5 0 25 | 15 26 33 0 26 | 15 26 -33 0 27 | -5 -15 26 0 28 | -5 -26 31 0 29 | -5 -26 -31 0 30 | 6 9 47 0 31 | 9 37 38 0 32 | 9 14 -38 0 33 | -14 -38 -47 0 34 | -9 11 37 0 35 | -9 -11 37 0 36 | 24 -37 48 0 37 | 24 46 -48 0 38 | -24 -37 46 0 39 | 16 18 -46 0 40 | -16 18 -46 0 41 | -18 -37 -46 0 42 | -4 -6 15 0 43 | -4 13 -15 0 44 | -4 -13 -15 0 45 | -1 -6 38 0 46 | 3 -9 35 0 47 | 7 43 44 0 48 | 7 29 43 0 49 | -8 -29 44 0 50 | -29 -32 48 0 51 | -14 30 46 0 52 | -1 -14 -30 0 53 | -11 20 49 0 54 | 20 -44 -49 0 55 | 16 22 -27 0 56 | 13 -19 -35 0 57 | 2 19 -33 0 58 | 2 19 -28 0 59 | 33 -34 -44 0 60 | -33 -44 50 0 61 | 5 30 -48 0 62 | 10 22 -50 0 63 | -10 22 -34 0 64 | 1 10 -47 0 65 | -10 -25 -47 0 66 | -25 -27 50 0 67 | 11 21 23 0 68 | -3 11 23 0 69 | -3 6 -50 0 70 | -6 23 -50 0 71 | -31 -43 44 0 72 | -7 16 -26 0 73 | -23 28 -38 0 74 | 19 28 50 0 75 | -18 45 49 0 76 | -2 -16 -48 0 77 | 7 14 -42 0 78 | 12 25 -36 0 79 | 10 -24 -45 0 80 | -21 32 -42 0 81 | 12 -18 -27 0 82 | -13 -23 -24 0 83 | 25 29 38 0 84 | -8 43 -45 0 85 | -2 -12 13 0 86 | -7 14 30 0 87 | -8 -17 -19 0 88 | 8 -22 49 0 89 | -12 -17 33 0 90 | 27 -29 32 0 91 | 8 -12 -13 0 92 | 24 -31 47 0 93 | -3 36 47 0 94 | 3 12 34 0 95 | -7 -16 36 0 96 | -22 31 48 0 97 | 17 -22 -49 0 98 | -17 -19 32 0 99 | -20 27 36 0 100 | 18 -32 -35 0 101 | 3 -28 -30 0 102 | 17 34 42 0 103 | -32 -43 -49 0 104 | 17 -28 -43 0 105 | -23 35 -45 0 106 | -10 31 -36 0 107 | 27 -41 42 0 108 | 35 -36 45 0 109 | 8 -30 45 0 110 | 4 28 -35 0 111 | 6 -11 -20 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-2_0-no-3.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-2_0-no-3.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 100 12 | 33 37 43 0 13 | 21 -37 43 0 14 | -21 -37 39 0 15 | 23 39 -43 0 16 | 13 -23 31 0 17 | -13 -23 31 0 18 | -23 -31 -43 0 19 | 6 9 25 0 20 | -6 9 25 0 21 | 9 33 -38 0 22 | -9 25 -39 0 23 | 24 -25 -39 0 24 | -24 -25 33 0 25 | 6 27 41 0 26 | -6 14 41 0 27 | 14 -41 43 0 28 | 14 -41 -43 0 29 | 1 20 27 0 30 | 1 12 -20 0 31 | 1 -12 -14 0 32 | -1 27 28 0 33 | -1 -14 -28 0 34 | -1 -11 -14 0 35 | -27 -33 39 0 36 | 5 20 28 0 37 | 19 29 -33 0 38 | -19 -20 29 0 39 | -20 28 -29 0 40 | 5 -28 37 0 41 | 5 -28 -37 0 42 | -5 -33 -39 0 43 | 7 17 22 0 44 | -5 7 17 0 45 | -7 18 22 0 46 | 22 -24 41 0 47 | -7 12 18 0 48 | -12 18 34 0 49 | -12 34 -42 0 50 | -7 -34 -41 0 51 | -16 -29 35 0 52 | -3 13 -29 0 53 | -21 -30 37 0 54 | -15 -21 47 0 55 | -8 24 40 0 56 | -3 -8 42 0 57 | -3 -8 -42 0 58 | -2 30 36 0 59 | -2 -30 36 0 60 | -4 -35 44 0 61 | 42 -45 -50 0 62 | -42 -45 -50 0 63 | -11 15 -40 0 64 | 3 46 48 0 65 | 3 -46 48 0 66 | -11 30 50 0 67 | -16 30 50 0 68 | 4 -36 -40 0 69 | 8 46 47 0 70 | 24 -40 44 0 71 | 12 16 -46 0 72 | 2 6 -36 0 73 | -6 -44 46 0 74 | -22 32 -36 0 75 | 3 32 38 0 76 | -27 -35 38 0 77 | 11 16 -47 0 78 | 31 -45 -46 0 79 | 19 -24 32 0 80 | -15 23 -31 0 81 | 4 -34 -49 0 82 | 11 -22 -49 0 83 | 23 -26 50 0 84 | -9 -31 -32 0 85 | -2 -27 35 0 86 | 26 34 45 0 87 | 7 36 47 0 88 | -4 -30 49 0 89 | -26 -44 -50 0 90 | 2 40 48 0 91 | 26 -44 -47 0 92 | -18 19 -25 0 93 | -38 42 49 0 94 | 13 -22 49 0 95 | -10 -32 -48 0 96 | 2 -19 29 0 97 | -13 -15 26 0 98 | -10 -17 20 0 99 | -17 21 45 0 100 | -4 -13 -26 0 101 | -9 21 -48 0 102 | -10 35 44 0 103 | -32 -48 -49 0 104 | 4 -16 -19 0 105 | -5 8 40 0 106 | 15 -18 -35 0 107 | 8 10 -47 0 108 | 10 15 45 0 109 | 10 -18 -34 0 110 | 16 17 38 0 111 | 11 -17 -38 0 -------------------------------------------------------------------------------- /src/test/resources/sat/unsat/aim-50-2_0-no-4.cnf: -------------------------------------------------------------------------------- 1 | c FILE: aim-50-2_0-no-4.cnf 2 | c 3 | c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp), 4 | c and Yuichi Asahiro 5 | c 6 | c DESCRIPTION: Artifical instances from generator by source. Generators 7 | c and more information in sat/contributed/iwama. 8 | c 9 | c NOTE: Not Satisfiable 10 | c 11 | p cnf 50 100 12 | 2 26 32 0 13 | 2 -21 32 0 14 | 2 3 -26 0 15 | -2 22 44 0 16 | -2 -22 44 0 17 | -2 23 -44 0 18 | 3 -23 41 0 19 | 3 -41 -44 0 20 | -3 9 20 0 21 | -3 -20 32 0 22 | 7 9 -32 0 23 | -7 16 -32 0 24 | 9 -16 -32 0 25 | 1 16 37 0 26 | -1 16 26 0 27 | -16 26 37 0 28 | -9 -26 37 0 29 | 5 -9 46 0 30 | 11 21 -46 0 31 | 5 21 -46 0 32 | -5 21 39 0 33 | -5 -37 -39 0 34 | -9 -21 -37 0 35 | 10 -19 -48 0 36 | 10 -13 -19 0 37 | 5 -36 47 0 38 | -5 -36 47 0 39 | -16 42 -43 0 40 | -1 13 -39 0 41 | 8 -27 30 0 42 | 13 18 -30 0 43 | 8 13 -18 0 44 | -13 15 -17 0 45 | -13 -15 -30 0 46 | -17 -27 -45 0 47 | -12 -27 -45 0 48 | -18 25 40 0 49 | -18 34 -40 0 50 | 25 -34 48 0 51 | -19 -25 48 0 52 | -1 -12 -34 0 53 | 20 -25 -43 0 54 | 8 19 -45 0 55 | 17 29 34 0 56 | -17 29 41 0 57 | 15 -31 -35 0 58 | -15 -31 -35 0 59 | 34 39 -43 0 60 | -11 -14 45 0 61 | -11 -12 -14 0 62 | -24 28 -39 0 63 | -8 -24 -30 0 64 | 7 -25 45 0 65 | -7 -44 45 0 66 | -20 36 50 0 67 | -8 36 50 0 68 | -8 -20 -50 0 69 | 20 -41 44 0 70 | 28 -33 39 0 71 | 28 -33 47 0 72 | 10 27 38 0 73 | -10 27 30 0 74 | 4 -10 38 0 75 | -6 -35 41 0 76 | 12 18 22 0 77 | 17 22 30 0 78 | 12 29 42 0 79 | -4 23 31 0 80 | 1 -4 -31 0 81 | -4 -6 -22 0 82 | -22 40 50 0 83 | 4 -33 43 0 84 | -6 -21 42 0 85 | 7 -24 -47 0 86 | -3 31 -46 0 87 | 4 12 -36 0 88 | -11 -29 36 0 89 | -14 -23 -48 0 90 | -23 -37 -48 0 91 | 15 -42 43 0 92 | -7 24 -50 0 93 | -10 33 46 0 94 | 40 -42 46 0 95 | 14 24 -49 0 96 | 11 17 -38 0 97 | 19 -28 -47 0 98 | 14 24 27 0 99 | 6 -15 43 0 100 | 11 18 -41 0 101 | 1 6 49 0 102 | -29 -47 -50 0 103 | 25 -34 -38 0 104 | 6 31 -49 0 105 | 33 35 0 106 | 33 35 48 0 107 | 49 -49 0 108 | 23 -29 -40 0 109 | 19 -26 -42 0 110 | 14 38 -38 0 111 | -28 -40 0 -------------------------------------------------------------------------------- /src/test/resources/sat/x1_16.shuffled.cnf: -------------------------------------------------------------------------------- 1 | c A permuted SAT Competition 2002 formula with seed=1073937311 2 | p cnf 46 122 3 | 17 7 43 0 4 | -33 -2 1 0 5 | -29 -8 -25 0 6 | 13 -24 14 0 7 | 30 12 -20 0 8 | 42 32 -6 0 9 | 41 -12 -10 0 10 | 45 38 29 0 11 | 7 -17 -43 0 12 | 15 46 -9 0 13 | -5 30 36 0 14 | -5 16 -13 0 15 | -41 12 -10 0 16 | 37 -42 -8 0 17 | 13 -14 24 0 18 | -14 11 39 0 19 | 2 -24 -7 0 20 | 17 -7 -43 0 21 | 10 32 -33 0 22 | 1 22 40 0 23 | -34 -15 -11 0 24 | -11 39 14 0 25 | 36 5 -30 0 26 | -26 3 -34 0 27 | -32 33 10 0 28 | -1 -22 40 0 29 | -22 18 43 0 30 | 35 3 18 0 31 | -4 17 -44 0 32 | -31 21 19 0 33 | 11 15 -34 0 34 | -44 23 26 0 35 | -46 9 15 0 36 | 33 32 -10 0 37 | 19 38 -20 0 38 | 38 -29 -45 0 39 | -44 4 -17 0 40 | 16 13 5 0 41 | -35 6 -27 0 42 | 35 6 27 0 43 | -18 -3 35 0 44 | -16 5 -13 0 45 | 12 20 -30 0 46 | 3 -35 -18 0 47 | 36 28 39 0 48 | 29 -38 -45 0 49 | -42 8 -37 0 50 | 35 -27 -6 0 51 | 1 -40 -22 0 52 | 34 -11 15 0 53 | 45 -38 -29 0 54 | -9 -16 0 55 | 42 37 8 0 56 | 34 -15 11 0 57 | 38 -19 20 0 58 | 13 -16 -5 0 59 | -39 11 14 0 60 | -42 6 32 0 61 | -15 46 9 0 62 | 19 -21 31 0 63 | -41 46 45 0 64 | 8 29 -25 0 65 | -43 18 22 0 66 | -17 43 -7 0 67 | 26 -23 44 0 68 | 40 37 -25 0 69 | 7 -24 -2 0 70 | 9 16 0 71 | 20 19 -38 0 72 | 10 -41 -12 0 73 | -19 -31 -21 0 74 | -26 34 -3 0 75 | 7 2 24 0 76 | 28 -27 23 0 77 | 6 42 -32 0 78 | -7 -2 24 0 79 | -6 -35 27 0 80 | -40 22 -1 0 81 | 36 -39 -28 0 82 | -9 -15 -46 0 83 | 23 44 -26 0 84 | -34 -3 26 0 85 | 29 -8 25 0 86 | 45 -46 41 0 87 | 2 -33 -1 0 88 | -21 -4 31 0 89 | -28 -23 -27 0 90 | -37 -8 42 0 91 | 23 -28 27 0 92 | -2 -1 33 0 93 | 30 -12 20 0 94 | -3 -35 18 0 95 | -40 25 37 0 96 | -4 21 -31 0 97 | 24 14 -13 0 98 | -24 -13 -14 0 99 | -40 -25 -37 0 100 | -19 21 31 0 101 | -23 27 28 0 102 | 17 4 44 0 103 | 33 2 1 0 104 | -20 -38 -19 0 105 | 4 21 31 0 106 | -33 -32 -10 0 107 | 25 -29 8 0 108 | 39 -28 -36 0 109 | -22 -18 -43 0 110 | -12 -30 -20 0 111 | -36 -30 -5 0 112 | -17 44 -4 0 113 | 3 34 26 0 114 | -32 -6 -42 0 115 | 25 -37 40 0 116 | -31 -21 4 0 117 | -36 5 30 0 118 | -23 -44 -26 0 119 | -36 28 -39 0 120 | 41 -45 46 0 121 | -39 -11 -14 0 122 | 10 41 12 0 123 | -45 -46 -41 0 124 | 22 -18 43 0 125 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/a_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id2 [label="A"] 6 | 7 | id2 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 8 | id2 -> id1 [color="#009432", fontcolor="#009432", style=solid] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/a_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id2(["A"]) 7 | 8 | id2 --> id0 9 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 10 | id2 --> id1 11 | linkStyle 1 stroke:#009432,stroke-width:2 12 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/and_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id7 [label="C"] 6 | id16 [label="B"] 7 | id17 [label="A"] 8 | 9 | id7 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 10 | id7 -> id0 [color="#009432", fontcolor="#009432", style=solid] 11 | id16 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 12 | id16 -> id7 [color="#009432", fontcolor="#009432", style=solid] 13 | id17 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id17 -> id16 [color="#009432", fontcolor="#009432", style=solid] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/and_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id7(["C"]) 7 | id16(["B"]) 8 | id17(["A"]) 9 | 10 | id7 --> id1 11 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 12 | id7 --> id0 13 | linkStyle 1 stroke:#009432,stroke-width:2 14 | id16 --> id0 15 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 16 | id16 --> id7 17 | linkStyle 3 stroke:#009432,stroke-width:2 18 | id17 --> id0 19 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 20 | id17 --> id16 21 | linkStyle 5 stroke:#009432,stroke-width:2 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/equiv_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id6 [label="C"] 6 | id7 [label="C"] 7 | id11 [label="A"] 8 | 9 | id6 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 10 | id6 -> id1 [color="#009432", fontcolor="#009432", style=solid] 11 | id7 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 12 | id7 -> id0 [color="#009432", fontcolor="#009432", style=solid] 13 | id11 -> id6 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id11 -> id7 [color="#009432", fontcolor="#009432", style=solid] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/equiv_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id6(["C"]) 7 | id7(["C"]) 8 | id11(["A"]) 9 | 10 | id6 --> id0 11 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 12 | id6 --> id1 13 | linkStyle 1 stroke:#009432,stroke-width:2 14 | id7 --> id1 15 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 16 | id7 --> id0 17 | linkStyle 3 stroke:#009432,stroke-width:2 18 | id11 --> id6 19 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 20 | id11 --> id7 21 | linkStyle 5 stroke:#009432,stroke-width:2 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/false_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/false_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula-dynamic_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="falsch", shape=box, color="#ea2027", fontcolor="#ea2027", style=filled, fillcolor="#ffffff"] 4 | id1 [label="wahr", shape=box, color="#009432", fontcolor="#009432", style=filled, fillcolor="#ffffff"] 5 | id8 [label="D", shape=circle, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 6 | id9 [label="D", shape=circle, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 7 | id12 [label="C", shape=circle, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 8 | id17 [label="B!!", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 9 | id18 [label="C", shape=circle, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 10 | id19 [label="B!!", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 11 | id20 [label="A", shape=circle, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 12 | 13 | id8 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id8 -> id1 [color="#009432", fontcolor="#009432", style=solid] 15 | id9 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 16 | id9 -> id0 [color="#009432", fontcolor="#009432", style=solid] 17 | id12 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 18 | id12 -> id8 [color="#009432", fontcolor="#009432", style=solid] 19 | id17 -> id9 [color="#ea2027", fontcolor="#ea2027", style=bold] 20 | id17 -> id0 [color="#009432", fontcolor="#009432", style=bold] 21 | id18 -> id8 [color="#ea2027", fontcolor="#ea2027", style=dotted] 22 | id18 -> id0 [color="#009432", fontcolor="#009432", style=solid] 23 | id19 -> id18 [color="#ea2027", fontcolor="#ea2027", style=bold] 24 | id19 -> id12 [color="#009432", fontcolor="#009432", style=bold] 25 | id20 -> id17 [color="#ea2027", fontcolor="#ea2027", style=dotted] 26 | id20 -> id19 [color="#009432", fontcolor="#009432", style=solid] 27 | } 28 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula-dynamic_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["falsch"] 3 | style id0 stroke:#ea2027,color:#ea2027,fill:#ffffff 4 | id1["wahr"] 5 | style id1 stroke:#009432,color:#009432,fill:#ffffff 6 | id8(("D")) 7 | style id8 stroke:#1289a7,color:#ffffff,fill:#1289a7 8 | id9(("D")) 9 | style id9 stroke:#1289a7,color:#ffffff,fill:#1289a7 10 | id12(("C")) 11 | style id12 stroke:#1289a7,color:#ffffff,fill:#1289a7 12 | id17(("B!!")) 13 | style id17 stroke:#f79f1f,color:#000000,fill:#f79f1f 14 | id18(("C")) 15 | style id18 stroke:#1289a7,color:#ffffff,fill:#1289a7 16 | id19(("B!!")) 17 | style id19 stroke:#f79f1f,color:#000000,fill:#f79f1f 18 | id20(("A")) 19 | style id20 stroke:#1289a7,color:#ffffff,fill:#1289a7 20 | 21 | id8 --> id0 22 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 23 | id8 --> id1 24 | linkStyle 1 stroke:#009432,stroke-width:2 25 | id9 --> id1 26 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 27 | id9 --> id0 28 | linkStyle 3 stroke:#009432,stroke-width:2 29 | id12 --> id0 30 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 31 | id12 --> id8 32 | linkStyle 5 stroke:#009432,stroke-width:2 33 | id17 --> id9 34 | linkStyle 6 stroke:#ea2027,stroke-width:4 35 | id17 --> id0 36 | linkStyle 7 stroke:#009432,stroke-width:4 37 | id18 --> id8 38 | linkStyle 8 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 39 | id18 --> id0 40 | linkStyle 9 stroke:#009432,stroke-width:2 41 | id19 --> id18 42 | linkStyle 10 stroke:#ea2027,stroke-width:4 43 | id19 --> id12 44 | linkStyle 11 stroke:#009432,stroke-width:4 45 | id20 --> id17 46 | linkStyle 12 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 47 | id20 --> id19 48 | linkStyle 13 stroke:#009432,stroke-width:2 49 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula-fixedStyle_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | bgcolor="#e4e4e4" 3 | 4 | { rank = same; 5 | id0 [label="false", shape=box, color="#5758bb", fontcolor="#ffffff", style=filled, fillcolor="#5758bb"] 6 | id1 [label="true", shape=box, color="#1289a7", fontcolor="#ffffff", style=filled, fillcolor="#1289a7"] 7 | } 8 | id8 [label="D", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 9 | id9 [label="D", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 10 | id12 [label="C", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 11 | id17 [label="B", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 12 | id18 [label="C", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 13 | id19 [label="B", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 14 | id20 [label="A", shape=circle, color="#f79f1f", fontcolor="#000000", style=filled, fillcolor="#f79f1f"] 15 | 16 | id8 -> id0 [color="#5758bb", fontcolor="#5758bb", style=dotted] 17 | id8 -> id1 [color="#1289a7", fontcolor="#1289a7", style=bold] 18 | id9 -> id1 [color="#5758bb", fontcolor="#5758bb", style=dotted] 19 | id9 -> id0 [color="#1289a7", fontcolor="#1289a7", style=bold] 20 | id12 -> id0 [color="#5758bb", fontcolor="#5758bb", style=dotted] 21 | id12 -> id8 [color="#1289a7", fontcolor="#1289a7", style=bold] 22 | id17 -> id9 [color="#5758bb", fontcolor="#5758bb", style=dotted] 23 | id17 -> id0 [color="#1289a7", fontcolor="#1289a7", style=bold] 24 | id18 -> id8 [color="#5758bb", fontcolor="#5758bb", style=dotted] 25 | id18 -> id0 [color="#1289a7", fontcolor="#1289a7", style=bold] 26 | id19 -> id18 [color="#5758bb", fontcolor="#5758bb", style=dotted] 27 | id19 -> id12 [color="#1289a7", fontcolor="#1289a7", style=bold] 28 | id20 -> id17 [color="#5758bb", fontcolor="#5758bb", style=dotted] 29 | id20 -> id19 [color="#1289a7", fontcolor="#1289a7", style=bold] 30 | } 31 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula-fixedStyle_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#5758bb,color:#ffffff,fill:#5758bb 4 | id1["true"] 5 | style id1 stroke:#1289a7,color:#ffffff,fill:#1289a7 6 | id8(("D")) 7 | style id8 stroke:#f79f1f,color:#000000,fill:#f79f1f 8 | id9(("D")) 9 | style id9 stroke:#f79f1f,color:#000000,fill:#f79f1f 10 | id12(("C")) 11 | style id12 stroke:#f79f1f,color:#000000,fill:#f79f1f 12 | id17(("B")) 13 | style id17 stroke:#f79f1f,color:#000000,fill:#f79f1f 14 | id18(("C")) 15 | style id18 stroke:#f79f1f,color:#000000,fill:#f79f1f 16 | id19(("B")) 17 | style id19 stroke:#f79f1f,color:#000000,fill:#f79f1f 18 | id20(("A")) 19 | style id20 stroke:#f79f1f,color:#000000,fill:#f79f1f 20 | 21 | id8 --> id0 22 | linkStyle 0 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 23 | id8 --> id1 24 | linkStyle 1 stroke:#1289a7,stroke-width:4 25 | id9 --> id1 26 | linkStyle 2 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 27 | id9 --> id0 28 | linkStyle 3 stroke:#1289a7,stroke-width:4 29 | id12 --> id0 30 | linkStyle 4 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 31 | id12 --> id8 32 | linkStyle 5 stroke:#1289a7,stroke-width:4 33 | id17 --> id9 34 | linkStyle 6 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 35 | id17 --> id0 36 | linkStyle 7 stroke:#1289a7,stroke-width:4 37 | id18 --> id8 38 | linkStyle 8 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 39 | id18 --> id0 40 | linkStyle 9 stroke:#1289a7,stroke-width:4 41 | id19 --> id18 42 | linkStyle 10 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 43 | id19 --> id12 44 | linkStyle 11 stroke:#1289a7,stroke-width:4 45 | id20 --> id17 46 | linkStyle 12 stroke:#5758bb,stroke-width:2,stroke-dasharray:3 47 | id20 --> id19 48 | linkStyle 13 stroke:#1289a7,stroke-width:4 49 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id8 [label="D"] 6 | id9 [label="D"] 7 | id21 [label="C"] 8 | id26 [label="B"] 9 | id27 [label="C"] 10 | id28 [label="B"] 11 | id29 [label="A"] 12 | 13 | id8 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id8 -> id1 [color="#009432", fontcolor="#009432", style=solid] 15 | id9 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 16 | id9 -> id0 [color="#009432", fontcolor="#009432", style=solid] 17 | id21 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 18 | id21 -> id8 [color="#009432", fontcolor="#009432", style=solid] 19 | id26 -> id9 [color="#ea2027", fontcolor="#ea2027", style=dotted] 20 | id26 -> id0 [color="#009432", fontcolor="#009432", style=solid] 21 | id27 -> id8 [color="#ea2027", fontcolor="#ea2027", style=dotted] 22 | id27 -> id0 [color="#009432", fontcolor="#009432", style=solid] 23 | id28 -> id27 [color="#ea2027", fontcolor="#ea2027", style=dotted] 24 | id28 -> id21 [color="#009432", fontcolor="#009432", style=solid] 25 | id29 -> id26 [color="#ea2027", fontcolor="#ea2027", style=dotted] 26 | id29 -> id28 [color="#009432", fontcolor="#009432", style=solid] 27 | } 28 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/formula_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id8(["D"]) 7 | id9(["D"]) 8 | id21(["C"]) 9 | id26(["B"]) 10 | id27(["C"]) 11 | id28(["B"]) 12 | id29(["A"]) 13 | 14 | id8 --> id0 15 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 16 | id8 --> id1 17 | linkStyle 1 stroke:#009432,stroke-width:2 18 | id9 --> id1 19 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 20 | id9 --> id0 21 | linkStyle 3 stroke:#009432,stroke-width:2 22 | id21 --> id0 23 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 24 | id21 --> id8 25 | linkStyle 5 stroke:#009432,stroke-width:2 26 | id26 --> id9 27 | linkStyle 6 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 28 | id26 --> id0 29 | linkStyle 7 stroke:#009432,stroke-width:2 30 | id27 --> id8 31 | linkStyle 8 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 32 | id27 --> id0 33 | linkStyle 9 stroke:#009432,stroke-width:2 34 | id28 --> id27 35 | linkStyle 10 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 36 | id28 --> id21 37 | linkStyle 11 stroke:#009432,stroke-width:2 38 | id29 --> id26 39 | linkStyle 12 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 40 | id29 --> id28 41 | linkStyle 13 stroke:#009432,stroke-width:2 42 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/impl_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id7 [label="C"] 6 | id10 [label="A"] 7 | 8 | id7 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 9 | id7 -> id0 [color="#009432", fontcolor="#009432", style=solid] 10 | id10 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 11 | id10 -> id7 [color="#009432", fontcolor="#009432", style=solid] 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/impl_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id7(["C"]) 7 | id10(["A"]) 8 | 9 | id7 --> id1 10 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 11 | id7 --> id0 12 | linkStyle 1 stroke:#009432,stroke-width:2 13 | id10 --> id1 14 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 15 | id10 --> id7 16 | linkStyle 3 stroke:#009432,stroke-width:2 17 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/not_a_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id3 [label="A"] 6 | 7 | id3 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 8 | id3 -> id0 [color="#009432", fontcolor="#009432", style=solid] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/not_a_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id3(["A"]) 7 | 8 | id3 --> id1 9 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 10 | id3 --> id0 11 | linkStyle 1 stroke:#009432,stroke-width:2 12 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/not_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id6 [label="C"] 6 | id18 [label="B"] 7 | id19 [label="A"] 8 | 9 | id6 -> id0 [color="#ea2027", fontcolor="#ea2027", style=dotted] 10 | id6 -> id1 [color="#009432", fontcolor="#009432", style=solid] 11 | id18 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 12 | id18 -> id6 [color="#009432", fontcolor="#009432", style=solid] 13 | id19 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id19 -> id18 [color="#009432", fontcolor="#009432", style=solid] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/not_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id6(["C"]) 7 | id18(["B"]) 8 | id19(["A"]) 9 | 10 | id6 --> id0 11 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 12 | id6 --> id1 13 | linkStyle 1 stroke:#009432,stroke-width:2 14 | id18 --> id1 15 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 16 | id18 --> id6 17 | linkStyle 3 stroke:#009432,stroke-width:2 18 | id19 --> id1 19 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 20 | id19 --> id18 21 | linkStyle 5 stroke:#009432,stroke-width:2 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/or_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="false", shape=box, color="#ea2027", fontcolor="#ffffff", style=filled, fillcolor="#ea2027"] 4 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 5 | id7 [label="C"] 6 | id13 [label="B"] 7 | id14 [label="A"] 8 | 9 | id7 -> id1 [color="#ea2027", fontcolor="#ea2027", style=dotted] 10 | id7 -> id0 [color="#009432", fontcolor="#009432", style=solid] 11 | id13 -> id7 [color="#ea2027", fontcolor="#ea2027", style=dotted] 12 | id13 -> id1 [color="#009432", fontcolor="#009432", style=solid] 13 | id14 -> id13 [color="#ea2027", fontcolor="#ea2027", style=dotted] 14 | id14 -> id1 [color="#009432", fontcolor="#009432", style=solid] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/or_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["false"] 3 | style id0 stroke:#ea2027,color:#ffffff,fill:#ea2027 4 | id1["true"] 5 | style id1 stroke:#009432,color:#ffffff,fill:#009432 6 | id7(["C"]) 7 | id13(["B"]) 8 | id14(["A"]) 9 | 10 | id7 --> id1 11 | linkStyle 0 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 12 | id7 --> id0 13 | linkStyle 1 stroke:#009432,stroke-width:2 14 | id13 --> id7 15 | linkStyle 2 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 16 | id13 --> id1 17 | linkStyle 3 stroke:#009432,stroke-width:2 18 | id14 --> id13 19 | linkStyle 4 stroke:#ea2027,stroke-width:2,stroke-dasharray:3 20 | id14 --> id1 21 | linkStyle 5 stroke:#009432,stroke-width:2 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/true_bdd.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id1 [label="true", shape=box, color="#009432", fontcolor="#ffffff", style=filled, fillcolor="#009432"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/bdd/true_bdd.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id1["true"] 3 | style id1 stroke:#009432,color:#ffffff,fill:#009432 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f1-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="⇔"] 4 | id1 [label="∧"] 5 | id2 [label="a"] 6 | id3 [label="b"] 7 | id4 [label="⇒"] 8 | id5 [label="¬c"] 9 | id6 [label="∨"] 10 | id7 [label="x"] 11 | id8 [label="z"] 12 | 13 | id1 -> id2 14 | id1 -> id3 15 | id6 -> id7 16 | id6 -> id8 17 | id4 -> id5 [label="l"] 18 | id4 -> id6 [label="r"] 19 | id0 -> id1 20 | id0 -> id4 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f1-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["⇔"]) 3 | id1(["∧"]) 4 | id2(["a"]) 5 | id3(["b"]) 6 | id4(["⇒"]) 7 | id5(["¬c"]) 8 | id6(["∨"]) 9 | id7(["x"]) 10 | id8(["z"]) 11 | 12 | id1 --> id2 13 | id1 --> id3 14 | id6 --> id7 15 | id6 --> id8 16 | id4 -->|"l"| id5 17 | id4 -->|"r"| id6 18 | id0 --> id1 19 | id0 --> id4 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f10-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="⇒"] 4 | id1 [label="⇔"] 5 | id2 [label="A"] 6 | id3 [label="∧"] 7 | id4 [label="B"] 8 | id5 [label="∨"] 9 | id6 [label="¬A"] 10 | id7 [label="C"] 11 | id8 [label="X"] 12 | id9 [label="∧"] 13 | id10 [label="a + b + c <= 2"] 14 | id11 [label="a"] 15 | id12 [label="b"] 16 | id13 [label="c"] 17 | id14 [label="⇒"] 18 | id15 [label="∨"] 19 | id16 [label="¬a"] 20 | id17 [label="d"] 21 | id18 [label="∧"] 22 | id19 [label="X"] 23 | id20 [label="¬B"] 24 | 25 | id3 -> id4 [color="#000000", fontcolor="#000000", style=solid] 26 | id5 -> id6 [color="#000000", fontcolor="#000000", style=solid] 27 | id5 -> id7 [color="#000000", fontcolor="#000000", style=solid] 28 | id5 -> id8 [color="#000000", fontcolor="#000000", style=solid] 29 | id3 -> id5 [color="#000000", fontcolor="#000000", style=solid] 30 | id1 -> id2 [color="#000000", fontcolor="#000000", style=solid] 31 | id1 -> id3 [color="#000000", fontcolor="#000000", style=solid] 32 | id10 -> id11 [color="#777777", fontcolor="#777777", style=dotted] 33 | id10 -> id12 [color="#777777", fontcolor="#777777", style=dotted] 34 | id10 -> id13 [color="#777777", fontcolor="#777777", style=dotted] 35 | id9 -> id10 [color="#000000", fontcolor="#000000", style=solid] 36 | id15 -> id16 [color="#000000", fontcolor="#000000", style=solid] 37 | id15 -> id17 [color="#000000", fontcolor="#000000", style=solid] 38 | id18 -> id19 [color="#000000", fontcolor="#000000", style=solid] 39 | id18 -> id20 [color="#000000", fontcolor="#000000", style=solid] 40 | id14 -> id15 [color="#000000", fontcolor="#000000", style=solid, label="l"] 41 | id14 -> id18 [color="#000000", fontcolor="#000000", style=solid, label="r"] 42 | id9 -> id14 [color="#000000", fontcolor="#000000", style=solid] 43 | id0 -> id1 [color="#000000", fontcolor="#000000", style=solid, label="l"] 44 | id0 -> id9 [color="#000000", fontcolor="#000000", style=solid, label="r"] 45 | } 46 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f10-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["⇒"]) 3 | id1(["⇔"]) 4 | id2(["A"]) 5 | id3(["∧"]) 6 | id4(["B"]) 7 | id5(["∨"]) 8 | id6(["¬A"]) 9 | id7(["C"]) 10 | id8(["X"]) 11 | id9(["∧"]) 12 | id10(["a + b + c <= 2"]) 13 | id11(["a"]) 14 | id12(["b"]) 15 | id13(["c"]) 16 | id14(["⇒"]) 17 | id15(["∨"]) 18 | id16(["¬a"]) 19 | id17(["d"]) 20 | id18(["∧"]) 21 | id19(["X"]) 22 | id20(["¬B"]) 23 | 24 | id3 --> id4 25 | linkStyle 0 stroke:#000000,stroke-width:2 26 | id5 --> id6 27 | linkStyle 1 stroke:#000000,stroke-width:2 28 | id5 --> id7 29 | linkStyle 2 stroke:#000000,stroke-width:2 30 | id5 --> id8 31 | linkStyle 3 stroke:#000000,stroke-width:2 32 | id3 --> id5 33 | linkStyle 4 stroke:#000000,stroke-width:2 34 | id1 --> id2 35 | linkStyle 5 stroke:#000000,stroke-width:2 36 | id1 --> id3 37 | linkStyle 6 stroke:#000000,stroke-width:2 38 | id10 --> id11 39 | linkStyle 7 stroke:#777777,stroke-width:2,stroke-dasharray:3 40 | id10 --> id12 41 | linkStyle 8 stroke:#777777,stroke-width:2,stroke-dasharray:3 42 | id10 --> id13 43 | linkStyle 9 stroke:#777777,stroke-width:2,stroke-dasharray:3 44 | id9 --> id10 45 | linkStyle 10 stroke:#000000,stroke-width:2 46 | id15 --> id16 47 | linkStyle 11 stroke:#000000,stroke-width:2 48 | id15 --> id17 49 | linkStyle 12 stroke:#000000,stroke-width:2 50 | id18 --> id19 51 | linkStyle 13 stroke:#000000,stroke-width:2 52 | id18 --> id20 53 | linkStyle 14 stroke:#000000,stroke-width:2 54 | id14 -->|"l"| id15 55 | linkStyle 15 stroke:#000000,stroke-width:2 56 | id14 -->|"r"| id18 57 | linkStyle 16 stroke:#000000,stroke-width:2 58 | id9 --> id14 59 | linkStyle 17 stroke:#000000,stroke-width:2 60 | id0 -->|"l"| id1 61 | linkStyle 18 stroke:#000000,stroke-width:2 62 | id0 -->|"r"| id9 63 | linkStyle 19 stroke:#000000,stroke-width:2 64 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f2-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="∨"] 4 | id1 [label="∧"] 5 | id2 [label="a"] 6 | id3 [label="b"] 7 | id4 [label="∧"] 8 | id5 [label="b"] 9 | id6 [label="¬c"] 10 | 11 | id1 -> id2 12 | id1 -> id3 13 | id0 -> id1 14 | id4 -> id5 15 | id4 -> id6 16 | id0 -> id4 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f2-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["∨"]) 3 | id1(["∧"]) 4 | id2(["a"]) 5 | id3(["b"]) 6 | id4(["∧"]) 7 | id5(["b"]) 8 | id6(["¬c"]) 9 | 10 | id1 --> id2 11 | id1 --> id3 12 | id0 --> id1 13 | id4 --> id5 14 | id4 --> id6 15 | id0 --> id4 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f3-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="⇔"] 4 | id1 [label="∧"] 5 | id2 [label="a"] 6 | id3 [label="b"] 7 | id4 [label="⇒"] 8 | id5 [label="¬c"] 9 | id6 [label="∨"] 10 | id7 [label="a"] 11 | id8 [label="b"] 12 | 13 | id1 -> id2 14 | id1 -> id3 15 | id6 -> id7 16 | id6 -> id8 17 | id4 -> id5 [label="l"] 18 | id4 -> id6 [label="r"] 19 | id0 -> id1 20 | id0 -> id4 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f3-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["⇔"]) 3 | id1(["∧"]) 4 | id2(["a"]) 5 | id3(["b"]) 6 | id4(["⇒"]) 7 | id5(["¬c"]) 8 | id6(["∨"]) 9 | id7(["a"]) 10 | id8(["b"]) 11 | 12 | id1 --> id2 13 | id1 --> id3 14 | id6 --> id7 15 | id6 --> id8 16 | id4 -->|"l"| id5 17 | id4 -->|"r"| id6 18 | id0 --> id1 19 | id0 --> id4 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f4-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="∨"] 4 | id1 [label="¬"] 5 | id2 [label="∧"] 6 | id3 [label="a"] 7 | id4 [label="b"] 8 | id5 [label="∧"] 9 | id6 [label="b"] 10 | id7 [label="¬c"] 11 | 12 | id2 -> id3 13 | id2 -> id4 14 | id1 -> id2 15 | id0 -> id1 16 | id5 -> id6 17 | id5 -> id7 18 | id0 -> id5 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f4-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["∨"]) 3 | id1(["¬"]) 4 | id2(["∧"]) 5 | id3(["a"]) 6 | id4(["b"]) 7 | id5(["∧"]) 8 | id6(["b"]) 9 | id7(["¬c"]) 10 | 11 | id2 --> id3 12 | id2 --> id4 13 | id1 --> id2 14 | id0 --> id1 15 | id5 --> id6 16 | id5 --> id7 17 | id0 --> id5 18 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f5-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="∨"] 4 | id1 [label="a"] 5 | id2 [label="¬b"] 6 | id3 [label="2*a + 3*~b + 4*c <= 23"] 7 | id4 [label="a"] 8 | id5 [label="¬b"] 9 | id6 [label="c"] 10 | 11 | id0 -> id1 12 | id0 -> id2 13 | id3 -> id4 14 | id3 -> id5 15 | id3 -> id6 16 | id0 -> id3 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f5-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["∨"]) 3 | id1(["a"]) 4 | id2(["¬b"]) 5 | id3(["2*a + 3*~b + 4*c <= 23"]) 6 | id4(["a"]) 7 | id5(["¬b"]) 8 | id6(["c"]) 9 | 10 | id0 --> id1 11 | id0 --> id2 12 | id3 --> id4 13 | id3 --> id5 14 | id3 --> id6 15 | id0 --> id3 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f6-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="∨"] 4 | id1 [label="∧"] 5 | id2 [label="a"] 6 | id3 [label="b"] 7 | id4 [label="∧"] 8 | id5 [label="c"] 9 | id6 [label="¬"] 10 | id7 [label="∧"] 11 | id8 [label="a"] 12 | id9 [label="b"] 13 | 14 | id1 -> id2 15 | id1 -> id3 16 | id0 -> id1 17 | id4 -> id5 18 | id7 -> id8 19 | id7 -> id9 20 | id6 -> id7 21 | id4 -> id6 22 | id0 -> id4 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f6-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["∨"]) 3 | id1(["∧"]) 4 | id2(["a"]) 5 | id3(["b"]) 6 | id4(["∧"]) 7 | id5(["c"]) 8 | id6(["¬"]) 9 | id7(["∧"]) 10 | id8(["a"]) 11 | id9(["b"]) 12 | 13 | id1 --> id2 14 | id1 --> id3 15 | id0 --> id1 16 | id4 --> id5 17 | id7 --> id8 18 | id7 --> id9 19 | id6 --> id7 20 | id4 --> id6 21 | id0 --> id4 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f7-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="∨"] 4 | id1 [label="∧"] 5 | id2 [label="c"] 6 | id3 [label="d"] 7 | id4 [label="∧"] 8 | id5 [label="a"] 9 | id6 [label="b"] 10 | id7 [label="⇔"] 11 | id8 [label="∧"] 12 | id9 [label="c"] 13 | id10 [label="d"] 14 | id11 [label="∧"] 15 | id12 [label="a"] 16 | id13 [label="b"] 17 | 18 | id1 -> id2 19 | id1 -> id3 20 | id0 -> id1 21 | id4 -> id5 22 | id4 -> id6 23 | id0 -> id4 24 | id8 -> id9 25 | id8 -> id10 26 | id11 -> id12 27 | id11 -> id13 28 | id7 -> id8 29 | id7 -> id11 30 | id0 -> id7 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f7-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["∨"]) 3 | id1(["∧"]) 4 | id2(["c"]) 5 | id3(["d"]) 6 | id4(["∧"]) 7 | id5(["a"]) 8 | id6(["b"]) 9 | id7(["⇔"]) 10 | id8(["∧"]) 11 | id9(["c"]) 12 | id10(["d"]) 13 | id11(["∧"]) 14 | id12(["a"]) 15 | id13(["b"]) 16 | 17 | id1 --> id2 18 | id1 --> id3 19 | id0 --> id1 20 | id4 --> id5 21 | id4 --> id6 22 | id0 --> id4 23 | id8 --> id9 24 | id8 --> id10 25 | id11 --> id12 26 | id11 --> id13 27 | id7 --> id8 28 | id7 --> id11 29 | id0 --> id7 30 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f8-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | bgcolor="#020202" 3 | 4 | { rank = same; 5 | id2 [label="A", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 6 | id4 [label="B", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 7 | id6 [label="¬A", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 8 | id7 [label="C", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 9 | id8 [label="X", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 10 | id10 [label="a", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 11 | id11 [label="b", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 12 | id12 [label="c", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 13 | } 14 | id0 [label="⇒", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 15 | id1 [label="⇔", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 16 | id3 [label="∧", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 17 | id5 [label="∨", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 18 | id9 [label="a + b + c <= 2", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 19 | 20 | id3 -> id4 [color="#1289a7", fontcolor="#1289a7", style=bold] 21 | id5 -> id6 [color="#1289a7", fontcolor="#1289a7", style=bold] 22 | id5 -> id7 [color="#1289a7", fontcolor="#1289a7", style=bold] 23 | id5 -> id8 [color="#1289a7", fontcolor="#1289a7", style=bold] 24 | id3 -> id5 [color="#1289a7", fontcolor="#1289a7", style=bold] 25 | id1 -> id2 [color="#1289a7", fontcolor="#1289a7", style=bold] 26 | id1 -> id3 [color="#1289a7", fontcolor="#1289a7", style=bold] 27 | id9 -> id10 [color="#1289a7", fontcolor="#1289a7", style=bold] 28 | id9 -> id11 [color="#1289a7", fontcolor="#1289a7", style=bold] 29 | id9 -> id12 [color="#1289a7", fontcolor="#1289a7", style=bold] 30 | id0 -> id1 [color="#1289a7", fontcolor="#1289a7", style=bold, label="l"] 31 | id0 -> id9 [color="#1289a7", fontcolor="#1289a7", style=bold, label="r"] 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f8-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(("⇒")) 3 | style id0 stroke:#004f93,color:#ffffff,fill:#004f93 4 | id1(("⇔")) 5 | style id1 stroke:#004f93,color:#ffffff,fill:#004f93 6 | id2(("A")) 7 | style id2 stroke:#004f93,color:#ffffff,fill:#004f93 8 | id3(("∧")) 9 | style id3 stroke:#004f93,color:#ffffff,fill:#004f93 10 | id4(("B")) 11 | style id4 stroke:#004f93,color:#ffffff,fill:#004f93 12 | id5(("∨")) 13 | style id5 stroke:#004f93,color:#ffffff,fill:#004f93 14 | id6(("¬A")) 15 | style id6 stroke:#004f93,color:#ffffff,fill:#004f93 16 | id7(("C")) 17 | style id7 stroke:#004f93,color:#ffffff,fill:#004f93 18 | id8(("X")) 19 | style id8 stroke:#004f93,color:#ffffff,fill:#004f93 20 | id9(("a + b + c <= 2")) 21 | style id9 stroke:#004f93,color:#ffffff,fill:#004f93 22 | id10(("a")) 23 | style id10 stroke:#004f93,color:#ffffff,fill:#004f93 24 | id11(("b")) 25 | style id11 stroke:#004f93,color:#ffffff,fill:#004f93 26 | id12(("c")) 27 | style id12 stroke:#004f93,color:#ffffff,fill:#004f93 28 | 29 | id3 --> id4 30 | linkStyle 0 stroke:#1289a7,stroke-width:4 31 | id5 --> id6 32 | linkStyle 1 stroke:#1289a7,stroke-width:4 33 | id5 --> id7 34 | linkStyle 2 stroke:#1289a7,stroke-width:4 35 | id5 --> id8 36 | linkStyle 3 stroke:#1289a7,stroke-width:4 37 | id3 --> id5 38 | linkStyle 4 stroke:#1289a7,stroke-width:4 39 | id1 --> id2 40 | linkStyle 5 stroke:#1289a7,stroke-width:4 41 | id1 --> id3 42 | linkStyle 6 stroke:#1289a7,stroke-width:4 43 | id9 --> id10 44 | linkStyle 7 stroke:#1289a7,stroke-width:4 45 | id9 --> id11 46 | linkStyle 8 stroke:#1289a7,stroke-width:4 47 | id9 --> id12 48 | linkStyle 9 stroke:#1289a7,stroke-width:4 49 | id0 -->|"l"| id1 50 | linkStyle 10 stroke:#1289a7,stroke-width:4 51 | id0 -->|"r"| id9 52 | linkStyle 11 stroke:#1289a7,stroke-width:4 53 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f8-ownLabels-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | bgcolor="#020202" 3 | 4 | { rank = same; 5 | id2 [label="A", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 6 | id4 [label="B", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 7 | id6 [label="~A", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 8 | id7 [label="C", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 9 | id8 [label="X", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 10 | id10 [label="a", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 11 | id11 [label="b", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 12 | id12 [label="c", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 13 | } 14 | id0 [label="(A <=> B & (~A | C | X)) => (a + b + c <= 2)", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 15 | id1 [label="A <=> B & (~A | C | X)", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 16 | id3 [label="B & (~A | C | X)", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 17 | id5 [label="~A | C | X", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 18 | id9 [label="a + b + c <= 2", shape=box, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 19 | 20 | id3 -> id4 [color="#1289a7", fontcolor="#1289a7", style=bold] 21 | id5 -> id6 [color="#1289a7", fontcolor="#1289a7", style=bold] 22 | id5 -> id7 [color="#1289a7", fontcolor="#1289a7", style=bold] 23 | id5 -> id8 [color="#1289a7", fontcolor="#1289a7", style=bold] 24 | id3 -> id5 [color="#1289a7", fontcolor="#1289a7", style=bold] 25 | id1 -> id2 [color="#1289a7", fontcolor="#1289a7", style=bold] 26 | id1 -> id3 [color="#1289a7", fontcolor="#1289a7", style=bold] 27 | id9 -> id10 [color="#1289a7", fontcolor="#1289a7", style=bold] 28 | id9 -> id11 [color="#1289a7", fontcolor="#1289a7", style=bold] 29 | id9 -> id12 [color="#1289a7", fontcolor="#1289a7", style=bold] 30 | id0 -> id1 [color="#1289a7", fontcolor="#1289a7", style=bold, label="l"] 31 | id0 -> id9 [color="#1289a7", fontcolor="#1289a7", style=bold, label="r"] 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f8-ownLabels-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0["(A <=> B & (~A | C | X)) => (a + b + c <= 2)"] 3 | style id0 stroke:#004f93,color:#ffffff,fill:#004f93 4 | id1["A <=> B & (~A | C | X)"] 5 | style id1 stroke:#004f93,color:#ffffff,fill:#004f93 6 | id2["A"] 7 | style id2 stroke:#004f93,color:#ffffff,fill:#004f93 8 | id3["B & (~A | C | X)"] 9 | style id3 stroke:#004f93,color:#ffffff,fill:#004f93 10 | id4["B"] 11 | style id4 stroke:#004f93,color:#ffffff,fill:#004f93 12 | id5["~A | C | X"] 13 | style id5 stroke:#004f93,color:#ffffff,fill:#004f93 14 | id6["~A"] 15 | style id6 stroke:#004f93,color:#ffffff,fill:#004f93 16 | id7["C"] 17 | style id7 stroke:#004f93,color:#ffffff,fill:#004f93 18 | id8["X"] 19 | style id8 stroke:#004f93,color:#ffffff,fill:#004f93 20 | id9["a + b + c <= 2"] 21 | style id9 stroke:#004f93,color:#ffffff,fill:#004f93 22 | id10["a"] 23 | style id10 stroke:#004f93,color:#ffffff,fill:#004f93 24 | id11["b"] 25 | style id11 stroke:#004f93,color:#ffffff,fill:#004f93 26 | id12["c"] 27 | style id12 stroke:#004f93,color:#ffffff,fill:#004f93 28 | 29 | id3 --> id4 30 | linkStyle 0 stroke:#1289a7,stroke-width:4 31 | id5 --> id6 32 | linkStyle 1 stroke:#1289a7,stroke-width:4 33 | id5 --> id7 34 | linkStyle 2 stroke:#1289a7,stroke-width:4 35 | id5 --> id8 36 | linkStyle 3 stroke:#1289a7,stroke-width:4 37 | id3 --> id5 38 | linkStyle 4 stroke:#1289a7,stroke-width:4 39 | id1 --> id2 40 | linkStyle 5 stroke:#1289a7,stroke-width:4 41 | id1 --> id3 42 | linkStyle 6 stroke:#1289a7,stroke-width:4 43 | id9 --> id10 44 | linkStyle 7 stroke:#1289a7,stroke-width:4 45 | id9 --> id11 46 | linkStyle 8 stroke:#1289a7,stroke-width:4 47 | id9 --> id12 48 | linkStyle 9 stroke:#1289a7,stroke-width:4 49 | id0 -->|"l"| id1 50 | linkStyle 10 stroke:#1289a7,stroke-width:4 51 | id0 -->|"r"| id9 52 | linkStyle 11 stroke:#1289a7,stroke-width:4 53 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f9-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | bgcolor="#444444" 3 | 4 | id0 [label="⇒", shape=ellipse, color="#000000", fontcolor="#000000"] 5 | id1 [label="⇔", shape=ellipse, color="#000000", fontcolor="#000000"] 6 | id2 [label="A", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 7 | id3 [label="∧", shape=ellipse, color="#000000", fontcolor="#000000"] 8 | id4 [label="B", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 9 | id5 [label="∨", shape=ellipse, color="#000000", fontcolor="#000000"] 10 | id6 [label="¬A", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 11 | id7 [label="C", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 12 | id8 [label="X", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 13 | id9 [label="∧", shape=ellipse, color="#000000", fontcolor="#000000"] 14 | id10 [label="a + b + c <= 2", shape=box, color="#777777", fontcolor="#777777", style=filled, fillcolor="#e4e4e4"] 15 | id11 [label="a", shape=circle, color="#ffc612", fontcolor="#000000", style=filled, fillcolor="#ffc612"] 16 | id12 [label="b", shape=circle, color="#ffc612", fontcolor="#000000", style=filled, fillcolor="#ffc612"] 17 | id13 [label="c", shape=circle, color="#ffc612", fontcolor="#000000", style=filled, fillcolor="#ffc612"] 18 | id14 [label="⇒", shape=ellipse, color="#000000", fontcolor="#000000"] 19 | id15 [label="∨", shape=ellipse, color="#000000", fontcolor="#000000"] 20 | id16 [label="¬a", shape=circle, color="#ffc612", fontcolor="#000000", style=filled, fillcolor="#ffc612"] 21 | id17 [label="d", shape=circle, color="#ffc612", fontcolor="#000000", style=filled, fillcolor="#ffc612"] 22 | id18 [label="∧", shape=ellipse, color="#000000", fontcolor="#000000"] 23 | id19 [label="X", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 24 | id20 [label="¬B", shape=circle, color="#006266", fontcolor="#ffffff", style=filled, fillcolor="#006266"] 25 | 26 | id3 -> id4 27 | id5 -> id6 28 | id5 -> id7 29 | id5 -> id8 30 | id3 -> id5 31 | id1 -> id2 32 | id1 -> id3 33 | id10 -> id11 34 | id10 -> id12 35 | id10 -> id13 36 | id9 -> id10 37 | id15 -> id16 38 | id15 -> id17 39 | id18 -> id19 40 | id18 -> id20 41 | id14 -> id15 [label="l"] 42 | id14 -> id18 [label="r"] 43 | id9 -> id14 44 | id0 -> id1 [label="l"] 45 | id0 -> id9 [label="r"] 46 | } 47 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/f9-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["⇒"]) 3 | style id0 stroke:#000000,color:#000000 4 | id1(["⇔"]) 5 | style id1 stroke:#000000,color:#000000 6 | id2(("A")) 7 | style id2 stroke:#006266,color:#ffffff,fill:#006266 8 | id3(["∧"]) 9 | style id3 stroke:#000000,color:#000000 10 | id4(("B")) 11 | style id4 stroke:#006266,color:#ffffff,fill:#006266 12 | id5(["∨"]) 13 | style id5 stroke:#000000,color:#000000 14 | id6(("¬A")) 15 | style id6 stroke:#006266,color:#ffffff,fill:#006266 16 | id7(("C")) 17 | style id7 stroke:#006266,color:#ffffff,fill:#006266 18 | id8(("X")) 19 | style id8 stroke:#006266,color:#ffffff,fill:#006266 20 | id9(["∧"]) 21 | style id9 stroke:#000000,color:#000000 22 | id10["a + b + c <= 2"] 23 | style id10 stroke:#777777,color:#777777,fill:#e4e4e4 24 | id11(("a")) 25 | style id11 stroke:#ffc612,color:#000000,fill:#ffc612 26 | id12(("b")) 27 | style id12 stroke:#ffc612,color:#000000,fill:#ffc612 28 | id13(("c")) 29 | style id13 stroke:#ffc612,color:#000000,fill:#ffc612 30 | id14(["⇒"]) 31 | style id14 stroke:#000000,color:#000000 32 | id15(["∨"]) 33 | style id15 stroke:#000000,color:#000000 34 | id16(("¬a")) 35 | style id16 stroke:#ffc612,color:#000000,fill:#ffc612 36 | id17(("d")) 37 | style id17 stroke:#ffc612,color:#000000,fill:#ffc612 38 | id18(["∧"]) 39 | style id18 stroke:#000000,color:#000000 40 | id19(("X")) 41 | style id19 stroke:#006266,color:#ffffff,fill:#006266 42 | id20(("¬B")) 43 | style id20 stroke:#006266,color:#ffffff,fill:#006266 44 | 45 | id3 --> id4 46 | id5 --> id6 47 | id5 --> id7 48 | id5 --> id8 49 | id3 --> id5 50 | id1 --> id2 51 | id1 --> id3 52 | id10 --> id11 53 | id10 --> id12 54 | id10 --> id13 55 | id9 --> id10 56 | id15 --> id16 57 | id15 --> id17 58 | id18 --> id19 59 | id18 --> id20 60 | id14 -->|"l"| id15 61 | id14 -->|"r"| id18 62 | id9 --> id14 63 | id0 -->|"l"| id1 64 | id0 -->|"r"| id9 65 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/false-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="$false"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/false-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["$false"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/not_x-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="¬x"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/not_x-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["¬x"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/true-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="$true"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/true-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["$true"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/x-ast.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="x"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-ast/x-ast.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["x"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f1.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="¬c"] 6 | id3 [label="x"] 7 | id4 [label="z"] 8 | id5 [label="⇔"] 9 | id6 [label="∧"] 10 | id7 [label="⇒"] 11 | id8 [label="∨"] 12 | 13 | id6 -> id0 14 | id6 -> id1 15 | id8 -> id3 16 | id8 -> id4 17 | id7 -> id2 [label="l"] 18 | id7 -> id8 [label="r"] 19 | id5 -> id6 20 | id5 -> id7 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f1.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["¬c"]) 5 | id3(["x"]) 6 | id4(["z"]) 7 | id5(["⇔"]) 8 | id6(["∧"]) 9 | id7(["⇒"]) 10 | id8(["∨"]) 11 | 12 | id6 --> id0 13 | id6 --> id1 14 | id8 --> id3 15 | id8 --> id4 16 | id7 -->|"l"| id2 17 | id7 -->|"r"| id8 18 | id5 --> id6 19 | id5 --> id7 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f10.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="A"] 4 | id1 [label="¬A"] 5 | id2 [label="B"] 6 | id3 [label="¬B"] 7 | id4 [label="C"] 8 | id5 [label="X"] 9 | id6 [label="a"] 10 | id7 [label="¬a"] 11 | id8 [label="b"] 12 | id9 [label="c"] 13 | id10 [label="d"] 14 | id11 [label="⇒"] 15 | id12 [label="⇔"] 16 | id13 [label="∧"] 17 | id14 [label="∨"] 18 | id15 [label="∧"] 19 | id16 [label="a + b + c <= 2"] 20 | id17 [label="⇒"] 21 | id18 [label="∨"] 22 | id19 [label="∧"] 23 | 24 | id13 -> id2 25 | id14 -> id1 26 | id14 -> id4 27 | id14 -> id5 28 | id13 -> id14 29 | id12 -> id0 30 | id12 -> id13 31 | id16 -> id6 [color="#777777", fontcolor="#777777", style=dotted] 32 | id16 -> id8 [color="#777777", fontcolor="#777777", style=dotted] 33 | id16 -> id9 [color="#777777", fontcolor="#777777", style=dotted] 34 | id15 -> id16 35 | id18 -> id7 36 | id18 -> id10 37 | id19 -> id5 38 | id19 -> id3 39 | id17 -> id18 [label="l"] 40 | id17 -> id19 [label="r"] 41 | id15 -> id17 42 | id11 -> id12 [label="l"] 43 | id11 -> id15 [label="r"] 44 | } 45 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f10.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["A"]) 3 | id1(["¬A"]) 4 | id2(["B"]) 5 | id3(["¬B"]) 6 | id4(["C"]) 7 | id5(["X"]) 8 | id6(["a"]) 9 | id7(["¬a"]) 10 | id8(["b"]) 11 | id9(["c"]) 12 | id10(["d"]) 13 | id11(["⇒"]) 14 | id12(["⇔"]) 15 | id13(["∧"]) 16 | id14(["∨"]) 17 | id15(["∧"]) 18 | id16(["a + b + c <= 2"]) 19 | id17(["⇒"]) 20 | id18(["∨"]) 21 | id19(["∧"]) 22 | 23 | id13 --> id2 24 | id14 --> id1 25 | id14 --> id4 26 | id14 --> id5 27 | id13 --> id14 28 | id12 --> id0 29 | id12 --> id13 30 | id16 --> id6 31 | linkStyle 7 stroke:#777777,stroke-width:2,stroke-dasharray:3 32 | id16 --> id8 33 | linkStyle 8 stroke:#777777,stroke-width:2,stroke-dasharray:3 34 | id16 --> id9 35 | linkStyle 9 stroke:#777777,stroke-width:2,stroke-dasharray:3 36 | id15 --> id16 37 | id18 --> id7 38 | id18 --> id10 39 | id19 --> id5 40 | id19 --> id3 41 | id17 -->|"l"| id18 42 | id17 -->|"r"| id19 43 | id15 --> id17 44 | id11 -->|"l"| id12 45 | id11 -->|"r"| id15 46 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f2.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="¬c"] 6 | id3 [label="∨"] 7 | id4 [label="∧"] 8 | id5 [label="∧"] 9 | 10 | id4 -> id0 11 | id4 -> id1 12 | id3 -> id4 13 | id5 -> id1 14 | id5 -> id2 15 | id3 -> id5 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f2.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["¬c"]) 5 | id3(["∨"]) 6 | id4(["∧"]) 7 | id5(["∧"]) 8 | 9 | id4 --> id0 10 | id4 --> id1 11 | id3 --> id4 12 | id5 --> id1 13 | id5 --> id2 14 | id3 --> id5 15 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f3.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="¬c"] 6 | id3 [label="⇔"] 7 | id4 [label="∧"] 8 | id5 [label="⇒"] 9 | id6 [label="∨"] 10 | 11 | id4 -> id0 12 | id4 -> id1 13 | id6 -> id0 14 | id6 -> id1 15 | id5 -> id2 [label="l"] 16 | id5 -> id6 [label="r"] 17 | id3 -> id4 18 | id3 -> id5 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f3.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["¬c"]) 5 | id3(["⇔"]) 6 | id4(["∧"]) 7 | id5(["⇒"]) 8 | id6(["∨"]) 9 | 10 | id4 --> id0 11 | id4 --> id1 12 | id6 --> id0 13 | id6 --> id1 14 | id5 -->|"l"| id2 15 | id5 -->|"r"| id6 16 | id3 --> id4 17 | id3 --> id5 18 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f4.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="¬c"] 6 | id3 [label="∨"] 7 | id4 [label="¬"] 8 | id5 [label="∧"] 9 | id6 [label="∧"] 10 | 11 | id5 -> id0 12 | id5 -> id1 13 | id4 -> id5 14 | id3 -> id4 15 | id6 -> id1 16 | id6 -> id2 17 | id3 -> id6 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f4.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["¬c"]) 5 | id3(["∨"]) 6 | id4(["¬"]) 7 | id5(["∧"]) 8 | id6(["∧"]) 9 | 10 | id5 --> id0 11 | id5 --> id1 12 | id4 --> id5 13 | id3 --> id4 14 | id6 --> id1 15 | id6 --> id2 16 | id3 --> id6 17 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f5.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="¬b"] 5 | id2 [label="c"] 6 | id3 [label="∨"] 7 | id4 [label="2*a + 3*~b + 4*c <= 23"] 8 | 9 | id3 -> id0 10 | id3 -> id1 11 | id4 -> id0 12 | id4 -> id1 13 | id4 -> id2 14 | id3 -> id4 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f5.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["¬b"]) 4 | id2(["c"]) 5 | id3(["∨"]) 6 | id4(["2*a + 3*~b + 4*c <= 23"]) 7 | 8 | id3 --> id0 9 | id3 --> id1 10 | id4 --> id0 11 | id4 --> id1 12 | id4 --> id2 13 | id3 --> id4 14 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f6.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="c"] 6 | id3 [label="∨"] 7 | id4 [label="∧"] 8 | id5 [label="∧"] 9 | id6 [label="¬"] 10 | 11 | id4 -> id0 12 | id4 -> id1 13 | id3 -> id4 14 | id5 -> id2 15 | id6 -> id4 16 | id5 -> id6 17 | id3 -> id5 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f6.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["c"]) 5 | id3(["∨"]) 6 | id4(["∧"]) 7 | id5(["∧"]) 8 | id6(["¬"]) 9 | 10 | id4 --> id0 11 | id4 --> id1 12 | id3 --> id4 13 | id5 --> id2 14 | id6 --> id4 15 | id5 --> id6 16 | id3 --> id5 17 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f7.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="a"] 4 | id1 [label="b"] 5 | id2 [label="c"] 6 | id3 [label="d"] 7 | id4 [label="∨"] 8 | id5 [label="∧"] 9 | id6 [label="∧"] 10 | id7 [label="⇔"] 11 | 12 | id5 -> id2 13 | id5 -> id3 14 | id4 -> id5 15 | id6 -> id0 16 | id6 -> id1 17 | id4 -> id6 18 | id7 -> id5 19 | id7 -> id6 20 | id4 -> id7 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f7.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["a"]) 3 | id1(["b"]) 4 | id2(["c"]) 5 | id3(["d"]) 6 | id4(["∨"]) 7 | id5(["∧"]) 8 | id6(["∧"]) 9 | id7(["⇔"]) 10 | 11 | id5 --> id2 12 | id5 --> id3 13 | id4 --> id5 14 | id6 --> id0 15 | id6 --> id1 16 | id4 --> id6 17 | id7 --> id5 18 | id7 --> id6 19 | id4 --> id7 20 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f8.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | bgcolor="#020202" 3 | 4 | { rank = same; 5 | id0 [label="A", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 6 | id1 [label="¬A", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 7 | id2 [label="B", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 8 | id3 [label="C", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 9 | id4 [label="X", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 10 | id5 [label="a", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 11 | id6 [label="b", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 12 | id7 [label="c", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 13 | } 14 | id8 [label="⇒", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 15 | id9 [label="⇔", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 16 | id10 [label="∧", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 17 | id11 [label="∨", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 18 | id12 [label="a + b + c <= 2", shape=circle, color="#004f93", fontcolor="#ffffff", style=filled, fillcolor="#004f93"] 19 | 20 | id10 -> id2 [color="#1289a7", fontcolor="#1289a7", style=bold] 21 | id11 -> id1 [color="#1289a7", fontcolor="#1289a7", style=bold] 22 | id11 -> id3 [color="#1289a7", fontcolor="#1289a7", style=bold] 23 | id11 -> id4 [color="#1289a7", fontcolor="#1289a7", style=bold] 24 | id10 -> id11 [color="#1289a7", fontcolor="#1289a7", style=bold] 25 | id9 -> id0 [color="#1289a7", fontcolor="#1289a7", style=bold] 26 | id9 -> id10 [color="#1289a7", fontcolor="#1289a7", style=bold] 27 | id12 -> id5 [color="#1289a7", fontcolor="#1289a7", style=bold] 28 | id12 -> id6 [color="#1289a7", fontcolor="#1289a7", style=bold] 29 | id12 -> id7 [color="#1289a7", fontcolor="#1289a7", style=bold] 30 | id8 -> id9 [color="#1289a7", fontcolor="#1289a7", style=bold, label="l"] 31 | id8 -> id12 [color="#1289a7", fontcolor="#1289a7", style=bold, label="r"] 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/f8.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(("A")) 3 | style id0 stroke:#004f93,color:#ffffff,fill:#004f93 4 | id1(("¬A")) 5 | style id1 stroke:#004f93,color:#ffffff,fill:#004f93 6 | id2(("B")) 7 | style id2 stroke:#004f93,color:#ffffff,fill:#004f93 8 | id3(("C")) 9 | style id3 stroke:#004f93,color:#ffffff,fill:#004f93 10 | id4(("X")) 11 | style id4 stroke:#004f93,color:#ffffff,fill:#004f93 12 | id5(("a")) 13 | style id5 stroke:#004f93,color:#ffffff,fill:#004f93 14 | id6(("b")) 15 | style id6 stroke:#004f93,color:#ffffff,fill:#004f93 16 | id7(("c")) 17 | style id7 stroke:#004f93,color:#ffffff,fill:#004f93 18 | id8(("⇒")) 19 | style id8 stroke:#004f93,color:#ffffff,fill:#004f93 20 | id9(("⇔")) 21 | style id9 stroke:#004f93,color:#ffffff,fill:#004f93 22 | id10(("∧")) 23 | style id10 stroke:#004f93,color:#ffffff,fill:#004f93 24 | id11(("∨")) 25 | style id11 stroke:#004f93,color:#ffffff,fill:#004f93 26 | id12(("a + b + c <= 2")) 27 | style id12 stroke:#004f93,color:#ffffff,fill:#004f93 28 | 29 | id10 --> id2 30 | linkStyle 0 stroke:#1289a7,stroke-width:4 31 | id11 --> id1 32 | linkStyle 1 stroke:#1289a7,stroke-width:4 33 | id11 --> id3 34 | linkStyle 2 stroke:#1289a7,stroke-width:4 35 | id11 --> id4 36 | linkStyle 3 stroke:#1289a7,stroke-width:4 37 | id10 --> id11 38 | linkStyle 4 stroke:#1289a7,stroke-width:4 39 | id9 --> id0 40 | linkStyle 5 stroke:#1289a7,stroke-width:4 41 | id9 --> id10 42 | linkStyle 6 stroke:#1289a7,stroke-width:4 43 | id12 --> id5 44 | linkStyle 7 stroke:#1289a7,stroke-width:4 45 | id12 --> id6 46 | linkStyle 8 stroke:#1289a7,stroke-width:4 47 | id12 --> id7 48 | linkStyle 9 stroke:#1289a7,stroke-width:4 49 | id8 -->|"l"| id9 50 | linkStyle 10 stroke:#1289a7,stroke-width:4 51 | id8 -->|"r"| id12 52 | linkStyle 11 stroke:#1289a7,stroke-width:4 53 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/false.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="$false"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/false.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["$false"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/not_x.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="¬x"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/not_x.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["¬x"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/true.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="$true"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/true.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["$true"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/x.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | id0 [label="x"] 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dag/x.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["x"]) 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f1_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 5 7 2 | -1 -2 3 4 5 0 3 | 1 -3 0 4 | 1 -4 0 5 | 1 -5 0 6 | 2 -3 0 7 | 2 -4 0 8 | 2 -5 0 9 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f1_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 5 7 2 | -1 -2 3 4 5 0 3 | 1 -3 0 4 | 1 -4 0 5 | 1 -5 0 6 | 2 -3 0 7 | 2 -4 0 8 | 2 -5 0 9 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f1_t.map: -------------------------------------------------------------------------------- 1 | a;1 2 | b;2 3 | c;3 4 | x;4 5 | z;5 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f2_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 4 2 | 1 2 0 3 | 1 -3 0 4 | 2 0 5 | 2 -3 0 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f2_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 4 2 | 1 2 0 3 | 1 -3 0 4 | 2 0 5 | 2 -3 0 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f2_t.map: -------------------------------------------------------------------------------- 1 | a;1 2 | b;2 3 | c;3 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f3_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 4 2 | 1 -3 0 3 | 1 -2 0 4 | 2 -3 0 5 | -1 2 0 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f3_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 4 2 | 1 -3 0 3 | 1 -2 0 4 | 2 -3 0 5 | -1 2 0 6 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f3_t.map: -------------------------------------------------------------------------------- 1 | a;1 2 | b;2 3 | c;3 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f4_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 1 2 | -1 -2 -3 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f4_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 1 2 | -1 -2 -3 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f4_t.map: -------------------------------------------------------------------------------- 1 | a;1 2 | b;2 3 | c;3 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f5_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 15 13 2 | -1 7 13 -14 0 3 | -2 8 13 -14 0 4 | -5 9 13 -14 0 5 | -6 10 13 -14 0 6 | -7 11 13 -14 0 7 | 11 13 -14 -15 0 8 | -8 12 13 -14 0 9 | 12 13 -14 -15 0 10 | 3 -9 13 -14 0 11 | 3 13 -14 -15 0 12 | 4 -10 13 -14 0 13 | 4 13 -14 -15 0 14 | -7 13 -14 -15 0 15 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f5_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 15 13 2 | -1 7 13 -14 0 3 | -2 8 13 -14 0 4 | -5 9 13 -14 0 5 | -6 10 13 -14 0 6 | -7 11 13 -14 0 7 | 11 13 -14 -15 0 8 | -8 12 13 -14 0 9 | 12 13 -14 -15 0 10 | 3 -9 13 -14 0 11 | 3 13 -14 -15 0 12 | 4 -10 13 -14 0 13 | 4 13 -14 -15 0 14 | -7 13 -14 -15 0 15 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f5_t.map: -------------------------------------------------------------------------------- 1 | @RESERVED_PB_0;1 2 | @RESERVED_PB_1;2 3 | @RESERVED_PB_10;3 4 | @RESERVED_PB_11;4 5 | @RESERVED_PB_2;5 6 | @RESERVED_PB_3;6 7 | @RESERVED_PB_4;7 8 | @RESERVED_PB_5;8 9 | @RESERVED_PB_6;9 10 | @RESERVED_PB_7;10 11 | @RESERVED_PB_8;11 12 | @RESERVED_PB_9;12 13 | a;13 14 | b;14 15 | c;15 16 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f6_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 2 2 | 1 3 0 3 | 2 3 0 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f6_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 3 2 2 | 1 3 0 3 | 2 3 0 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f6_t.map: -------------------------------------------------------------------------------- 1 | a;1 2 | b;2 3 | c;3 4 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f7_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 0 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f7_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 0 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/f7_t.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/src/test/resources/writers/formulas-dimacs/f7_t.map -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/false_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 1 2 | 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/false_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 1 2 | 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/false_t.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/src/test/resources/writers/formulas-dimacs/false_t.map -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/not_x_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 1 1 2 | -1 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/not_x_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 1 1 2 | -1 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/not_x_t.map: -------------------------------------------------------------------------------- 1 | x;1 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/true_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 0 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/true_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 0 0 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/true_t.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/src/test/resources/writers/formulas-dimacs/true_t.map -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/x_f.cnf: -------------------------------------------------------------------------------- 1 | p cnf 1 1 2 | 1 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/x_t.cnf: -------------------------------------------------------------------------------- 1 | p cnf 1 1 2 | 1 0 3 | -------------------------------------------------------------------------------- /src/test/resources/writers/formulas-dimacs/x_t.map: -------------------------------------------------------------------------------- 1 | x;1 2 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/30.dot: -------------------------------------------------------------------------------- 1 | strict graph { 2 | 3 | id0 [label="0"] 4 | id1 [label="6"] 5 | id2 [label="13"] 6 | id3 [label="19"] 7 | id4 [label="28"] 8 | id5 [label="1"] 9 | id6 [label="21"] 10 | id7 [label="7"] 11 | id8 [label="15"] 12 | id9 [label="2"] 13 | id10 [label="4"] 14 | id11 [label="3"] 15 | id12 [label="16"] 16 | id13 [label="9"] 17 | id14 [label="10"] 18 | id15 [label="14"] 19 | id16 [label="5"] 20 | id17 [label="8"] 21 | id18 [label="17"] 22 | id19 [label="23"] 23 | id20 [label="25"] 24 | id21 [label="24"] 25 | id22 [label="27"] 26 | id23 [label="12"] 27 | id24 [label="20"] 28 | id25 [label="18"] 29 | id26 [label="29"] 30 | id27 [label="11"] 31 | id28 [label="22"] 32 | id29 [label="26"] 33 | 34 | id0 -- id1 35 | id0 -- id2 36 | id1 -- id2 37 | id1 -- id3 38 | id1 -- id4 39 | id5 -- id6 40 | id6 -- id7 41 | id6 -- id8 42 | id9 -- id4 43 | id4 -- id10 44 | id11 -- id12 45 | id12 -- id13 46 | id12 -- id14 47 | id12 -- id15 48 | id16 -- id17 49 | id17 -- id18 50 | id17 -- id19 51 | id17 -- id20 52 | id18 -- id21 53 | id18 -- id22 54 | id13 -- id23 55 | id13 -- id24 56 | id23 -- id15 57 | id24 -- id25 58 | id14 -- id25 59 | id8 -- id26 60 | id21 -- id22 61 | } 62 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/30.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["0"]) 3 | id1(["6"]) 4 | id2(["13"]) 5 | id3(["19"]) 6 | id4(["28"]) 7 | id5(["1"]) 8 | id6(["21"]) 9 | id7(["7"]) 10 | id8(["15"]) 11 | id9(["2"]) 12 | id10(["4"]) 13 | id11(["3"]) 14 | id12(["16"]) 15 | id13(["9"]) 16 | id14(["10"]) 17 | id15(["14"]) 18 | id16(["5"]) 19 | id17(["8"]) 20 | id18(["17"]) 21 | id19(["23"]) 22 | id20(["25"]) 23 | id21(["24"]) 24 | id22(["27"]) 25 | id23(["12"]) 26 | id24(["20"]) 27 | id25(["18"]) 28 | id26(["29"]) 29 | id27(["11"]) 30 | id28(["22"]) 31 | id29(["26"]) 32 | 33 | id0 --- id1 34 | id0 --- id2 35 | id1 --- id2 36 | id1 --- id3 37 | id1 --- id4 38 | id5 --- id6 39 | id6 --- id7 40 | id6 --- id8 41 | id9 --- id4 42 | id4 --- id10 43 | id11 --- id12 44 | id12 --- id13 45 | id12 --- id14 46 | id12 --- id15 47 | id16 --- id17 48 | id17 --- id18 49 | id17 --- id19 50 | id17 --- id20 51 | id18 --- id21 52 | id18 --- id22 53 | id13 --- id23 54 | id13 --- id24 55 | id23 --- id15 56 | id24 --- id25 57 | id14 --- id25 58 | id8 --- id26 59 | id21 --- id22 60 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/small-fixedStyle.dot: -------------------------------------------------------------------------------- 1 | strict graph { 2 | bgcolor="#4f4f4f" 3 | 4 | id0 [label="A", color="#ea2027", fontcolor="#009432"] 5 | id1 [label="B", color="#ea2027", fontcolor="#009432"] 6 | id2 [label="C", color="#ea2027", fontcolor="#009432"] 7 | 8 | id0 -- id1 [color="#ffffff", fontcolor="#ffffff", style=dotted] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/small-fixedStyle.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["A"]) 3 | style id0 stroke:#ea2027,color:#009432 4 | id1(["B"]) 5 | style id1 stroke:#ea2027,color:#009432 6 | id2(["C"]) 7 | style id2 stroke:#ea2027,color:#009432 8 | 9 | id0 --- id1 10 | linkStyle 0 stroke:#ffffff,stroke-width:2,stroke-dasharray:3 11 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/small.dot: -------------------------------------------------------------------------------- 1 | strict graph { 2 | 3 | id0 [label="A"] 4 | id1 [label="B"] 5 | id2 [label="C"] 6 | 7 | id0 -- id1 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/writers/graph/small.txt: -------------------------------------------------------------------------------- 1 | graph TD 2 | id0(["A"]) 3 | id1(["B"]) 4 | id2(["C"]) 5 | 6 | id0 --- id1 7 | -------------------------------------------------------------------------------- /src/test/resources/writers/temp/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/logic-ng/LogicNG/47d1db35c450f780d1327af51a33bc7165cbde3a/src/test/resources/writers/temp/.empty --------------------------------------------------------------------------------