I’ve been tinkering around with julog and it has met a course requirement of an expert system. I will work out my problem set for the class with this package, but I want to continue the project after this class, and am having issues switching around generalizing over multiple value. I was wondering if there is there another way to write out logical statements in Julia that I’m missing that is native to julia?
clauses = @julog [
query(Orderfrom,Time,Product,Cost)<<=
depot(Name1,Onhand1,Time1,Cost1) &
depot(Name2,Onhand2,Time2,Cost2) &
(Cost1<Cost2) &
(Onhand1>30) &
is(Orderfrom,Name1) &
is(Time,Time1) &
is(Product, 30) &
is(Cost,Cost1),
]
facts = @julog [depot(us2,40,9,15)<<=true,depot(aus,50,9,40)<<=true]
boolyn,answer=@time resolve(@julog(query(Orderfrom,Time,Product,Cost)), [facts; clauses])
REPL output
0.000197 seconds (1.22 k allocations: 52.406 KiB)
Dict{Var, Term}[{Orderfrom => us2}]
something like this logic. I think “anding” everything together is a way… I like the idea of multi dispatch as a solution, but also don’t want to have to re-write each function either.
(state>30)->(function(input_y)==true)->(input_y+20)
Any advice is welcome.