Skip to content

Commit ceadac5

Browse files
author
matthias.thimm
committed
minor fixes and wording
1 parent f7e5159 commit ceadac5

3 files changed

Lines changed: 43 additions & 36 deletions

File tree

org-tweetyproject-web/src/main/java/org/tweetyproject/web/pyargservices/RequestController.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
import java.util.concurrent.Future;
1313
import java.util.concurrent.TimeUnit;
1414
import java.util.concurrent.TimeoutException;
15-
import java.util.concurrent.atomic.AtomicLong;
1615

1716
import org.json.JSONException;
18-
import org.springframework.http.ResponseEntity;
19-
import org.springframework.web.bind.annotation.CrossOrigin;
20-
import org.springframework.web.bind.annotation.GetMapping;
2117
import org.springframework.web.bind.annotation.PostMapping;
2218
import org.springframework.web.bind.annotation.RestController;
2319
import org.tweetyproject.arg.dung.syntax.DungTheory;
@@ -26,16 +22,23 @@
2622
import org.tweetyproject.commons.Parser;
2723
import org.tweetyproject.commons.ParserException;
2824
import org.tweetyproject.logics.commons.analysis.InconsistencyMeasure;
25+
import org.tweetyproject.logics.commons.analysis.NaiveMusEnumerator;
2926
import org.tweetyproject.logics.fol.parser.FolParser;
3027
import org.tweetyproject.logics.fol.syntax.FolFormula;
3128
import org.tweetyproject.logics.fol.syntax.Negation;
3229
import org.tweetyproject.logics.pl.analysis.InconsistencyMeasureFactory;
3330
import org.tweetyproject.logics.pl.analysis.InconsistencyMeasureFactory.Measure;
3431
import org.tweetyproject.logics.pl.parser.PlParserFactory;
3532
import org.tweetyproject.logics.pl.parser.PlParserFactory.Format;
33+
import org.tweetyproject.logics.pl.sat.PlMusEnumerator;
34+
import org.tweetyproject.logics.pl.sat.Sat4jSolver;
35+
import org.tweetyproject.logics.pl.sat.SatSolver;
3636
import org.tweetyproject.logics.pl.syntax.PlBeliefSet;
3737
import org.tweetyproject.logics.pl.syntax.PlFormula;
3838
import org.tweetyproject.logics.pl.syntax.PlSignature;
39+
import org.tweetyproject.math.opt.solver.ApacheCommonsSimplex;
40+
import org.tweetyproject.math.opt.solver.GlpkSolver;
41+
import org.tweetyproject.math.opt.solver.Solver;
3942
import org.tweetyproject.web.TweetyServer;
4043
import org.tweetyproject.web.pyargservices.dung.AbstractExtensionReasonerFactory;
4144
import org.tweetyproject.web.pyargservices.dung.DungReasonerCalleeFactory;
@@ -50,7 +53,6 @@
5053
import org.tweetyproject.web.services.InconsistencyMeasurementService;
5154
import org.springframework.web.bind.annotation.ResponseBody;
5255
import org.springframework.web.bind.annotation.RequestBody;
53-
import org.springframework.web.bind.annotation.RequestParam;
5456
import org.tweetyproject.arg.delp.parser.DelpParser;
5557
import org.tweetyproject.arg.delp.reasoner.DelpReasoner;
5658
import org.tweetyproject.arg.delp.semantics.ComparisonCriterion;
@@ -259,6 +261,12 @@ private InconsistencyValueResponse handleGetICMESValue(InconsistencyPost query)
259261
int user_timeout = Utils.checkUserTimeout(query.getTimeout(), SERVICES_TIMEOUT_INCMES, unit);
260262
// if(!query.has(InconsistencyMeasurementService.JSON_ATTR_MEASURE))
261263
// throw new JSONException("Malformed JSON: no \"measure\" attribute given");
264+
// set sub-solvers
265+
SatSolver.setDefaultSolver(new Sat4jSolver());
266+
PlMusEnumerator.setDefaultEnumerator(new NaiveMusEnumerator<PlFormula>(new Sat4jSolver()));
267+
Solver.setDefaultLinearSolver(new ApacheCommonsSimplex());
268+
Solver.setDefaultIntegerLinearSolver(new GlpkSolver());
269+
// get measure
262270
InconsistencyMeasure<BeliefSet<PlFormula,?>> measure =
263271
InconsistencyMeasureFactory.getInconsistencyMeasure(
264272
Measure.getMeasure(query.getMeasure()));

