From 21d72b2f67fb065d9071907c5c3307434aad3795 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Thu, 19 Jun 2025 01:22:19 -0400 Subject: Add multiple clause and tree level optimizations Implement optimizations that can be called in parallel or serial. Optimizations occur mostly in place and result in a logically equivalent tree when used correctly. Optimizations ============= * Sort - sort all statements within a clause tree * Simplify - apply negation rules to all statements * Flatten - merge child clauses with parents * Compact - merge equivalent statements * Tidy^ - remove zero statements * Contradictions - zero contradicting statements and clauses * StrictEquality - zero fuzzy statements when exact statements are within clause * Tighten - combine multiple fuzzy statements to the least (AND) or most (OR) restrictive bounds ^: when used incorrectly can turn an invalid clause tree into a valid one --- cmd/atlas.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/atlas.go b/cmd/atlas.go index b0cebdb..60da8a2 100644 --- a/cmd/atlas.go +++ b/cmd/atlas.go @@ -208,9 +208,12 @@ func main() { } case "shell": state := make(shell.State) - interpreter := shell.NewInterpreter(state, os.Stdin) + interpreter := shell.NewInterpreter(state, os.Stdin, globalFlags.NumWorkers) if err := interpreter.Run(); err != nil && err != io.EOF { + slog.Error("Fatal error occured", slog.String("err", err.Error())) os.Exit(1) + } else { + fmt.Println("\nLeaving atlasi.") } } -- cgit v1.2.3