org.aspsimon.termcomp.entity
Class LPProgram

java.lang.Object
  extended by org.aspsimon.termcomp.entity.TerminationProblem
      extended by org.aspsimon.termcomp.entity.LPProgram
All Implemented Interfaces:
java.io.Serializable, TPInterface

public class LPProgram
extends TerminationProblem

This class represents a Logic Programming problem for use in the competition. It replaces the LPProblem class and integrates into the TerminationProblem hierarchy which should make life a lot easier. Logic Programs in the TPDB are in Prolog.

Since:
Version 1.0.2
Version:
$Revision: 113 $
Author:
Simon Bailey
See Also:
Serialized Form

Constructor Summary
LPProgram()
           
 
Method Summary
 java.lang.String getProgram()
          Get the full text of the Prolog program.
 java.lang.String getQuery()
          Get the query which this program should be checked for.
 java.lang.String getType()
          Get the type of Termination Problem we are working with.
 void setProgram(java.lang.String program)
          Set the Prolog program for this Logic Programming problem.
 void setQuery(java.lang.String query)
          Set the query to be checked in this problem.
 
Methods inherited from class org.aspsimon.termcomp.entity.TerminationProblem
getApprovedBy, getOriginalFileName, getSubmittedBy, getSubmittedDate, getTPId, isApproved, isRejected, isSecret, prepersist, setApproved, setApprovedBy, setOriginalFileName, setRejected, setSecret, setSubmittedBy, setSubmittedDate, setTPId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LPProgram

public LPProgram()
Method Detail

getProgram

public java.lang.String getProgram()
Get the full text of the Prolog program. It has to be annotated as a @Lob in order for the database to not truncate it.

Returns:
The full source content of the original problem.

getQuery

public java.lang.String getQuery()
Get the query which this program should be checked for. May also contain the special string NO QUERY — these problems are ignored during a competition.

Returns:
The query in Prolog syntax.

setProgram

public void setProgram(java.lang.String program)
Set the Prolog program for this Logic Programming problem.

Parameters:
program - The source code of the Prolog program.

setQuery

public void setQuery(java.lang.String query)
Set the query to be checked in this problem.

Parameters:
query - The query which must be checked.

getType

public java.lang.String getType()
Get the type of Termination Problem we are working with. Can currently be one of the following:
TRS
Term Rewriting System TRSProblem
SRS
String Rewriting System SRSProblem
FP
Functional Program FPProblem
LP
Logic Program LPProblem

Returns:
"LP"