diff --git a/Makefile b/Makefile index d088200125dd3735c0e64a6d387fb5f9dc3763f0..84513501a20d5b80178b641b9179bb5ecd37f6f2 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ LDXX ?= g++ OCAMLC := ocamlc.opt OCAMLCFLAGS := -I `ocamlfind query ocamlgraph` OCAMLOPT := ocamlopt.opt -OCAMLOPTFLAGS := -cc $(LDXX) -unsafe -inline 100 -I `ocamlfind query ocamlgraph` +OCAMLOPTFLAGS := -cc $(LDXX) -ccopt -static -unsafe -inline 100 -I `ocamlfind query ocamlgraph` # No more user input beyond this point. diff --git a/coalg.ml b/coalg.ml index 38904c488af6f6dbb74c77e7dd591a9ce847e2f0..745191d9424095fba2525e1e6e5e1d8f437ebe6b 100644 --- a/coalg.ml +++ b/coalg.ml @@ -37,7 +37,7 @@ let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 4194304; major_heap_increm let printUsage () = print_endline "Usage: \"alc <task> <functor> [<flags>]\" where"; - print_endline " <task> in { sat print prov (is »not.(sat ¬f)«) }"; + print_endline " <task> in { sat print nnf prov (is »not.(sat ¬f)«) }"; print_endline " <functor> in { MultiModalK MultiModalKD CoalitionLogic GML"; print_endline " (or: K) (or: KD) (or: CL) }"; print_endline " <flags> = a list of the following items"; @@ -113,6 +113,7 @@ let choiceProvable () = else () done with End_of_file -> () + let choicePrint () = try while true do @@ -127,6 +128,20 @@ let choicePrint () = done with End_of_file -> () +let choiceNNF () = + try + while true do + let input = read_line () in + if not (GenAndComp.isEmptyString input) then + let f = CoAlgFormula.nnf (CoAlgFormula.importFormula input) in + let str = CoAlgFormula.exportFormula f in + incr counter; + print_string (str ^ "\n"); + flush stdout; + else () + done + with End_of_file -> () + let rec parseFlags arr offs : unit = let offs = ref (offs) in let getParam () = @@ -157,6 +172,7 @@ let _ = | "sat" -> choiceSat () | "prov" -> choiceProvable () | "print" -> choicePrint () + | "nnf" -> choiceNNF () | _ -> printUsage ()