Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7fa3a4e
refactored bipolar argumentation
larsbengel May 8, 2026
1a09353
bugfix in unit tests
larsbengel May 26, 2026
6429e87
refactoring of dung-web interface
larsbengel May 26, 2026
592ccee
bugfix RequestController
larsbengel May 26, 2026
b02478f
added web interface for acceptability reasoner
larsbengel May 27, 2026
4c5adf3
bugfix in dung web-interface
larsbengel May 27, 2026
cf36b97
some experimental QBAF stuff
larsbengel May 29, 2026
c37d45a
some experimental QBAF stuff
larsbengel May 29, 2026
51eeb0b
updated reasoner for bipolar argumentation
larsbengel May 31, 2026
b76cc40
updated web interface for ranking reasoners
larsbengel May 31, 2026
fb94fd2
updated web interface for ranking reasoners
larsbengel Jun 1, 2026
7b5f0bd
updated web interface for ranking reasoners
larsbengel Jun 1, 2026
c2dc47f
refactored some ADF stuff;
larsbengel Jun 2, 2026
27cda65
minor fix
larsbengel Jun 2, 2026
977c815
bugfix for MinisatSolver use in TweetyServer
larsbengel Jun 2, 2026
24a2d56
refactored get_models command handling in RequestController
larsbengel Jun 2, 2026
e29d86c
refactor runServicesWithTimeout to use Double for execution time
larsbengel Jun 4, 2026
dccc6c0
streamlined web interface functions
larsbengel Jun 9, 2026
5f5dcf7
Merge branch 'bipolar' of github.com:TweetyProjectTeam/TweetyProject …
larsbengel Jun 9, 2026
5240bc6
streamlined web interface functions
larsbengel Jun 9, 2026
2772fcf
streamlined web interface functions
larsbengel Jun 9, 2026
23319aa
streamlined web interface functions
larsbengel Jun 9, 2026
531de6d
some refactoring of incomplete AFs
larsbengel Jun 9, 2026
a18cdd7
Added web interface for incomplete AFs
larsbengel Jun 10, 2026
a88735f
Update test cases to reflect changes in response validation
larsbengel Jun 10, 2026
e1feb5d
bugfix in test case
larsbengel Jun 10, 2026
fcc3690
Update test cases to set 'time' parameter to false for consistency
larsbengel Jun 10, 2026
350cf6c
bugfixes
larsbengel Jun 10, 2026
35c1147
Add PAF functionality with new endpoints and request handling
larsbengel Jun 11, 2026
e44b630
Update copyright year to 2026 in PAF-related classes and imports
larsbengel Jun 11, 2026
e1ab0ed
added proper web interface for ProbAFs; bugfixes
larsbengel Jun 12, 2026
4e5cd3b
bugfixes
larsbengel Jun 12, 2026
e806e65
Remove unused parameter 'argument' from getCallee method in PafReason…
larsbengel Jun 12, 2026
cb0ca8e
Merge branch 'bipolar' of https://github.com/TweetyProjectTeam/Tweety…
larsbengel Jun 12, 2026
5aa2e8f
added info regarding ranking type to web interface response
larsbengel Jun 13, 2026
a004b39
Merge remote-tracking branch 'origin/bipolar' into bipolar
larsbengel Jun 13, 2026
c58613b
Fix JSON response formatting in RequestControllerCausalTest
larsbengel Jun 14, 2026
0a7bfc5
minor fixes
larsbengel Jun 14, 2026
2bb36a3
Merge remote-tracking branch 'origin/bipolar' into bipolar
larsbengel Jun 14, 2026
c3cbc56
Disable tests for causal reasoner calculations and sequence explanations
larsbengel Jun 14, 2026
92ec199
Merge remote-tracking branch 'origin/bipolar' into bipolar
larsbengel Jun 14, 2026
e9c46fa
added missing javadoc comments
larsbengel Jun 14, 2026
7695f14
added missing javadoc comments
larsbengel Jun 14, 2026
e7db905
bugfix in unittest
larsbengel Jun 14, 2026
b488de2
disabled faulty unittests
larsbengel Jun 14, 2026
91ebf87
add missing javadoc comments
larsbengel Jun 14, 2026
0fc879b
minor fixes
larsbengel Jun 14, 2026
9feb981
moved gradual semantics to new branch
larsbengel Jun 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* This file is part of "TweetyProject", a collection of Java libraries for
* logical aspects of artificial intelligence and knowledge representation.
*
* TweetyProject is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2026 The TweetyProject Team <http://tweetyproject.org/contact/>
*/
package org.tweetyproject.arg.adf.reasoner;

