expert-system

command module
v0.0.0-...-4e3c293 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

Expert System

An optimized backward chaining expert system with rule visualizer

Dependencies

  • go version 1.13
  • github.com/chzyer/readline
  • github.com/awalterschulze/gographviz

Build

git clone https://github.com/acarlson99/expert-system.git
cd expert-system
go build

Or

go get go get github.com/acarlson99/expert-system
go run github.com/acarlson99/expert-system

Run

./expert-system                        # Enter interactive mode
./expert-system test/test-all.xs       # Evaluate file
./expert-system -f test/test-all.xs    # Enter interactive mode after file evaluated

Syntax

NOTE: recursive rules lead to undefined behavior due to evaluation optimizations

Operators
Operator Example
Paren (A + B)
Not !A
And A + B
Or A | B
Xor A ^ B
Implication A => B
Commands
Command Description
=AB Set A and B
?AB Query A and B
?=(A | B) Query expression
reset A B Reset variable rules
verbose Turn on verbose output
list List variables and rules
vis [file] Print graphviz system to stdout or optional file
quit Quit program
help Display help

Key: blue = user defined, black = undefined, green = true

thing

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL