Class InternalAPI

java.lang.Object
fr.inria.rules.integraal.api.internal.InternalAPI

@Deprecated(forRemoval=true) public class InternalAPI extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use ModelAPI.get() instead. This class will be removed in a future release.
  • Method Details

    • createEnvironment

      public static IntegraalEnvironment createEnvironment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Crée un environnement. Pour l'instant pas de configuration possible, on verra plus tard.
      Returns:
      un nouvel environnement Integraal
    • parseDLGPE

      public static List<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parseDLGPE(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses a DLGPE string in the given environment.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content to parse.
      Returns:
      the parsed sentences.
      Throws:
      Exception - if parsing fails.
    • exportPrintable

      public static String exportPrintable(fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Exports a printable object.
      Parameters:
      printable - the object to export.
      Returns:
      the serialized representation.
    • exportPrintable

      public static String exportPrintable(IntegraalEnvironment env, fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Exports a printable object using the given environment.
      Parameters:
      env - the environment used for exporting.
      printable - the object to export.
      Returns:
      the serialized representation.
    • exportPrintable

      public static void exportPrintable(IntegraalEnvironment env, fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable, Appendable out) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Exports a printable object to an appendable output.
      Parameters:
      env - the environment used for exporting.
      printable - the object to export.
      out - the destination appendable.
      Throws:
      IOException - if writing fails.
    • mergeInPlace

      public static void mergeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Merges a fact base into another one in place.
      Parameters:
      env - the environment used for the merge.
      fb - the target fact base.
      other - the source fact base.
    • mergeInPlace

      public static void mergeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other, Substitution subst, boolean freeze)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Merges a fact base into another one in place with substitution and freezing options.
      Parameters:
      env - the environment used for the merge.
      fb - the target fact base.
      other - the source fact base.
      subst - the substitution to apply.
      freeze - whether merged terms should be frozen.
    • removeInPlace

      public static void removeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other, Substitution subst) throws EvaluationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes facts from a fact base in place.
      Parameters:
      env - the environment used for the removal.
      fb - the target fact base.
      other - the facts to remove.
      subst - the substitution to apply.
      Throws:
      EvaluationException - if evaluation fails during removal.
    • loadFromDLGPEFile

      public static ParsingResult loadFromDLGPEFile(IntegraalEnvironment env, String dlgpefile, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads and parses DLGPE content from a file.
      Parameters:
      env - the environment used for parsing.
      dlgpefile - the path to the DLGPE file.
      joinFacts - whether parsed fact bases should be joined.
      minFacts - the minimum number of fact bases expected.
      maxFacts - the maximum number of fact bases expected.
      minRules - the minimum number of rules expected.
      maxRules - the maximum number of rules expected.
      minQueries - the minimum number of queries expected.
      maxQueries - the maximum number of queries expected.
      forgiving - whether parsing should be forgiving.
      Returns:
      the parsing result.
      Throws:
      Exception - if parsing fails.
    • loadFromDLGPEString

      public static ParsingResult loadFromDLGPEString(IntegraalEnvironment env, String dlgpeString, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads and parses DLGPE content from a string.
      Parameters:
      env - the environment used for parsing.
      dlgpeString - the DLGPE content.
      joinFacts - whether parsed fact bases should be joined.
      minFacts - the minimum number of fact bases expected.
      maxFacts - the maximum number of fact bases expected.
      minRules - the minimum number of rules expected.
      maxRules - the maximum number of rules expected.
      minQueries - the minimum number of queries expected.
      maxQueries - the maximum number of queries expected.
      forgiving - whether parsing should be forgiving.
      Returns:
      the parsing result.
      Throws:
      Exception - if parsing fails.
    • loadFromDLGPE

      public static ParsingResult loadFromDLGPE(IntegraalEnvironment env, InputStream stream, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads and parses DLGPE content from an input stream.
      Parameters:
      env - the environment used for parsing.
      stream - the DLGPE input stream.
      joinFacts - whether parsed fact bases should be joined.
      minFacts - the minimum number of fact bases expected.
      maxFacts - the maximum number of fact bases expected.
      minRules - the minimum number of rules expected.
      maxRules - the maximum number of rules expected.
      minQueries - the minimum number of queries expected.
      maxQueries - the maximum number of queries expected.
      forgiving - whether parsing should be forgiving.
      Returns:
      the parsing result.
      Throws:
      Exception - if parsing fails.
    • loadFromDLGPString

      public static ParsingResult loadFromDLGPString(String dlgp, boolean getFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws ParseException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads and parses DLGP content from a string.
      Parameters:
      dlgp - the DLGP content.
      getFacts - whether facts should be parsed.
      minRules - the minimum number of rules expected.
      maxRules - the maximum number of rules expected.
      minQueries - the minimum number of queries expected.
      maxQueries - the maximum number of queries expected.
      forgiving - whether parsing should be forgiving.
      Returns:
      the parsing result.
      Throws:
      ParseException - if parsing fails.
    • createFactBase

      public static FactBase createFactBase(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a fact base from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created fact base.
      Throws:
      Exception - if parsing fails.
    • createFactBase

      public static FactBase createFactBase(IntegraalEnvironment env, InputStream dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a fact base from DLGPE content read from a stream.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE input stream.
      Returns:
      the created fact base.
      Throws:
      Exception - if parsing fails.
    • createJoinedFactBase

      public static FactBase createJoinedFactBase(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a joined fact base from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created joined fact base.
      Throws:
      Exception - if parsing fails.
    • createFactBaseCollection

      public static Collection<FactBase> createFactBaseCollection(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a collection of fact bases from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created fact base collection.
      Throws:
      Exception - if parsing fails.
    • createRuleBase

      public static RuleBase createRuleBase(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a rule base from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created rule base.
      Throws:
      Exception - if parsing fails.
    • createQueryCollection

      public static Collection<UnionFOQuery> createQueryCollection(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a query collection from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created query collection.
      Throws:
      Exception - if parsing fails.
    • createQuery

      public static UnionFOQuery createQuery(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a query from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created query.
      Throws:
      Exception - if parsing fails.
    • createRule

      public static FORule createRule(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a rule from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the created rule.
      Throws:
      Exception - if parsing fails.
    • loadAll

      public static ParsingResult loadAll(IntegraalEnvironment env, String dlgpe) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads all supported objects from DLGPE content.
      Parameters:
      env - the environment used for parsing.
      dlgpe - the DLGPE content.
      Returns:
      the parsing result.
      Throws:
      Exception - if parsing fails.
    • loadAllFromFile

      public static ParsingResult loadAllFromFile(IntegraalEnvironment env, String path) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads all supported objects from a file.
      Parameters:
      env - the environment used for parsing.
      path - the file path.
      Returns:
      the parsing result.
      Throws:
      Exception - if parsing fails.
    • evaluate

      Deprecated, for removal: This API element is subject to removal in a future version.
      Evaluates a query on a fact base.
      Parameters:
      factBase - the fact base to query.
      query - the query to evaluate.
      params - the evaluation parameters.
      Returns:
      an iterator over matching substitutions.
      Throws:
      IGParameterException - if a parameter is invalid.
      IllegalArgumentException - if an argument is invalid.
      EvaluationException - if evaluation fails.
    • evaluate

      Deprecated, for removal: This API element is subject to removal in a future version.
      Evaluates a query on a fact base with a pre-homomorphism.
      Parameters:
      factBase - the fact base to query.
      query - the query to evaluate.
      preHom - the pre-homomorphism to apply.
      params - the evaluation parameters.
      Returns:
      an iterator over matching substitutions.
      Throws:
      IGParameterException - if a parameter is invalid.
      IllegalArgumentException - if an argument is invalid.
      EvaluationException - if evaluation fails.
    • defaultChase

      public static FactBase defaultChase(FactBase factBase, RuleBase ruleBase, IGParameter<String,String>... params) throws IGParameterException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Runs the default chase on a fact base with a rule base.
      Parameters:
      factBase - the fact base.
      ruleBase - the rule base.
      params - the chase parameters.
      Returns:
      the chased fact base.
      Throws:
      IGParameterException - if a parameter is invalid.
    • createRuleBaseFromRules

      public static RuleBase createRuleBaseFromRules(Collection<FORule> rules)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a rule base from a collection of rules.
      Parameters:
      rules - the rules to include.
      Returns:
      the created rule base.
    • nextAnswers

      public static Collection<Substitution> nextAnswers(Iterator<Substitution> it, IGParameter<String,String>... params) throws IGParameterException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Retrieves the next answers from an answer iterator.
      Parameters:
      it - the substitutions iterator.
      params - the retrieval parameters.
      Returns:
      the next substitutions.
      Throws:
      IGParameterException - if a parameter is invalid.
    • rewrite

      public static UnionFOQuery rewrite(RuleBase ruleBase, Query query, InteGraalKeywords.Algorithms.Parameters.Compilation compilation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rewrites a query using a rule base and a compilation strategy.
      Parameters:
      ruleBase - the rule base used for rewriting.
      query - the query to rewrite.
      compilation - the compilation strategy.
      Returns:
      the rewritten query.
    • rewrite

      public static UnionFOQuery rewrite(RuleBase ruleBase, Query query, String compilationType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rewrites a query using a rule base and a compilation type.
      Parameters:
      ruleBase - the rule base used for rewriting.
      query - the query to rewrite.
      compilationType - the compilation type.
      Returns:
      the rewritten query.
    • rewrite

      public static UnionFOQuery rewrite(Query query, CompilationResult compiled) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rewrites a query using a precomputed compilation.
      Parameters:
      query - the query to rewrite.
      compiled - the precomputed compilation.
      Returns:
      the rewritten query.
      Throws:
      IllegalArgumentException - if the compilation is invalid.
    • createCompilation

      public static CompilationResult createCompilation(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation compilation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a compilation for a rule base.
      Parameters:
      ruleBase - the rule base to compile.
      compilation - the compilation strategy.
      Returns:
      the compilation result.
    • createCompilation

      public static CompilationResult createCompilation(RuleBase ruleBase, String compilationType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a compilation for a rule base using a compilation type.
      Parameters:
      ruleBase - the rule base to compile.
      compilationType - the compilation type.
      Returns:
      the compilation result.
    • parseCompilationType

      public static InteGraalKeywords.Algorithms.Parameters.Compilation parseCompilationType(String compilationType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses a compilation type string.
      Parameters:
      compilationType - the compilation type.
      Returns:
      the parsed compilation value.
    • parseSubstitution

      public static Substitution parseSubstitution(IntegraalEnvironment environment, String json) throws NoSuchMethodException, ParseException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses a substitution from its JSON representation.
      Parameters:
      environment - the environment used for parsing.
      json - the JSON representation.
      Returns:
      the parsed substitution.
      Throws:
      NoSuchMethodException - if a required method cannot be found.
      ParseException - if parsing fails.
    • formatSubstitutions

      public static List<Map<String,String>> formatSubstitutions(IntegraalEnvironment environment, Collection<Substitution> substitutions) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Formats substitutions into string maps.
      Parameters:
      environment - the environment used for formatting.
      substitutions - the substitutions to format.
      Returns:
      the formatted substitutions.
      Throws:
      IOException - if formatting fails.
    • copy

      public static FactBase copy(FactBase factBase)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a fact base.
      Parameters:
      factBase - the fact base to copy.
      Returns:
      the copied fact base.
    • copy

      public static FORule copy(Rule rule)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a rule.
      Parameters:
      rule - the rule to copy.
      Returns:
      the copied rule.
    • copy

      public static RuleBase copy(RuleBase ruleBase)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a rule base.
      Parameters:
      ruleBase - the rule base to copy.
      Returns:
      the copied rule base.
    • copy

      public static UnionFOQuery copy(UnionFOQuery query)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a query.
      Parameters:
      query - the query to copy.
      Returns:
      the copied query.
    • copy

      public static Collection<UnionFOQuery> copy(Collection<UnionFOQuery> queries)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a collection of queries.
      Parameters:
      queries - the queries to copy.
      Returns:
      the copied queries.
    • copyFBC

      public static Collection<FactBase> copyFBC(Collection<FactBase> factbases)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies a fact base collection.
      Parameters:
      factbases - the fact bases to copy.
      Returns:
      the copied fact base collection.
    • createAnalyser

      public static Analyser createAnalyser(RuleBase rulebase)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an analyser for a rule base.
      Parameters:
      rulebase - the rule base to analyse.
      Returns:
      the created analyser.
    • exportFactBase

      @Deprecated public static String exportFactBase(FactBase factBase) throws IOException
      Deprecated.
      Exports a fact base using the deprecated API.
      Parameters:
      factBase - the fact base to export.
      Returns:
      the serialized representation.
      Throws:
      IOException - if exporting fails.
    • exportRule

      @Deprecated public static String exportRule(FORule rule) throws IOException
      Deprecated.
      Exports a rule using the deprecated API.
      Parameters:
      rule - the rule to export.
      Returns:
      the serialized representation.
      Throws:
      IOException - if exporting fails.
    • exportQuery

      @Deprecated public static String exportQuery(UnionFOQuery query) throws IOException
      Deprecated.
      Exports a query using the deprecated API.
      Parameters:
      query - the query to export.
      Returns:
      the serialized representation.
      Throws:
      IOException - if exporting fails.
    • main

      public static void main(String[] args) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Temporary entry point for manual internal testing.
      Parameters:
      args - command-line arguments
      Throws:
      Exception - if a test operation fails