|
From: <jom...@us...> - 2009-06-24 14:15:15
|
Revision: 1497
http://jason.svn.sourceforge.net/jason/?rev=1497&view=rev
Author: jomifred
Date: 2009-06-24 14:15:14 +0000 (Wed, 24 Jun 2009)
Log Message:
-----------
increase the size of stack to run Jason projects
Modified Paths:
--------------
trunk/src/jason/asSyntax/ASSyntax.java
trunk/src/jason/asSyntax/ListTermImpl.java
trunk/src/templates/build-template.xml
Modified: trunk/src/jason/asSyntax/ASSyntax.java
===================================================================
--- trunk/src/jason/asSyntax/ASSyntax.java 2009-06-16 18:56:41 UTC (rev 1496)
+++ trunk/src/jason/asSyntax/ASSyntax.java 2009-06-24 14:15:14 UTC (rev 1497)
@@ -134,6 +134,13 @@
}
+ /** Creates a new rule with a head and a body */
+ public static Rule createRule(Literal head, LogicalFormula body) {
+ return new Rule(head,body);
+ }
+
+
+
/** creates a new literal by parsing a string */
public static Literal parseLiteral(String sLiteral) throws ParseException {
return new as2j(new StringReader(sLiteral)).literal();
@@ -182,4 +189,9 @@
public static LogicalFormula parseFormula(String sExpr) throws ParseException {
return (LogicalFormula)new as2j(new StringReader(sExpr)).log_expr();
}
+
+ /** creates a new rule by parsing a string */
+ public static Rule parseRule(String sRule) throws ParseException {
+ return (Rule)new as2j(new StringReader(sRule)).belief();
+ }
}
Modified: trunk/src/jason/asSyntax/ListTermImpl.java
===================================================================
--- trunk/src/jason/asSyntax/ListTermImpl.java 2009-06-16 18:56:41 UTC (rev 1496)
+++ trunk/src/jason/asSyntax/ListTermImpl.java 2009-06-24 14:15:14 UTC (rev 1497)
@@ -259,12 +259,18 @@
/** get the last ListTerm of this List */
public ListTerm getLast() {
+ ListTerm r = this;
+ while (!r.isEnd() && r.getNext() != null)
+ r = r.getNext();
+ return r;
+ /* recursive implementation
if (isEnd()) {
return this;
} else if (next != null) {
return getNext().getLast();
}
return null; // !!! no last!!!!
+ */
}
public ListTerm getPenultimate() {
@@ -306,7 +312,6 @@
}
}
-
/**
* Adds a list in the end of this list.
* This method do not clone <i>lt</i>.
@@ -475,7 +480,7 @@
}
}
public boolean add(Term o) {
- return append(o) != null;
+ return getLast().append(o) != null;
}
@SuppressWarnings("unchecked")
Modified: trunk/src/templates/build-template.xml
===================================================================
--- trunk/src/templates/build-template.xml 2009-06-16 18:56:41 UTC (rev 1496)
+++ trunk/src/templates/build-template.xml 2009-06-24 14:15:14 UTC (rev 1497)
@@ -90,7 +90,7 @@
failonerror="true" fork="yes" dir="${basedir}" >
<classpath refid="project.classpath"/>
<arg line="${mas2j.project.file} ${debug} <RUN-ARGS>"/>
- <jvmarg line="-Xmx500M"/>
+ <jvmarg line="-Xmx500M -Xss8M"/>
</java>
<antcall target="user-end" />
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|