-
Notifications
You must be signed in to change notification settings - Fork 5
UnderstandingLanguages
Currently, AProVE supports a range of languages defined in the aprove.verification.oldframework.Input.Language enumeration, including:
- TES, TRS, PTRS, CSR, FP, IPAD, JAVA, PROLOG, HASKELL, And others...
In addition, various analyses are available as defined in aprove.verification.oldframework.Input.HandlingMode, such as:
- Termination analysis
- Liveness analysis
- Safety analysis
- Theorem proving
Not all combinations of languages and analyses are supported. For example:
- Termination analysis is available for nearly all supported input languages.
- Theorem proving is only supported for FP.
- Liveness analysis is only available for TRS.
Integrating a new language into the AProVE system involves a few steps. Let’s assume the new language is YATRS (Yet Another Term Rewrite System). The following steps outline the basic process. You can always compare these steps to the existing classes and code snippets for ordinary term rewrite systems, indicated by the brackets.
To add a new parser for the YATRS language, follow these steps:
-
Grammar: Create an ANTLR (preferred) or SableCC grammar for the language. The grammar files should be placed in
src/aprove/input/Grammars. (NewTrs.g) -
Build: Modify the
build-aprove.xmlfile to include the new grammar. (target: newTrs) -
Generated Files: The files generated by the parser generator will reside in
gen/aprove/input/Generated. (NewTrsParser) -
Parser: Implement the translator in
src/aprove/input/Programsthat translates the parsed input (RawTrs) given by the generated parser (NewTrsParser) into the correct problem class (TRSProblem). (src/aprove/input/Programs/newTrs/Translator.java)
Create a new problem class for YATRS. The steps include:
- Add YATRS to the
aprove.verification.oldframework.Input.Languageenum. - Add the translator to the
verification.oldframework/Input/extension.propertiesfile. - Modify
aprove.verification.theoremprover.ObligationFactories.MetaObligationFactoryto include a case forLanguage.YATRS. - Write a (possibly empty)
YATRSAnnotationclass inaprove.verification.oldframework.Input.Annotations. - Add the line
"YATRS = aprove.verification.oldframework.Input.Annotators.YATRSAnnotator"toaprove.verification.oldframework.Input.Annotators.defaultannotators.properties.
Develop processors for the YATRS problem class. The following steps outline the basic process:
- Write a processor (e.g.,
YATRSToQTRS) to transform YATRS into QTRS. - Add the new processor (e.g.,
YATRSToQTRS) toaprove.predefinedstrategies.Modules.std.strategy. - Update the default strategy in
aprove.predefinedstrategies.Auto.current.strategyto use this processor by default.
Depending on the complexity of your problem, you may need to perform additional steps:
Note: The
FrameProof/FrameProofFactoryclasses referenced here no longer exist in the codebase. This step may be obsolete or have changed. Check current proof header handling before following this guidance.
If your problem requires special output for the "this problem has been proven (/disproven)" header in the proof output, you should:
- Implement the
getProofResult()method on your problem's proof class.
If your problem requires non-trivial annotations:
- Add a new annotation class (e.g.,
YATRSAnnotation) inaprove.verification.oldframework.Input.Annotations. - Implement a corresponding
Annotatorinaprove.verification.oldframework.Input.Annotators.
If no special annotation is needed, the default TrivialAnnotator.TrivialAnnotation will be used.
Add a case in relevant heuristic processors for the new language (e.g., YATRS).
If required, add citations for your problem in aprove.verification.oldframework.Utility.Citation.
If you need to display a graph or provide additional UI functionality for your new language, follow these optional steps:
To display a graph in the proof window:
- Implement the
DOT_Ableinterface. - Add the new file type to
GraphUserInterface/Kefir/filefilters.properties. - Add it to the
_SAVENORMproperty if you want to enable saving files of that type.
To display problem-specific options:
- Add a new class to
GraphUserInterface/Kefir/TypedOptionPanels. - Register the class in
GraphUserInterface/Kefir/optionsManager.properties. If you don’t want to add a specific class, use the default option.
To customize the "display problem" window:
- Add a new
InteractiveObligationPanelinGraphUserInterface/Interactive. - Add this panel to
GraphUserInterface/Interactive/ObligationPanelFactory. If this step is skipped, the defaultInteractiveDefaultPanelwill be used.
If you want to offer a "Save problem source" button or make your problem processable by an external processor:
- Implement the
ExternUsableinterface.
To make processors interactively available for your problem:
- Configure a list of processors in
aprove.GraphUserInterface.Options.OptionsItemsFactories.\$MYPROBLEM.properties.
This allows users to apply processors to your problem interactively (e.g., via the "Apply processor" option in the context menu).