LogicalFunctions package

Requirements.LogicalFunctions  ยท source

Icon of LogicalFunctions

Library of logical functions (2-/3-/4-valued logical operators without memory)

Extends Modelica.Icons.Package

Sublibrary LogicalFunctions contains operators without memory, implemented as Modelica functions. The input arguments of these functions have 2-valued logic type (Boolean) or, for the four-valued operators and4, or4, not4, and4All, or4All and the card* counts, 4-valued logic type. The output arguments of these functions have 2-valued or 4-valued logic type (Boolean or Property). The provided operators reason about their input arguments based on Boolean algebra, or, for Property values, on the four-valued ETL algebra described at Property (which is not a Boolean algebra: absorption and distributivity fail, so Property expressions are never simplified). The icon of a function depends on the the type of its output argument (whether it is Boolean or Property).

Contents

NameKindDescription
cardfunctionReturns the number of elements of a Boolean vector that are true
existsfunctionReturns true if at least one element of a Boolean vector is true ('or' of all elements)
forallfunctionReturns true if all elements of a Boolean vector are true ('and' of all elements)
impliesfunctionReturns check as long as the condition is true, otherwise returns true
firstfunctionReturns the value of the first element of a Boolean vector
lastfunctionReturns the value of the last element of a Boolean vector
oneTruefunctionReturns true if exactly one element of a Boolean vector is true ('xor' of all elements)
PropertyToBooleanfunctionConvert Property (Violated, Undecided, Satisfied, Undefined) to Boolean (false, true)
PropertyToIntegerfunctionConvert Property (Violated, Undecided, Satisfied) to Integer (1,2,3)
BooleanToPropertyfunctionConvert Boolean (false,true) to Property (Violated, Satisfied)
IntegerToPropertyfunctionConvert Integer (1,2,3,4) to Property (Violated, Undecided, Satisfied, Undefined)
duringfunctionReturn Satisfied when check is true as long as condition is true
during3functionReturn Satisfied when check is Satisfied as long as condition is true (check: 4-valued logic)
forall3functionReturns Violated, if at least one element of the Property vector is Violated (superseded by and4All)
cardSatisfiedfunctionReturns the number of elements of a Property vector that are Satisfied
cardUndecidedfunctionReturns the number of elements of a Property vector that are Undecided
cardViolatedfunctionReturns the number of elements of a Property vector that are Violated
cardUndefinedfunctionReturns the number of elements of a Property vector that are Undefined
and4function4-valued logic 'and' of two Property values (ETL: Undefined is the neutral element)
or4function4-valued logic 'or' of two Property values (ETL: Undefined is the neutral element)
not4function4-valued logic 'not' of a Property value (ETL: Undecided and Undefined are fixed)
and4Allfunction4-valued logic 'and' over a Property vector (the empty vector gives Undefined, the neutral element)
or4Allfunction4-valued logic 'or' over a Property vector (the empty vector gives Undefined, the neutral element)
marginAndfunctionMargin of a conjunction: the minimum of the margins whose property is applicable (not Undefined)
marginOrfunctionMargin of a disjunction: the maximum of the margins whose property is applicable (not Undefined)
bandAndfunctionUncertainty band of a conjunction: could and4All(p) flip inside the uncertainty intervals of its elements?
bandOrfunctionUncertainty band of a disjunction: could or4All(p) flip inside the uncertainty intervals of its elements?