org-tweetyproject-web/src/webapp/delp/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html>
33
<head>
4-
<title>Tweety@Web: Defeasible Logic Programming</title>
4+
<title>TweetyProject@Web: Defeasible Logic Programming</title>
55
<link rel="stylesheet" type="text/css" href="styles.css">
66
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
77
<script type="text/JavaScript" src="js/scripts.js"></script>
88
</head>
99
<body style="font-family: Arial;">
1010
<div align="center" width="100%">
1111
<table style="width:800px;" cellspacing="0" cellpadding="0">
12-
<tr>
12+
<tr>
1313
<td colspan="2">
1414
<a href="http://tweetyproject.org"><img border="0" src="img/tweety_small.png" style="float:left;width:40px;padding-right:6px;"/></a>
15-
<div style="font-size:14pt;font-weight:bold;">Tweety@Web</div>
15+
<div style="font-size:14pt;font-weight:bold;">TweetyProject@Web</div>
1616
<div style="font-size:11pt;">Defeasible Logic Programming
1717
<span style="float:right;font-size:10pt;">Server status: <span id="server_status"><img style="vertical-align:text-top;" width="15" height="15" src="img/loading.gif"></img></span></span>
18-
</div><hr noshade="noshade" size="1" /></td>
18+
</div><hr noshade="noshade" size="1" /></td>
1919
</tr>
2020
<tr>
2121
<td colspan="2">
2222
<p style="font-size:10pt;">This webpage provides a web service for Defeasible Logic Programming (DeLP). For details see the main reference: <i>Alejandro Garcia and Guillermo R. Simari. Defeasible Logic Programming: An Argumentative Approach. Theory and Practice of Logic Programming 4(1-2):95--138, 2004.</i></p>
2323
</td>
24-
</tr>
24+
</tr>
2525
<tr>
2626
<td colspan="2"><br/><div style="font-size:11pt;font-weight:bold">Online querying</div><hr noshade="noshade" size="1" /></td>
2727
</tr>
@@ -77,7 +77,7 @@
7777
</tr>
7878
<tr>
7979
<td colspan="2">
80-
<p style="font-size:10pt;">The above web interface uses a REST API to remotely access the Tweety server for querying. If you need to integrate the web service in your own applications you can also use this REST API directly. Communication between a client and the server is done using JSON (in UTF-8), the URL of the server is <span id="serverurl"></span>. The API supports only one command at this point:</p>
80+
<p style="font-size:10pt;">The above web interface uses a REST API to remotely access the TweetyProject server for querying. If you need to integrate the web service in your own applications you can also use this REST API directly. Communication between a client and the server is done using JSON (in UTF-8), the URL of the server is <span id="serverurl"></span>. The API supports only one command at this point:</p>
8181
<ol style="font-size:10pt;">
8282
<li><b>Query a Defeasible Logic Program</b>
8383
<p>Querying a Defeasible Logic Program is done by issuing the request</p>
@@ -104,29 +104,29 @@
104104
</li>
105105
</ol>
106106
<p style="font-size:10pt;">You may also want to look at <a href="js/scripts.js">scripts.js</a> which is the JavaScript file underlying the web-based client on this page in order to see how the API is used from within JavaScript.</p>
107-
<p style="font-size:10pt;">The source code of the server and the used solver for DeLP can be found in the <a href="http://tweetyproject.org" target="_blank">Tweety collection of Java libraries for logical aspects of artificial intelligence and knowledge representation</a>. More specifically, a good entry point for the server software is the class <a href="http://sourceforge.net/p/tweety/code/HEAD/tree/trunk/projects/net-sf-tweety-web/src/main/java/net/sf/tweety/web/services/DelpService.java" target="_blank"><span style="font-family: Courier;">DelpService.java</span></a> . All source code is published under the GNU General Public License version 3.0 except when this is noted otherwise.</p>
107+
<p style="font-size:10pt;">The source code of the server and the used solver for DeLP can be found in the <a href="http://tweetyproject.org" target="_blank">TweetyProject collection of Java libraries for logical aspects of artificial intelligence and knowledge representation</a>. More specifically, a good entry point for the server software is the package <a href="https://github.com/TweetyProjectTeam/TweetyProject/tree/main/org-tweetyproject-web/src/main/java/org/tweetyproject/web" target="_blank"><span style="font-family: Courier;">org.tweetyproject.web</span></a>. All source code is published under the GNU Lesser General Public License version 3.0 except when this is noted otherwise.</p>
108108
</td>
109-
</tr>
109+
</tr>
110110
<tr>
111111
<td colspan="2"><br/><div style="font-size:11pt;font-weight:bold">Contact</div><hr noshade="noshade" size="1" /></td>
112112
</tr>
113113
<tr>
114114
<td colspan="2">
115-
<p style="font-size:10pt;">This page and Tweety is maintained by <a href="http://www.mthimm.de">Matthias Thimm</a>. If you are interested in participating in the development of Tweety or have general comments and/or questions please write an e-mail to <a href="mailto:[email protected]">[email protected]</a>.</p>
115+
<p style="font-size:10pt;">This page and TweetyProject is maintained by <a href="http://www.mthimm.de">Matthias Thimm</a>. If you are interested in participating in the development of TweetyProject or have general comments and/or questions please write an e-mail to <a href="mailto:[email protected]">[email protected]</a>.</p>
116116
</td>
117117
</tr>
118118
<tr>
119119
<td colspan="2"><br/><hr noshade="noshade" size="1" /></td>
120120
</tr>
121121
<tr>
122-
<td style="font-size:8pt;">Last updated 21.09.2015, Matthias Thimm</td>
122+
<td style="font-size:8pt;">Last updated 13.12.2023, Matthias Thimm</td>
123123
<td style="font-size:8pt;" align="right"></td>
124124
</tr>
125-
</table>
125+
</table>
126126
</div>
127127
</body>
128128
<script type="text/JavaScript">
129129
checkServerStatus();
130130
document.getElementById("serverurl").innerHTML = tweetyserverDelp;
131131
</script>
132-
</html>
132+
</html>

0 commit comments

Comments
 (0)