Header menu logo F# Header menu logo Averest

LogicPrograms Module

Types

Type Description

LogicProgram

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[]

rule

a rule for a variable x consists of positive and negative literals

Functions and values

Function or value Description

AbsenceReactions env prog

Full Usage: AbsenceReactions env prog

Parameters:
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.

env : Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>

AddEmptyRules p

Full Usage: AddEmptyRules p

Parameters:
Returns: LogicProgram

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).

p : LogicProgram
Returns: LogicProgram

CompletionOfLogicProgram prog

Full Usage: CompletionOfLogicProgram prog

Parameters:
Returns: Set<BoolExpr> * BoolExpr

compute the completion (equation system) of a logic program

prog : LogicProgram
Returns: Set<BoolExpr> * BoolExpr

DependenceGraph prog

Full Usage: DependenceGraph prog

Parameters:
Returns: Set<string> * Map<string, Set<string>> * Set<string * string> * Set<string * string>

compute the dependence graph of a logic program

prog : LogicProgram
Returns: Set<string> * Map<string, Set<string>> * Set<string * string> * Set<string * string>

DependenceGraph2Dot ostr (nodes, graph, posEdges, negEdges)

Full Usage: DependenceGraph2Dot ostr (nodes, graph, posEdges, negEdges)

Parameters:
    ostr : TextWriter
    nodes : string seq
    graph : Map<string, 'a>
    posEdges : Set<string * string>
    negEdges : Set<string * string>

draw the dependence graph of a logic program

ostr : TextWriter
nodes : string seq
graph : Map<string, 'a>
posEdges : Set<string * string>
negEdges : Set<string * string>

EvaluateLogicProg beQuiet absReact prog

Full Usage: EvaluateLogicProg beQuiet absReact prog

Parameters:
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.

beQuiet : bool
absReact : Map<string, bool> -> LogicProgram -> Map<string, bool> * LogicProgram * Set<string>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram

LogicProgramsTool qscoll

Full Usage: LogicProgramsTool qscoll

Parameters:

LogicProgramsTool is the function to be called from the web page

qscoll : NameValueCollection

MustReactions env prog

Full Usage: MustReactions env prog

Parameters:
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.

env : Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>

ParseLogicProgram s

Full Usage: ParseLogicProgram s

Parameters:
    s : string

Returns: LogicProgram

parse a logic program

s : string
Returns: LogicProgram

PrintLogicProgram ostr p

Full Usage: PrintLogicProgram ostr p

Parameters:

print a logic program

ostr : TextWriter
p : LogicProgram

Reduct model prog

Full Usage: Reduct model prog

Parameters:
Returns: Map<string, Set<rule>>

compute the reduct of a logic program and a set of variables

model : Set<string>
prog : LogicProgram
Returns: Map<string, Set<rule>>

UnfoundedReactions env prog

Full Usage: UnfoundedReactions env prog

Parameters:
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.

env : Map<string, bool>
prog : LogicProgram
Returns: Map<string, bool> * LogicProgram * Set<string>

examplePrograms

Full Usage: examplePrograms

Returns: (string * Map<string, Set<rule>>) list

lists some example programs of the Esterel primer

Returns: (string * Map<string, Set<rule>>) list

Type something to start searching.