AIGuiders.Platform.Modeling.Gdl.Expression 0.1.0

dotnet add package AIGuiders.Platform.Modeling.Gdl.Expression --version 0.1.0
                    
NuGet\Install-Package AIGuiders.Platform.Modeling.Gdl.Expression -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AIGuiders.Platform.Modeling.Gdl.Expression" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AIGuiders.Platform.Modeling.Gdl.Expression" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AIGuiders.Platform.Modeling.Gdl.Expression" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AIGuiders.Platform.Modeling.Gdl.Expression --version 0.1.0
                    
#r "nuget: AIGuiders.Platform.Modeling.Gdl.Expression, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AIGuiders.Platform.Modeling.Gdl.Expression@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AIGuiders.Platform.Modeling.Gdl.Expression&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AIGuiders.Platform.Modeling.Gdl.Expression&version=0.1.0
                    
Install as a Cake Tool

AIGuiders.Platform.Modeling.Gdl.Expression

A deliberately small expression AST — literals, fact references, comparisons, and boolean operators — for guarded conditions in declarative files.

What you get

  • ExprNode — the neutral condition tree:
    • LiteralBool / LiteralString / LiteralInt
    • FactRef of string — reference to a named fact
    • Compare of ExprNode * string * ExprNode — left, string operator, right
    • And / Or / Not
  • ExprSpan — source position (Line, Column); [<CLIMutable>] for C# construction
  • ParsedExpr — node plus span, also [<CLIMutable>]
  • Zero package dependencies — a pure type definition assembly

Quick start

open AIGuiders.Platform.Modeling.Gdl.Expression

// "build.failed and not review.open"
let condition : ExprNode =
    ExprNode.And(
        ExprNode.FactRef "build.failed",
        ExprNode.Not(ExprNode.FactRef "review.open"))

let parsed : ParsedExpr =
    { Node = condition
      Span = { Line = 3; Column = 7 } }

match parsed.Node with
| ExprNode.And _ -> printfn "guarded rule"
| _ -> ()

Problem

  • Declarative files grow guarded conditions: when clauses in rule files, visibility conditions in layout decks, preconditions in command catalogs.
  • Each grammar then either invents its own condition representation or embeds a general-purpose expression engine with far more power (and attack surface) than the grammar needs — and C# and F# consumers cannot share one tree.

Solution

  • One deliberately tiny tree covers the whole condition language: three literal kinds, fact refs, a single comparison node, and boolean operators — deterministic, side-effect free, trivially walkable.
  • [<CLIMutable>] records make the tree friendly to C# consumers; spans keep diagnostics anchored to the source file.
  • This is the shared expression IR of the GDL family — the expressiveness ceiling for guarded rules is specified in GUIDERS-ADR-0057, and its F# extraction status is tracked in FSHARP-ADR-0003. In this repo the cockpit-logic graph parser (Modeling.Gdl.Parse.CockpitLogic) produces it and Modeling.Cockpit.Rules evaluates it.

When not to use

  • No parser and no evaluator here — this package is only the AST; parsing lives in the Gdl.Parse.* packages and evaluation belongs to the consumer.
  • Deliberately no arithmetic, string operations, function calls, or lambdas — if your conditions need those, this ceiling is the wrong tool.
  • Comparison operators are unvalidated strings (">=", "=", …); operator semantics are a contract between your parser and evaluator, not this package.

Learn more


MIT · Source & issues · part of the Guiders federation

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AIGuiders.Platform.Modeling.Gdl.Expression:

Package Downloads
AIGuiders.Platform.Modeling.Gdl.Parse.CockpitLogic

Cockpit logic quarry IR — annunciation rules, projectors, principles.

AIGuiders.Platform.Modeling.Cockpit.Rules

Headless cockpit rule evaluation — traceable rule id + matched when.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 150 10/24/2026