LogicPrograms Module
Types
Type | Description |
a logic program maps each variable to its set of rules; note that x is a fact if prog[x] contains the empty rule set[{pos=set[];neg=set[]}], and x has no rules if prog[x] = set[] |
|
a rule for a variable x consists of positive and negative literals |
Functions and values
Function or value | Description |
Full Usage:
AbsenceReactions env prog
Parameters:
Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>
|
If for a variable no rule for that variable is left, this variable can never be made true by a must reaction. According to Fitting, and the reaction to absence in synchronous languages, such variables can be made false. This function repeatedly determines the set of variables which can be made false by the reaction to absence, updates the environment and reduces the program by this new decision. It is assumed that a variable either has a value in the environment or it is assigned a set of rules, but not both.
|
|
For any variable that does not have a rule, this function adds an entry for the variable that maps it to a set of empty rules (for consistency).
|
Full Usage:
CompletionOfLogicProgram prog
Parameters:
LogicProgram
Returns: Set<BoolExpr> * BoolExpr
|
compute the completion (equation system) of a logic program
|
|
|
Full Usage:
DependenceGraph2Dot ostr (nodes, graph, posEdges, negEdges)
Parameters:
TextWriter
nodes : string seq
graph : Map<string, 'a>
posEdges : Set<string * string>
negEdges : Set<string * string>
|
draw the dependence graph of a logic program
|
Full Usage:
EvaluateLogicProg beQuiet absReact prog
Parameters:
bool
absReact : Map<string, bool> -> LogicProgram -> Map<string, bool> * LogicProgram * Set<string>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram
|
Evaluate a logic program with a given function to determine the reaction to absence which could be AbsenceReactions or UnfoundedReactions to determine the Fitting semantics or the well-founded semantics.
|
|
LogicProgramsTool is the function to be called from the web page
|
Full Usage:
MustReactions env prog
Parameters:
Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>
|
Given a partial variable assignment, the MustReactions assigns all not yet assigned variables true if they have a rule whose literals are all true (which includes the case that the rule is empty). This process is repeatedly applied until a fixpoint is found. The final result is then the updated environment, the reduced program, and the set of variables made true by the must reactions. It is assumed that a variable either has a value in the environment or it is assigned a set of rules, but not both.
|
|
|
|
print a logic program
|
Full Usage:
Reduct model prog
Parameters:
Set<string>
prog : LogicProgram
Returns: Map<string, Set<rule>>
|
compute the reduct of a logic program and a set of variables
|
Full Usage:
UnfoundedReactions env prog
Parameters:
Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>
|
Compute the largest unfounded set of variables to define the well-founded semantics according to van Gelder, Ross and Schlipf [GeRS91]. A set U(p) is an unfounded set of a program p if for any variable x and rule of x, there is a positive literal in U(p). Hence, all of these variables can be made simultaneously false.
|
|