Class DatalogParallelExecutor

java.lang.Object
edu.harvard.seas.pl.abcdatalog.executor.DatalogParallelExecutor
All Implemented Interfaces:
DatalogExecutor

public class DatalogParallelExecutor extends Object implements DatalogExecutor
A Datalog executor that runs the actual Datalog evaluation concurrently in separate threads.
  • Constructor Details

    • DatalogParallelExecutor

      public DatalogParallelExecutor()
  • Method Details

    • initialize

      public void initialize(Set<Clause> program, Set<PredicateSym> extensibleEdbPreds) throws DatalogValidationException
      Description copied from interface: DatalogExecutor
      Initializes the Datalog engine with a program and specifies which EDB relations can be extended (with DatalogExecutor.addFactAsynchronously()) during evaluation. This should only be called once.
      Specified by:
      initialize in interface DatalogExecutor
      Parameters:
      program - the program
      extensibleEdbPreds - the extendible EDB relations
      Throws:
      DatalogValidationException - if program is invalid
    • start

      public void start()
      Description copied from interface: DatalogExecutor
      Starts the Datalog evaluation.
      Specified by:
      start in interface DatalogExecutor
    • shutdown

      public void shutdown()
      Description copied from interface: DatalogExecutor
      Shuts down the executor, which cannot be reused.
      Specified by:
      shutdown in interface DatalogExecutor
    • addFactAsynchronously

      public void addFactAsynchronously(PositiveAtom edbFact)
      Description copied from interface: DatalogExecutor
      Asynchronously adds a new EDB fact to the Datalog evaluation. The EDB fact must be part of a relation that is specified in DatalogExecutor.initialize() as being extendible. A fact is a ground atom (i.e., an atom without any variables).
      Specified by:
      addFactAsynchronously in interface DatalogExecutor
      Parameters:
      edbFact - the new EDB fact
    • registerListener

      public void registerListener(PredicateSym p, DatalogListener listener)
      Description copied from interface: DatalogExecutor
      Associates a listener with a given predicate symbol, so that if any fact is derived during evaluation with that predicate symbol, the listener will be invoked with that fact. The listener can be executed in an arbitrary thread and should not block.
      Specified by:
      registerListener in interface DatalogExecutor
      Parameters:
      p - the predicate symbol
      listener - the listener