Interface ModelAPI


public interface ModelAPI
Unified interface for InteGraal's internal model API.

Gives access to main Integraal services: environment management, creation/management/import/export of main Integraal primitives and primitive collections, evaluation/chasing/rewriting operations and some additional functionalities as compilation and rule set analysis.

An instance is available via InternalServices.model(). The static facades InternalAPI and ReasoningAPI remain for backward compatibility and delegate to the same implementation.

  • Method Details

    • get

      static ModelAPI get()
      Returns the singleton model API instance.
      Returns:
      the singleton model API
    • createEnvironment

      IntegraalEnvironment createEnvironment()
      Creates a new environment.
      Returns:
      the created environment.
    • registerViewDefinitions

      boolean registerViewDefinitions(IntegraalEnvironment env, String vdFilePath) throws ViewBuilder.ViewBuilderException
      Registers datasource and view definitions from the supplied VD file in the environment, preserving previously registered definitions.
      Parameters:
      env - the environment to enrich
      vdFilePath - the VD file to register
      Returns:
      true if the file was registered successfully
      Throws:
      ViewBuilder.ViewBuilderException - if the file cannot be registered
    • registerViewDefinitions

      boolean registerViewDefinitions(IntegraalEnvironment env, Collection<String> vdFilePaths) throws ViewBuilder.ViewBuilderException
      Registers datasource and view definitions from the supplied VD files in the environment, preserving previously registered definitions.

      Files are registered sequentially. If registration fails, definitions registered before the failure remain in the environment.

      Parameters:
      env - the environment to enrich
      vdFilePaths - the VD files to register
      Returns:
      true if all supplied files were registered successfully
      Throws:
      ViewBuilder.ViewBuilderException - if a file cannot be registered
    • loadFactBase

      FactBase loadFactBase(IntegraalEnvironment env, String filePath, IGParameter<InteGraalKeywords, ?>... storageParams) throws ParseException, IGParameterException
      Loads a fact base from the specified path with given configuration parameters.
      Parameters:
      env - the environment used for parsing
      filePath - the file path to load
      storageParams - configuration parameters for the fact base
      Returns:
      the loaded fact base
      Throws:
      ParseException - if parsing fails
      IGParameterException - if parameter handling fails
    • loadFactBase

      FactBase loadFactBase(IntegraalEnvironment env, Collection<String> filePaths, IGParameter<InteGraalKeywords, ?>... storageParams) throws ParseException, IGParameterException
      Loads facts from multiple files into the specified or default storage component.
      Throws:
      ParseException
      IGParameterException
    • loadRuleBase

      Loads a rule base from the specified path with given configuration parameters.
      Parameters:
      env - the environment used for parsing
      path - the file path to load
      params - configuration parameters for the rule base
      Returns:
      the loaded rule base
      Throws:
      ParseException - if parsing fails
      IGParameterException - if parameter handling fails
    • loadRuleBase

      Return a Rule Base containing the rules loaded from a collection of paths. The loaded rules are converted to FO rules using the default translator if applicable.
      Throws:
      ParseException
      IGParameterException
    • loadKnowledgeBase

      Loads a knowledge base (rules and facts) from the specified path with given configuration parameters. This method assumes both rules and facts are present in the same file.
      Parameters:
      env - the environment used for parsing
      kbPath - the file path to load containing both rules and facts
      params - configuration parameters for the knowledge base
      Returns:
      the loaded knowledge base
      Throws:
      ParseException - if parsing fails
      IGParameterException - if parameter handling fails
    • loadKnowledgeBase

      Loads a Knowledge Base from a collection of paths containing rules and facts.
      Throws:
      ParseException
      IGParameterException
    • loadKnowledgeBase

      KnowledgeBase loadKnowledgeBase(IntegraalEnvironment env, String rulesPath, String factBasePath, IGParameter<InteGraalKeywords, ?>... params) throws ParseException, IGParameterException
      Loads a knowledge base by reading rules and facts from separate files.
      Parameters:
      env - the environment used for parsing
      rulesPath - the file path to load rules from
      factBasePath - the file path to load facts from
      params - configuration parameters for the knowledge base
      Returns:
      the loaded knowledge base
      Throws:
      ParseException - if parsing fails
      IGParameterException - if parameter handling fails
    • createFactBase

      FactBase createFactBase(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      FactBase createFactBase(IntegraalEnvironment env, InputStream dlgpe) throws Exception
      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

      FactBase createJoinedFactBase(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      Collection<FactBase> createFactBaseCollection(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      RuleBase createRuleBase(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      Collection<UnionFOQuery> createQueryCollection(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      UnionFOQuery createQuery(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      FORule createRule(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      ParsingResult loadAll(IntegraalEnvironment env, String dlgpe) throws Exception
      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

      ParsingResult loadAllFromFile(IntegraalEnvironment env, String path) throws Exception
      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.
    • parseDLGPE

      List<fr.inria.rules.dlgpemodel.api.sentences.ISentence> parseDLGPE(IntegraalEnvironment env, String dlgpe) throws Exception
      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.
    • loadFromDLGPEFile

      ParsingResult loadFromDLGPEFile(IntegraalEnvironment env, String dlgpefile, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      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

      ParsingResult loadFromDLGPEString(IntegraalEnvironment env, String dlgpeString, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      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

      ParsingResult loadFromDLGPE(IntegraalEnvironment env, InputStream stream, boolean joinFacts, int minFacts, int maxFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws Exception
      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

      ParsingResult loadFromDLGPString(String dlgp, boolean getFacts, int minRules, int maxRules, int minQueries, int maxQueries, boolean forgiving) throws ParseException
      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.
    • exportPrintable

      String exportPrintable(fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable)
      Exports a printable object.
      Parameters:
      printable - the object to export.
      Returns:
      the serialized representation.
    • exportPrintable

      String exportPrintable(IntegraalEnvironment env, fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable)
      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

      void exportPrintable(IntegraalEnvironment env, fr.inria.rules.dlgpemodel.api.sentences.IPrintable printable, Appendable out) throws IOException
      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

      void mergeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other)
      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

      FactBase mergeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other, Substitution subst, boolean freeze)
      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.
      Returns:
      the modified target fact base.
    • removeInPlace

      FactBase removeInPlace(IntegraalEnvironment env, FactBase fb, FactBase other, Substitution subst) throws EvaluationException
      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.
      Returns:
      the modified target fact base.
      Throws:
      EvaluationException - if evaluation fails during removal.
    • copy

      FactBase copy(FactBase factBase)
      Copies a fact base.
      Parameters:
      factBase - the fact base to copy.
      Returns:
      the copied fact base.
    • copy

      FORule copy(Rule rule)
      Copies a rule.
      Parameters:
      rule - the rule to copy.
      Returns:
      the copied rule.
    • copy

      RuleBase copy(RuleBase ruleBase)
      Copies a rule base.
      Parameters:
      ruleBase - the rule base to copy.
      Returns:
      the copied rule base.
    • copy

      Copies a query.
      Parameters:
      query - the query to copy.
      Returns:
      the copied query.
    • copy

      Copies a collection of queries.
      Parameters:
      queries - the queries to copy.
      Returns:
      the copied queries.
    • copyFBC

      Collection<FactBase> copyFBC(Collection<FactBase> factbases)
      Copies a fact base collection.
      Parameters:
      factbases - the fact bases to copy.
      Returns:
      the copied fact base collection.
    • evaluate

      Evaluates a query on the supplied data combined with the environment views.
      Parameters:
      env - the environment providing registered read-only views.
      data - the queryable data (for instance a FactBase) to combine with those views.
      query - the query to evaluate.
      params - the evaluation parameters among the following IGParameters:
      Returns:
      an iterator over matching Substitutions.
      Throws:
      IllegalArgumentException - if an argument is invalid.
      IGParameterException - if a parameter is invalid.
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IllegalStateException - if different sources expose the same predicate.
      EvaluationException - if evaluation fails.
    • evaluate

      Evaluates a query on the supplied data combined with the environment views with a pre-homomorphism.
      Parameters:
      env - the environment providing registered read-only views.
      data - the queryable data (for instance a FactBase) to combine with those views.
      query - the query to evaluate.
      preHom - the pre-homomorphism to apply.
      params - the evaluation parameters among the following IGParameters:
      Returns:
      an iterator over matching substitutions.
      Throws:
      IllegalArgumentException - if an argument is invalid.
      IGParameterException - if a parameter is invalid.
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IllegalStateException - if different sources expose the same predicate.
      EvaluationException - if evaluation fails.
    • nextAnswers

      Retrieves the next answers from an iterator of substitutions.
      Parameters:
      subIt - the substitution iterator.
      params - the retrieval parameters among the following IGParameters:
      • MAX with a positive integer (0 means all remaining answers) which bounds the maximal number of answers returned.
      Returns:
      the next substitutions.
      Throws:
      IGParameterException - if a parameter is invalid.
    • saturate

      Deprecated.
      Saturates a fact base with a rule base using the given algorithm parameters.
      Parameters:
      fb - the fact base to saturate
      rb - the rule base to apply
      algoParam - the algorithm parameters
      Returns:
      the saturated fact base
    • defaultChase

      Performs a chase on the given FactBase with RuleBase.
      The performed default chase is the standard chase, so called the restricted chase. One can parametrize the chase by giving some specific IGParameters.
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • defaultChase

      default <RW extends MaterializedData & Writable> RW defaultChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies the standard chase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply
      params - supplementary chase parameters
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • stratifiedChase

      <RW extends MaterializedData & Writable> RW stratifiedChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Runs a stratified chase using pseudo-minimal stratification.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the readable source and writable target
      rb - the stratifiable rule base
      params - supplementary chase parameters (applied within each stratum)
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a parameter is invalid or unsupported
      IllegalArgumentException - if the rule base is not stratifiable
    • stratifiedChase

      Runs the pseudo-minimal stratified chase using the environment's registered views.
      Parameters:
      env - the environment providing datasource and view definitions
      fb - the writable fact base to saturate
      rb - the stratifiable rule base
      params - supplementary chase parameters
      Returns:
      the same writable fact base, updated by the chase
      Throws:
      ViewBuilder.ViewBuilderException - if building the view data sources fails
      IGParameterException - if a chase parameter is invalid
    • obliviousChase

      Performs an oblivious chase on the given FactBase with RuleBase.
      Oblivious chase is the literal version of the chase algorithm. Every time a rule's body is satisfied by a set of facts, the rule is applied. New "nulls" are created for the existential variables, regardless of whether similar facts already exist in the database. It rarely terminates because it creates massive amounts of redundant data.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE_COMPUTER, Transformer=ALL, Evaluator=GENERIC, Applier=BREADTH_FIRST, Checker=OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • obliviousChase

      <RW extends MaterializedData & Writable> RW obliviousChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies the oblivious chase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply
      params - supplementary chase parameters
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • semiObliviousChase

      Performs a semi-oblivious chase on the given FactBase with RuleBase.
      Semi-oblivious chase avoids adding the same atoms multiple times (same in the sense of identical except for renaming the variables). When a rule's body is satisfied by a set of facts, the rule is only applied if it has not already been applied to the same images of the boundary variables.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE_COMPUTER, Transformer=FRONTIER, Evaluator=GENERIC, Applier=PARALLEL, Checker=SEMI_OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • semiObliviousChase

      <RW extends MaterializedData & Writable> RW semiObliviousChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies the semi-oblivious chase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply
      params - supplementary chase parameters
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • standardChase

      Performs a standard chase, so-called restricted chase, on the given FactBase with RuleBase.
      Standard chase is the most common version used in practical logic engines. When a rule's body is satisfied by a set of facts, the rule is only applied if the rule isn't already satisfied. It significantly reduces the number of facts generated, but checking for satisfaction at every step is computationally more expensive.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE_COMPUTER, Transformer=FRONTIER, Evaluator=GENERIC, Applier=PARALLEL, Checker=SO_RESTRICTED, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • standardChase

      <RW extends MaterializedData & Writable> RW standardChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies the standard chase and returns the supplied writing target.
      Throws:
      IGParameterException
    • coreChase

      Performs a core chase on the given FactBase with RuleBase.
      Core chase is the most "powerful" but computationally intensive variant. After each step, the algorithm computes the core of the resulting fact base, i.e., the smallest possible subset that is homomorphically equivalent to the current factbase. It is the "gold standard" for termination; if any version of the Chase can terminate on a specific instance, the Core Chase will.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE_COMPUTER, Transformer=FRONTIER, Evaluator=GENERIC, Applier=PARALLEL, Checker=SEMI_OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, InterstepTreatment=CORE.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • coreChase

      <RW extends MaterializedData & Writable> RW coreChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies coreChase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply, subject to this chase's rule restrictions
      params - chase parameters, subject to this chase's parameter restrictions
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • linearRuleChase

      Performs a semi-oblivious chase optimized for linear rules on the given FactBase with RuleBase.
      Linear rules are rules with one single atom in its body. The calculation of triggers can then be restricted to the atoms inferred in the previous step rather than to the entire basis. This makes it easy to implement a semi-naive evaluation.
      The internal InteGraal chase configuration for this chase is : Computer=SEMI_NAIVE, Transformer=FRONTIER, Evaluator=GENERIC, Applier=PARALLEL, Checker=SEMI_OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • linearRuleChase

      <RW extends MaterializedData & Writable> RW linearRuleChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies linearRuleChase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply, subject to this chase's rule restrictions
      params - chase parameters, subject to this chase's parameter restrictions
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • linearRulesChase

      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IGParameterException
      ViewBuilder.ViewBuilderException
    • linearRulesChase

      @Deprecated(forRemoval=true) default <RW extends MaterializedData & Writable> RW linearRulesChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IGParameterException
    • inMemoryDatalogChase

      Performs a standard chase optimized for datalog rules on the given FactBase with RuleBase that must be Datalog Rules.
      Datalog rules are rules with one single atom in their head and no existential variable. With this rule, a standard chase is simply obtained with an oblivious condition, less time-consuming than a restricted condition.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE, Transformer=FRONTIER, Evaluator=GENERIC, Applier=PARALLEL, Checker=OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Precondition rb must be a Datalog rulebase.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • inMemoryDatalogChase

      <RW extends MaterializedData & Writable> RW inMemoryDatalogChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies inMemoryDatalogChase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply, subject to this chase's rule restrictions
      params - chase parameters, subject to this chase's parameter restrictions
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • delegatedDatalogChase

      Performs a chase based on database queries on the given FactBase that must be in a DBMS with RuleBase that must be range restricted rules.
      This chase relies on the use of SQL SELECT and INSERT queries. The FactBase has to be managed by a RDBMS. The rules must be range restricted rules, rules without any existential variable.
      The internal InteGraal chase configuration for this chase is : Computer=NAIVE, Transformer=FRONTIER, Evaluator=SMART, Applier=SOURCE_DELEGATED_DATALOG, Checker=SEMI_OBLIVIOUS, Namer=FRESH, Scheduler=GRD, ChaseHalter=NO_NEW_FACTS+NO_RULES_TO_APPLY, and no InterstepTreatment.
      Recall that an InteGraal chase configuration consists in:
      • a COMPUTER: a trigger calculation strategy (naive, semi-naive, two steps...) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (frontier, body...) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (generic, smart...).
      • an APPLIER: a trigger application strategy (bf, parallel, delegated...) completed by:
        • a CHECKER: the trigger application condition (oblivious, so, restricted, equivalent...) and
        • a NAMER: the method for naming the new existential variables (fresh, body, frontier...).
      • a SCHEDULER: a method for selecting the next rules to consider (naïf, by_predicate, GRD...).
      • at least one CHASEHALTER (no_new_fact, no_rules_to_apply, rank, timeout, interrupt).
      • some optional INTERSTEPTREATMENTs (core, local_core, debug, report).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - Some optional IGParameters for additional chase adjustments. These parameters are cumulative, meaning we can add several of them together (including multiple times the same with or without the same value). The allowed IGParameters are:
      • RANK with a strictly positive long integer-convertible value which bounds the maximal number of steps performed by the chase.
      • TIMEOUT with a non-zero duration-convertible value which prevents proceeding to the next step of chase if the total execution time is greater than this value.
      • INTERRUPT with an AtomicBoolean which allows the chase to be interrupted at the next end of the stage if this boolean is set to true.
      • INTERSTEPTREATMENT with an InteGraalKeywords.Algorithms.Parameters.Chase.InterStepTreatment value (DEBUG, REPORT) which allows to perform a specific treatment between each chase step.
        • REPORT treatment displays the step number, the size of the fact base, the number of atoms added in this step, the duration in ms of the step, and the number of rules applied in this step.
        • DEBUG treatment displays the configuration of the current chase before the first step. Therefore, it is not really an interstep treatment since it is only executed once before executing the first step.
      Precondition fb is managed by a RDBMS. Precondition rb is a range restricted rule base.
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • delegatedDatalogChase

      <RW extends MaterializedData & Writable> RW delegatedDatalogChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies delegatedDatalogChase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply, subject to this chase's rule restrictions
      params - chase parameters, subject to this chase's parameter restrictions
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • customChase

      Performs a chase user-customized on the given FactBase with RuleBase.
      This chase allows user to fix its own chase configuration which consists in a sequence of following parameters: Computer, Transformer, Evaluator, Applier, Checker, Namer, Scheduler, ChaseHalter, Rank, Timeout, Interrupt, Intersteptreatment. The first seven parameters are mutually exclusive; if one of them is given more than once in the sequence, only the last value is retained. The last five parameters are cumulative; all the given values (including multiple times the same with or without the same value) are kept.
      The first seven parameters are mandatory to define a chase but if some are missing, a default value will be given. Furthermore, at least a parameter has to be given among ChaseHalter, Rank, Timeout or Interrupt; if that's not the case a default chasehalter value will be added.
      The chase configuration consists in (see also InteGraalKeywords):
      • a COMPUTER: a trigger calculation strategy (values: NAIVE_COMPUTER, SEMI_NAIVE, TWO_STEP, RESTRICTED) completed by:
        • a TRANSFORMER: how to transform the rule body into a query (values: ALL, FRONTIER) and
        • an EVALUATOR: which homomorphism computing algorithm to consider (values: GENERIC, SMART).
      • an APPLIER: a trigger application strategy (values: BREADTH_FIRST, PARALLEL, SOURCE_DELEGATED_DATALOG, MULTI_THREAD_PARALLEL) completed by:
        • a CHECKER: the trigger application condition (values: OBLIVIOUS, SEMI_OBLIVIOUS, RESTRICTED, EQUIVALENT, SO_RESTRICTED) and
        • a NAMER: the method for naming the new existential variables (values: FRESH, BODY, FRONTIER, FRONTIER_PIECE).
      • a SCHEDULER: a method for selecting the next rules to consider (values: NAIVE_SCHEDULER, GRD, BY_PREDICATE).
      • at least one CHASEHALTER (values: NO_NEW_FACTS, NO_RULES_TO_APPLY) or TIMEOUT (with a non-zero duration-convertible value) or (RANK with a strictly positive long integer-convertible value) or INTERRUPT (with an AtomicBoolean value)
      • some optional INTERSTEPTREATMENTs (values: CORE, LOCAL_CORE, DEBUG, REPORT).
      Parameters:
      env - the environment providing registered read-only views.
      fb - The FactBase to chase. This parameter will be modified during the execution and will remain modified at the end of the execution.
      rb - The RuleBase to use for chasing.
      params - the user configuration of chase
      Returns:
      the modified given FactBase on which the chase has been applied.
      Throws:
      ViewBuilder.ViewBuilderException - if building the environment views fails.
      IGParameterException - If a parameter name is unknown for this service, or its value format is incorrect or uncheckable.
    • customChase

      <RW extends MaterializedData & Writable> RW customChase(ChasableData<RW> data, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException
      Applies customChase to the supplied readable source and writable target.
      Type Parameters:
      RW - the writable materialized data type
      Parameters:
      data - the chasable data to saturate
      rb - the rules to apply, subject to this chase's rule restrictions
      params - chase parameters, subject to this chase's parameter restrictions
      Returns:
      the same writable target, updated by the chase
      Throws:
      IGParameterException - if a supplied parameter is invalid
    • rewrite

      Rewrites a query with respect to a rule base and a compilation strategy.
      Parameters:
      rb - the rule base used for rewriting.
      query - the query to rewrite.
      ruleCompilationType - the compilation strategy.
      Returns:
      the rewritten query.
      Throws:
      IllegalArgumentException - if an argument is invalid.
    • rewrite

      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.
    • evaluateSat

      Evaluates a query after saturating the fact base with a rule base.
      Parameters:
      fb - the fact base to query.
      query - the query to evaluate.
      rb - the rule base used for saturation.
      algoParam - the saturation algorithm parameters.
      Returns:
      an iterator over matching substitutions.
      Throws:
      IllegalArgumentException - if an argument is invalid.
      IGParameterException - if a parameter is invalid.
      EvaluationException - if evaluation fails.
    • evaluateRew

      Evaluates a query after rewriting it with a rule base.
      Parameters:
      fb - the fact base to query.
      query - the query to evaluate.
      rb - the rule base used for rewriting.
      ruleCompilationType - the compilation strategy.
      conds - the external halting conditions.
      Returns:
      an iterator over matching substitutions.
      Throws:
      IllegalArgumentException - if an argument is invalid.
      IGParameterException - if a parameter is invalid.
      EvaluationException - if evaluation fails.
    • createCompilation

      Creates a compilation for a rule base.
      Parameters:
      ruleBase - the rule base to compile.
      compilation - the compilation strategy.
      Returns:
      the compilation result.
    • createCompilation

      CompilationResult createCompilation(RuleBase ruleBase, String compilationType)
      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

      InteGraalKeywords.Algorithms.Parameters.Compilation parseCompilationType(String compilationType)
      Parses a compilation type string.
      Parameters:
      compilationType - the compilation type.
      Returns:
      the parsed compilation value.
    • extractCompilableRules

      RuleBase extractCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds)
      Extracts the compilable rules from a rule base.
      Parameters:
      ruleBase - the source rule base.
      ruleCompilation - the compilation strategy.
      conds - the external halting conditions.
      Returns:
      the compilable rules.
    • extractNonCompilableRules

      RuleBase extractNonCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds)
      Extracts the non-compilable rules from a rule base.
      Parameters:
      ruleBase - the source rule base.
      ruleCompilation - the compilation strategy.
      conds - the external halting conditions.
      Returns:
      the non-compilable rules.
    • unfold

      Unfolds queries with respect to a rule base.
      Parameters:
      ruleBase - the rule base used for unfolding.
      queries - the queries to unfold.
      ruleCompilation - the compilation strategy.
      conds - the external halting conditions.
      Returns:
      the unfolded queries.
    • decompose

      RuleBase decompose(RuleBase ruleBase)
      Decomposes a rule base.
      Parameters:
      ruleBase - the rule base to decompose.
      Returns:
      the decomposed rule base.
    • createRuleBaseFromRules

      RuleBase createRuleBaseFromRules(Collection<FORule> rules)
      Creates a rule base from a collection of rules.
      Parameters:
      rules - the rules to include.
      Returns:
      the created rule base.
    • parseSubstitution

      Substitution parseSubstitution(IntegraalEnvironment environment, String json) throws NoSuchMethodException, ParseException
      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

      List<Map<String,Object>> formatSubstitutions(IntegraalEnvironment environment, Collection<Substitution> substitutions) throws IOException
      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.
    • createAnalyser

      Analyser createAnalyser(RuleBase rulebase)
      Creates an analyser for a rule base.
      Parameters:
      rulebase - the rule base to analyse.
      Returns:
      the created analyser.
    • isFes

      Boolean isFes(RuleBase ruleBase)
      Checks whether a rule base is FES.
      Parameters:
      ruleBase - the rule base to analyse.
      Returns:
      true if the rule base is FES, otherwise false.
    • isFus

      Boolean isFus(RuleBase ruleBase)
      Checks whether a rule base is FUS.
      Parameters:
      ruleBase - the rule base to analyse.
      Returns:
      true if the rule base is FUS, otherwise false.
    • isDecidable

      Boolean isDecidable(RuleBase ruleBase)
      Checks whether a rule base is decidable.
      Parameters:
      ruleBase - the rule base to analyse.
      Returns:
      true if the rule base is decidable, otherwise false.
    • isHybridable

      Boolean isHybridable(RuleBase ruleBase)
      Checks whether a rule base is hybridable.
      Parameters:
      ruleBase - the rule base to analyse.
      Returns:
      true if the rule base is hybridable, otherwise false.
    • isHybrid

      Boolean isHybrid(RuleBase ruleBaseToSaturate, RuleBase ruleBaseToRewrite)
      Checks whether two rule bases form a hybrid rule base.
      Parameters:
      ruleBaseToSaturate - the rule base intended for saturation.
      ruleBaseToRewrite - the rule base intended for rewriting.
      Returns:
      true if the rule bases form a hybrid rule base, otherwise false.