I am starting off with logical programming, and I am working on a simple program to find shortest paths between nodes. The only tutorial I could really understand dealt with command arguments.
Is there a way I can replace Args in my program for a hardcoded structure like a list or something? Is that possible with asp?
import com.sap.cxlabs.bewater.logic.asp._
val shortestPath = SModels(Args( %here is where I'd like to use a data structure.
p.path(X, Y, W) :-(p.start(X), p.edge(X, Y, W)),
p.path(X, Z, A + B) :- (p.path(X, Y, A), p.edge(Y, Z, B)),
p.shortest(W) :- (p.end(Y), p.path(X, Y, W), not p.path(X, Y, Z), W < Z),
))
shortestPath.deduct(facts)
edit Args is start-nodes, end-nodes, edges