feat: new AST representation

File names will be changed eventually.

ref: N25B-376
This commit is contained in:
2025-12-23 17:30:35 +01:00
parent 756e1f0dc5
commit 3253760ef1
4 changed files with 279 additions and 6 deletions

View File

@@ -64,10 +64,13 @@ class InferredBelief(ProgramElement):
right: Belief
type Norm = BasicNorm | ConditionalNorm
class Norm(ProgramElement):
name: str = ""
norm: str
critical: bool = False
class BasicNorm(ProgramElement):
class BasicNorm(Norm):
"""
Represents a behavioral norm.
@@ -75,12 +78,10 @@ class BasicNorm(ProgramElement):
:ivar critical: When true, this norm should absolutely not be violated (checked separately).
"""
name: str = ""
norm: str
critical: bool = False
pass
class ConditionalNorm(BasicNorm):
class ConditionalNorm(Norm):
"""
Represents a norm that is only active when a condition is met (i.e., a certain belief holds).