package com.github.pineasaurusrex.inference_engine;

public class Main {

    public static void main(String[] args) {
	    if (args.length < 2) {
            System.err.println("Usage: iengine method filename");
            System.exit(1);
        }

        KnowledgeBase kb;

        switch (args[1].toUpperCase()) {
            case "FC":
                kb = new FowardChainingKnowledgeBase();
                break;
            default:
                System.err.println("Method \"" + args[1] + "\" not implemented");
                System.exit(1);
        }
    }
}

@@ -269,18 +269,72 @@
 eBase kb
+ = new KnowledgeBase();%0A        SearchAlgorithm search
 ;%0A
-
 %0A       
@@ -406,18 +406,22 @@
         
-kb
+search
  = new F
@@ -421,16 +421,17 @@
 = new Fo
+r
 wardChai
@@ -434,30 +434,28 @@
 Chaining
-KnowledgeBase(
+Algorithm(kb
 );%0A     
@@ -599,32 +599,32 @@
 System.exit(1);%0A
-
         %7D%0A    %7D%0A
@@ -616,16 +616,115 @@
        %7D
+%0A%0A        boolean result = search.entails();%0A        System.out.println(result ? %22YES: %22 : %22NO: %22);
 %0A    %7D%0A%7D

Update KB initialization