From 413f1798c4e2e48e800094f137201e81fd16aa37 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Tue, 5 Jul 2022 23:53:14 +0200 Subject: [PATCH] Add Mode and Modality. --- networks.rkt | 11 +++++------ scribblings/networks.scrbl | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/networks.rkt b/networks.rkt index 83b0b17..86f5668 100644 --- a/networks.rkt +++ b/networks.rkt @@ -32,6 +32,8 @@ interaction? get-interaction-sign build-interaction-graph build-interaction-graph/form build-signed-interaction-graph build-signed-interaction-graph/form + + Modality Mode ) (define-type (State a) (VariableMapping a)) @@ -507,6 +509,9 @@ (define n2 (network-form n-multi 123-doms)) (check-equal? (graphviz (build-signed-interaction-graph/form n2)) "digraph G {\n\tnode0 [label=\"y\"];\n\tnode1 [label=\"t\"];\n\tnode2 [label=\"z\"];\n\tnode3 [label=\"x\"];\n\tsubgraph U {\n\t\tedge [dir=none];\n\t\tnode0 -> node0 [label=\"1\"];\n\t}\n\tsubgraph D {\n\t\tnode0 -> node1 [label=\"0\"];\n\t\tnode0 -> node2 [label=\"-1\"];\n\t\tnode0 -> node3 [label=\"1\"];\n\t}\n}\n")]))) + + (define-type Modality (Setof Variable)) + (define-type Mode (Setof Modality)) ) (require 'typed) @@ -665,13 +670,7 @@ ;;; Dynamics of networks ;;; ==================== -;;; This section contains definitions for building and analysing the -;;; dynamics of networks. - -;;; A modality is a set of variable. (define modality? (set/c variable?)) - -;;; A mode is a set of modalities. (define mode? (set/c modality?)) ;;; A network dynamics is a network plus a mode. diff --git a/scribblings/networks.scrbl b/scribblings/networks.scrbl index aa26afb..c903306 100644 --- a/scribblings/networks.scrbl +++ b/scribblings/networks.scrbl @@ -362,6 +362,20 @@ values represented as 0 and 1. @ex[ (build-all-01-states '(a b)) ]} + +@deftype[Modality]{ + +A modality is a set of variables. This is a synonym of @racket[(Setof +Variable)]. + +} + +@deftype[Mode]{ + +A mode is a set of modalities. This is a synonym of @racket[(Setof Modality)]. + +} + @section{Inferring interaction graphs} This section provides inference of both unsigned and signed interaction graphs.