import org.tweetyproject.arg.adf.semantics.interpretation.Interpretation;
import org.tweetyproject.arg.adf.syntax.Argument;
import org.tweetyproject.arg.adf.syntax.adf.AbstractDialecticalFramework;
import org.tweetyproject.arg.dung.semantics.Extension;
import org.tweetyproject.arg.dung.syntax.DungTheory;
import org.tweetyproject.commons.InferenceMode;
import org.tweetyproject.commons.ModelProvider;
import org.tweetyproject.commons.QualitativeReasoner;

import java.util.Collection;
import java.util.HashSet;

/**
* Abstract class for reasoners of ADF semantics
*
* @author Lars Bengel
*/
public abstract class AbstractADFReasoner implements QualitativeReasoner<AbstractDialecticalFramework, Argument>, ModelProvider<Argument,AbstractDialecticalFramework,Interpretation> {
@Override
public Boolean query(AbstractDialecticalFramework bbase, Argument formula) {
return this.query(bbase, formula, InferenceMode.SKEPTICAL);
}

/**
* Determine the set of acceptable arguments wrt. the given inference mode
* @param bbase some ADF
* @param inferenceMode the inference mode
* @return the set of acceptable arguments
*/
public Collection<Argument> queryAll(AbstractDialecticalFramework bbase, InferenceMode inferenceMode) {
Collection<Argument> result = new HashSet<>();
Collection<Interpretation> models = this.getModels(bbase);
if(inferenceMode.equals(InferenceMode.CREDULOUS)) {
for (Interpretation model : models)
result.addAll(model.satisfied());
} else {
result.addAll(bbase);
for(Interpretation model: models)
result.retainAll(model.satisfied());
}
return result;
}

/**
* Queries the given ADF for the given argument using the given
* inference type.
* @param beliefbase an ADF
* @param formula a single argument
* @param inferenceMode either InferenceMode.SKEPTICAL or InferenceMode.CREDULOUS
* @return "true" if the argument is accepted
*/
public Boolean query(AbstractDialecticalFramework beliefbase, Argument formula, InferenceMode inferenceMode) {
Collection<Interpretation> models = this.getModels(beliefbase);
if(inferenceMode.equals(InferenceMode.SKEPTICAL)){
for(Interpretation m: models)
if(!m.satisfies(formula))
return false;
return true;
}
// so its credulous semantics
for(Interpretation m: models){
if(m.satisfies(formula))
return true;
}
return false;
}

@Override
public boolean isInstalled() {
return true;
}

@Override
public Interpretation getModel(AbstractDialecticalFramework bbase) {
return getModels(bbase).iterator().next();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @deprecated use {@link AbstractDialecticalFramework#query()} instead
*/
@Deprecated( forRemoval = true, since = "1.19" )
public abstract class AbstractDialecticalFrameworkReasoner {
public abstract class AbstractDialecticalFrameworkReasoner extends AbstractADFReasoner {

private final IncrementalSatSolver solver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.tweetyproject.arg.adf.sat.SatSolverState;
import org.tweetyproject.arg.adf.semantics.interpretation.Interpretation;
import org.tweetyproject.arg.adf.syntax.Argument;
import org.tweetyproject.arg.adf.syntax.adf.AbstractDialecticalFramework;

/**
* ParallelExecution class
Expand Down Expand Up @@ -414,6 +415,21 @@ public Set<Argument> undecided() {
public Set<Argument> arguments() {
return Set.of();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return false;
}

@Override
public boolean satisfies(Collection<Argument> formulas) throws IllegalArgumentException {
return false;
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
return false;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,46 @@ public final class NativeMinisatSolver implements IncrementalSatSolver {

private static final String DEFAULT_WIN_LIB = "/minisat.dll";
private static final String DEFAULT_LINUX_LIB = "/minisat.so";
private static volatile boolean loaded = false;

/**
* NativeMinisatSolver
*/
public NativeMinisatSolver() {
loadLibrary();
}

private static synchronized void loadLibrary() {
if (loaded) return;
String osName = System.getProperty("os.name").toLowerCase();
String lib = null;
if (osName.contains("win")) {
lib = DEFAULT_WIN_LIB;
} else if (osName.contains("nux")) {
lib = DEFAULT_LINUX_LIB;
}
String path = getClass().getResource(lib).getPath();
System.load(path);
if (lib == null) {
throw new UnsatisfiedLinkError("Unsupported OS: " + osName);
}
try {
java.net.URL resource = NativeMinisatSolver.class.getResource(lib);
String path = resource.getPath();
if (path.contains("!")) {
// Library is bundled inside a JAR — extract to a temp file first
String suffix = lib.substring(lib.lastIndexOf('.'));
java.io.File tempFile = java.io.File.createTempFile("minisat", suffix);
tempFile.deleteOnExit();
try (java.io.InputStream is = NativeMinisatSolver.class.getResourceAsStream(lib)) {
java.nio.file.Files.copy(is, tempFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
}
System.load(tempFile.getAbsolutePath());
} else {
System.load(path);
}
loaded = true;
} catch (java.io.IOException e) {
throw new RuntimeException("Failed to extract native minisat library", e);
}
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author Mathias Hofer
*
*/
public interface Interpretation {
public interface Interpretation extends org.tweetyproject.commons.Interpretation<AbstractDialecticalFramework, Argument> {
/**
*
* @param adf adf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,20 @@
*/
package org.tweetyproject.arg.adf.semantics.interpretation;

import java.util.Collections;
import java.util.Iterator;
import java.util.Objects;
import java.util.Set;
import java.util.*;

import org.tweetyproject.arg.adf.syntax.Argument;
import org.tweetyproject.arg.adf.syntax.adf.AbstractDialecticalFramework;
import org.tweetyproject.arg.adf.util.UnionSetView;
import org.tweetyproject.commons.AbstractInterpretation;

/**
* @author Mathias Hofer
*
*/
final class Interpretations {

static final class EmptyInterpretation implements Interpretation {
static final class EmptyInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Set<Argument> undecided;

Expand Down Expand Up @@ -128,6 +126,16 @@ public String toString() {
builder.append("}");
return builder.toString();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return false;
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

/**
Expand All @@ -138,7 +146,7 @@ public String toString() {
* @author Mathias Hofer
*
*/
static final class SetInterpretation implements Interpretation {
static final class SetInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Set<Argument> satisfied;

Expand Down Expand Up @@ -235,9 +243,19 @@ public String toString() {
s.append("}");
return s.toString();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return satisfied().contains(formula);
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

static final class SingleSatisfiedInterpretation implements Interpretation {
static final class SingleSatisfiedInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Argument argument;

Expand Down Expand Up @@ -306,9 +324,19 @@ public boolean equals(Object obj) {
public String toString() {
return new StringBuilder("{t(").append("argument").append(")}").toString();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return satisfied().contains(formula);
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

static final class SingleUnsatisfiedInterpretation implements Interpretation {
static final class SingleUnsatisfiedInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Argument argument;

Expand Down Expand Up @@ -377,9 +405,19 @@ public boolean equals(Object obj) {
public String toString() {
return new StringBuilder("{f(").append("argument").append(")}").toString();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return satisfied().contains(formula);
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

static final class SingleUndecidedInterpretation implements Interpretation {
static final class SingleUndecidedInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Argument argument;

Expand Down Expand Up @@ -448,6 +486,16 @@ public boolean equals(Object obj) {
public String toString() {
return new StringBuilder("{u(").append("argument").append(")}").toString();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return satisfied().contains(formula);
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.util.Set;

import org.tweetyproject.arg.adf.syntax.Argument;
import org.tweetyproject.arg.adf.syntax.adf.AbstractDialecticalFramework;
import org.tweetyproject.commons.AbstractInterpretation;

/**
* TwoValuedInterpretationIterator class
Expand Down Expand Up @@ -74,7 +76,7 @@ public Interpretation next() {
return new TwoValuedInterpretation(arguments, value++);
}

private static final class TwoValuedInterpretation implements Interpretation {
private static final class TwoValuedInterpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements Interpretation {

private final Map<Argument, Integer> indexMap;

Expand Down Expand Up @@ -148,6 +150,15 @@ public Set<Argument> arguments() {
return indexMap.keySet();
}

@Override
public boolean satisfies(Argument formula) throws IllegalArgumentException {
return satisfied().contains(formula);
}

@Override
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws IllegalArgumentException {
throw new IllegalArgumentException("Satisfaction of belief bases by ADF interpretations is undefined.");
}
}

}
Loading
Loading