verigraph-1.1.1: Software specification and verification tool based on graph rewriting.

Safe HaskellSafe
LanguageHaskell2010

SndOrder.Rule

Synopsis

Documentation

type SndOrderRule a b = Production (RuleMorphism a b) Source #

A second order rule:

        nl       nr
    NL◀─────<NK>─────▶NR
     ▲        ▲        ▲
  nacL\    nacK\    nacR\
       \        \        \
        \   ll   \   lr   \
        LL◀─────<LK>─────▶LR
        ▲        ▲        ▲
   leftL│   leftK│   leftR│
        │        │        │
        │    kl  │    kr  │
        KL◀─────<KK>─────▶KR
        │        │        │
  rightL│  rightK│  rightR│
        │        │        │
        ▼    rl  ▼    rr  ▼
        RL◀─────<RK>─────▶RR

domain rule = (ll,lr)

interface rule = (kl,kr)

codomain rule (rl,rr)

nac rule = (nl,nr)

nacs = set of: domain rule, nac rule, nacL, nacK, nacR

left = domain rule, interface rule, leftL, leftK, leftR

right = interface rule, codomain rule, rightL, rightK, rightR

addMinimalSafetyNacs :: MorphismsConfig -> SndOrderRule a b -> SndOrderRule a b Source #

Adds the minimal safety nacs needed to this production always produce a second order rule. If the nacs that going to be added not satisfies the others nacs, then it do not need to be added.

applySndOrderRule :: MorphismsConfig -> (String, SndOrderRule a b) -> (String, GraphRule a b) -> [(String, GraphRule a b)] Source #

Applies a named second order rule to a named first order rule with all possible matches, and generates named first order rules as result.

applySecondOrder :: ((String, SndOrderRule a b) -> (String, GraphRule a b) -> [t]) -> [(String, GraphRule a b)] -> [(String, SndOrderRule a b)] -> [t] Source #

Receives a function that works with a second order and a first order rule. Apply this function on all possible combinations of rules.