packages feed

phino 0.0.0.4 → 0.0.0.5

raw patch · 14 files changed

+138/−5 lines, 14 files

Files

phino.cabal view
@@ -1,7 +1,7 @@ cabal-version:      3.0  name:               phino-version:            0.0.0.4+version:            0.0.0.5 license:            MIT synopsis:           Command-Line Manipulator of 𝜑-Calculus Expressions description:        Please see the README on GitHub at <https://github.com/objectionary/phino#readme>@@ -13,6 +13,7 @@ copyright:          2025 Objectionary.com category:           Language, Code Analysis build-type:         Simple+extra-source-files: resources/*.yaml  source-repository head   type: git
+ resources/alpha.yaml view
@@ -0,0 +1,10 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: ALPHA+pattern: ⟦𝐵1, 𝜏1 ↦ ∅, 𝐵2⟧(𝜏2 ↦ 𝑒)+result: ⟦𝐵1, 𝜏1 ↦ ∅, 𝐵2⟧(𝜏1 ↦ 𝑒)+when:+  eq:+    - ordinal: 𝜏2+    - length: 𝐵1
+ resources/copy.yaml view
@@ -0,0 +1,25 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# @todo #85:60min Simplify Rcopy rule. Right now this rule is quite verbose.+#  It captures a lot objects around its targets. It's done in order to have+#  scope for contextualization of 𝑒2 right here right away. So it's a hack.+#  The origin Rcopy rule looks like this+#  pattern: ⟦ 𝐵1, 𝜏1 ↦ ∅, 𝐵3 ⟧(𝜏1 ↦ 𝑒1)+#  result: ⟦ 𝐵1, 𝜏1 ↦ 𝑒2, 𝐵3 ⟧+#  where 𝑒2 is an expression contextualized with 𝑒1 and some scope S.+#  But with such pattern we don't have this scope, we don't see it.+#  It should be calculated somehow. In general this scope is nearest+#  outer formation. So we need to create a way to calculate it and+#  rewrite this rule.+name: COPY+pattern: ⟦ 𝐵1, 𝜏1 ↦ ⟦ 𝐵2, 𝜏2 ↦ ∅, 𝐵3 ⟧(𝜏2 ↦ 𝑒1) * !t, 𝐵4 ⟧+result: ⟦ 𝐵1, 𝜏1 ↦ ⟦ 𝐵2, 𝜏2 ↦ 𝑒2, 𝐵3 ⟧ * !t, 𝐵4 ⟧+when:+  fn: 𝑒1+where:+  - meta: 𝑒2+    function: contextualize+    args:+      - 𝑒1+      - ⟦ 𝐵1, 𝜏1 ↦ ⟦ 𝐵2, 𝜏2 ↦ ∅, 𝐵3 ⟧(𝜏2 ↦ 𝑒1) * !t, 𝐵4 ⟧
+ resources/dc.yaml view
@@ -0,0 +1,6 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: DC+pattern: ⊥(𝜏 ↦ 𝑒)+result: ⊥
+ resources/dd.yaml view
@@ -0,0 +1,6 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: DD+pattern: ⊥.𝜏+result: ⊥
+ resources/dot.yaml view
@@ -0,0 +1,14 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: DOT+pattern: ⟦𝐵1, 𝜏 ↦ 𝑒1, 𝐵2⟧.𝜏+result: 𝑒2(ρ ↦ ⟦𝐵1, 𝜏 ↦ 𝑒1, 𝐵2⟧)+when:+  nf: 𝑒1+where:+  - meta: 𝑒2+    function: contextualize+    args:+      - 𝑒1+      - ⟦𝐵1, 𝜏 ↦ 𝑒1, 𝐵2⟧
+ resources/miss.yaml view
@@ -0,0 +1,14 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: 'MISS'+pattern: ⟦𝐵⟧(𝜏 ↦ 𝑒)+result: ⊥+when:+  and:+    - not:+        in:+          - 𝜏+          - 𝐵+    - not:+        alpha: 𝜏
+ resources/null.yaml view
@@ -0,0 +1,6 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: 'NULL'+pattern: ⟦𝐵1, 𝜏 ↦ ∅, 𝐵2⟧.𝜏+result: ⊥
+ resources/over.yaml view
@@ -0,0 +1,11 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: OVER+pattern: ⟦𝐵1, 𝜏 ↦ 𝑒1, 𝐵2⟧(𝜏 ↦ 𝑒2)+result: ⊥+when:+  not:+    eq:+      - 𝜏+      - ρ
+ resources/phi.yaml view
@@ -0,0 +1,15 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: PHI+pattern: ⟦𝐵⟧.𝜏+result: ⟦𝐵⟧.φ.𝜏+when:+  and:+    - in:+        - φ+        - 𝐵+    - not:+        in:+          - 𝜏+          - 𝐵
+ resources/stay.yaml view
@@ -0,0 +1,6 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: STAY+pattern: ⟦𝐵1, ρ ↦ 𝑒1, 𝐵2⟧(ρ ↦ 𝑒2)+result: ⟦𝐵1, ρ ↦ 𝑒1, 𝐵2⟧
+ resources/stop.yaml view
@@ -0,0 +1,20 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+name: STOP+pattern: ⟦𝐵⟧.𝜏+result: ⊥+when:+  and:+    - not:+        in:+          - 𝜏+          - 𝐵+    - not:+        in:+          - φ+          - 𝐵+    - not:+        in:+          - λ+          - 𝐵
src/Misc.hs view
@@ -38,8 +38,7 @@ withVoidRho bds = withVoidRho' bds False   where     withVoidRho' :: [Binding] -> Bool -> [Binding]-    withVoidRho' [] True = []-    withVoidRho' [] False = [BiVoid AtRho]+    withVoidRho' [] hasRho = [BiVoid AtRho | not hasRho]     withVoidRho' (bd : bds) hasRho =        case bd of         BiMeta _ -> bd : bds
test/ConditionSpec.hs view
@@ -17,12 +17,12 @@ import Printer (printSubstitutions) import System.FilePath import Test.Hspec (Spec, describe, expectationFailure, it, runIO)-import Yaml qualified as Y+import Yaml qualified  data ConditionPack = ConditionPack   { expression :: Expression,     pattern :: Expression,-    condition :: Y.Condition+    condition :: Yaml.Condition   }   deriving (Generic, FromJSON, Show)