speclogician 0.0.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. speclogician-0.0.0b1/PKG-INFO +116 -0
  2. speclogician-0.0.0b1/README.md +100 -0
  3. speclogician-0.0.0b1/pyproject.toml +32 -0
  4. speclogician-0.0.0b1/src/speclogician/__init__.py +0 -0
  5. speclogician-0.0.0b1/src/speclogician/commands/__init__.py +15 -0
  6. speclogician-0.0.0b1/src/speclogician/commands/cmd_ch.py +616 -0
  7. speclogician-0.0.0b1/src/speclogician/commands/cmd_find.py +256 -0
  8. speclogician-0.0.0b1/src/speclogician/commands/cmd_view.py +202 -0
  9. speclogician-0.0.0b1/src/speclogician/commands/runner.py +149 -0
  10. speclogician-0.0.0b1/src/speclogician/commands/utils.py +101 -0
  11. speclogician-0.0.0b1/src/speclogician/data/__init__.py +0 -0
  12. speclogician-0.0.0b1/src/speclogician/data/artifact.py +63 -0
  13. speclogician-0.0.0b1/src/speclogician/data/container.py +402 -0
  14. speclogician-0.0.0b1/src/speclogician/data/mapping.py +88 -0
  15. speclogician-0.0.0b1/src/speclogician/data/refs.py +24 -0
  16. speclogician-0.0.0b1/src/speclogician/data/traces.py +26 -0
  17. speclogician-0.0.0b1/src/speclogician/demos/.DS_Store +0 -0
  18. speclogician-0.0.0b1/src/speclogician/demos/cmd_demo.py +278 -0
  19. speclogician-0.0.0b1/src/speclogician/demos/loader.py +135 -0
  20. speclogician-0.0.0b1/src/speclogician/demos/model.py +27 -0
  21. speclogician-0.0.0b1/src/speclogician/demos/runner.py +51 -0
  22. speclogician-0.0.0b1/src/speclogician/logic/__init__.py +11 -0
  23. speclogician-0.0.0b1/src/speclogician/logic/api/__init__.py +29 -0
  24. speclogician-0.0.0b1/src/speclogician/logic/api/client.py +606 -0
  25. speclogician-0.0.0b1/src/speclogician/logic/api/decomp.py +67 -0
  26. speclogician-0.0.0b1/src/speclogician/logic/api/scenario.py +102 -0
  27. speclogician-0.0.0b1/src/speclogician/logic/api/traces.py +59 -0
  28. speclogician-0.0.0b1/src/speclogician/logic/lib/__init__.py +19 -0
  29. speclogician-0.0.0b1/src/speclogician/logic/lib/complement.py +107 -0
  30. speclogician-0.0.0b1/src/speclogician/logic/lib/domain_model.py +59 -0
  31. speclogician-0.0.0b1/src/speclogician/logic/lib/predicates.py +151 -0
  32. speclogician-0.0.0b1/src/speclogician/logic/lib/scenarios.py +369 -0
  33. speclogician-0.0.0b1/src/speclogician/logic/lib/traces.py +114 -0
  34. speclogician-0.0.0b1/src/speclogician/logic/lib/transitions.py +104 -0
  35. speclogician-0.0.0b1/src/speclogician/logic/main.py +246 -0
  36. speclogician-0.0.0b1/src/speclogician/logic/strings.py +194 -0
  37. speclogician-0.0.0b1/src/speclogician/logic/utils.py +135 -0
  38. speclogician-0.0.0b1/src/speclogician/main.py +139 -0
  39. speclogician-0.0.0b1/src/speclogician/modeling/__init__.py +31 -0
  40. speclogician-0.0.0b1/src/speclogician/modeling/complement.py +104 -0
  41. speclogician-0.0.0b1/src/speclogician/modeling/component.py +71 -0
  42. speclogician-0.0.0b1/src/speclogician/modeling/conflict.py +26 -0
  43. speclogician-0.0.0b1/src/speclogician/modeling/domain.py +349 -0
  44. speclogician-0.0.0b1/src/speclogician/modeling/predicates.py +59 -0
  45. speclogician-0.0.0b1/src/speclogician/modeling/scenario.py +162 -0
  46. speclogician-0.0.0b1/src/speclogician/modeling/spec.py +306 -0
  47. speclogician-0.0.0b1/src/speclogician/modeling/spec_stats.py +39 -0
  48. speclogician-0.0.0b1/src/speclogician/presentation/__init__.py +0 -0
  49. speclogician-0.0.0b1/src/speclogician/presentation/api.py +244 -0
  50. speclogician-0.0.0b1/src/speclogician/presentation/builders/__init__.py +0 -0
  51. speclogician-0.0.0b1/src/speclogician/presentation/builders/_links.py +44 -0
  52. speclogician-0.0.0b1/src/speclogician/presentation/builders/container.py +53 -0
  53. speclogician-0.0.0b1/src/speclogician/presentation/builders/data_artifact.py +42 -0
  54. speclogician-0.0.0b1/src/speclogician/presentation/builders/domain.py +54 -0
  55. speclogician-0.0.0b1/src/speclogician/presentation/builders/instances_list.py +38 -0
  56. speclogician-0.0.0b1/src/speclogician/presentation/builders/predicate.py +51 -0
  57. speclogician-0.0.0b1/src/speclogician/presentation/builders/recommendations.py +41 -0
  58. speclogician-0.0.0b1/src/speclogician/presentation/builders/scenario.py +41 -0
  59. speclogician-0.0.0b1/src/speclogician/presentation/builders/scenario_complement.py +82 -0
  60. speclogician-0.0.0b1/src/speclogician/presentation/builders/smart_find.py +39 -0
  61. speclogician-0.0.0b1/src/speclogician/presentation/builders/spec.py +39 -0
  62. speclogician-0.0.0b1/src/speclogician/presentation/builders/state_diff.py +150 -0
  63. speclogician-0.0.0b1/src/speclogician/presentation/builders/state_instance.py +42 -0
  64. speclogician-0.0.0b1/src/speclogician/presentation/builders/state_instance_summary.py +84 -0
  65. speclogician-0.0.0b1/src/speclogician/presentation/builders/trace.py +58 -0
  66. speclogician-0.0.0b1/src/speclogician/presentation/ctx.py +38 -0
  67. speclogician-0.0.0b1/src/speclogician/presentation/models/__init__.py +0 -0
  68. speclogician-0.0.0b1/src/speclogician/presentation/models/container.py +44 -0
  69. speclogician-0.0.0b1/src/speclogician/presentation/models/data_artifact.py +33 -0
  70. speclogician-0.0.0b1/src/speclogician/presentation/models/domain.py +50 -0
  71. speclogician-0.0.0b1/src/speclogician/presentation/models/instances_list.py +23 -0
  72. speclogician-0.0.0b1/src/speclogician/presentation/models/predicate.py +60 -0
  73. speclogician-0.0.0b1/src/speclogician/presentation/models/recommendations.py +34 -0
  74. speclogician-0.0.0b1/src/speclogician/presentation/models/scenario.py +31 -0
  75. speclogician-0.0.0b1/src/speclogician/presentation/models/scenario_complement.py +40 -0
  76. speclogician-0.0.0b1/src/speclogician/presentation/models/smart_find.py +34 -0
  77. speclogician-0.0.0b1/src/speclogician/presentation/models/spec.py +32 -0
  78. speclogician-0.0.0b1/src/speclogician/presentation/models/state_diff.py +34 -0
  79. speclogician-0.0.0b1/src/speclogician/presentation/models/state_instance.py +31 -0
  80. speclogician-0.0.0b1/src/speclogician/presentation/models/state_instance_summary.py +102 -0
  81. speclogician-0.0.0b1/src/speclogician/presentation/models/trace.py +42 -0
  82. speclogician-0.0.0b1/src/speclogician/presentation/preview/__init__.py +13 -0
  83. speclogician-0.0.0b1/src/speclogician/presentation/preview/cli.py +50 -0
  84. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/__init__.py +205 -0
  85. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/artifact_container.py +150 -0
  86. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/data_artifact.py +144 -0
  87. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/domain_model.py +162 -0
  88. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/instances_list.py +162 -0
  89. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/predicate.py +184 -0
  90. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/scenario.py +84 -0
  91. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/scenario_complement.py +81 -0
  92. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/smart_find.py +140 -0
  93. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/spec.py +95 -0
  94. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/state_diff.py +158 -0
  95. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/state_instance.py +128 -0
  96. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/state_instance_summary.py +80 -0
  97. speclogician-0.0.0b1/src/speclogician/presentation/preview/fixtures/trace.py +206 -0
  98. speclogician-0.0.0b1/src/speclogician/presentation/preview/registry.py +42 -0
  99. speclogician-0.0.0b1/src/speclogician/presentation/renderers/__init__.py +24 -0
  100. speclogician-0.0.0b1/src/speclogician/presentation/renderers/container.py +136 -0
  101. speclogician-0.0.0b1/src/speclogician/presentation/renderers/data_artifact.py +144 -0
  102. speclogician-0.0.0b1/src/speclogician/presentation/renderers/domain.py +123 -0
  103. speclogician-0.0.0b1/src/speclogician/presentation/renderers/instances_list.py +120 -0
  104. speclogician-0.0.0b1/src/speclogician/presentation/renderers/predicate.py +180 -0
  105. speclogician-0.0.0b1/src/speclogician/presentation/renderers/recommendations.py +90 -0
  106. speclogician-0.0.0b1/src/speclogician/presentation/renderers/scenario.py +94 -0
  107. speclogician-0.0.0b1/src/speclogician/presentation/renderers/scenario_complement.py +59 -0
  108. speclogician-0.0.0b1/src/speclogician/presentation/renderers/smart_find.py +307 -0
  109. speclogician-0.0.0b1/src/speclogician/presentation/renderers/spec.py +105 -0
  110. speclogician-0.0.0b1/src/speclogician/presentation/renderers/state_diff.py +102 -0
  111. speclogician-0.0.0b1/src/speclogician/presentation/renderers/state_instance.py +82 -0
  112. speclogician-0.0.0b1/src/speclogician/presentation/renderers/state_instance_summary.py +143 -0
  113. speclogician-0.0.0b1/src/speclogician/presentation/renderers/trace.py +122 -0
  114. speclogician-0.0.0b1/src/speclogician/py.typed +0 -0
  115. speclogician-0.0.0b1/src/speclogician/shell/app.py +170 -0
  116. speclogician-0.0.0b1/src/speclogician/shell/shell_ch.py +263 -0
  117. speclogician-0.0.0b1/src/speclogician/shell/shell_view.py +153 -0
  118. speclogician-0.0.0b1/src/speclogician/state/__init__.py +0 -0
  119. speclogician-0.0.0b1/src/speclogician/state/change.py +428 -0
  120. speclogician-0.0.0b1/src/speclogician/state/change_result.py +32 -0
  121. speclogician-0.0.0b1/src/speclogician/state/diff.py +191 -0
  122. speclogician-0.0.0b1/src/speclogician/state/inst.py +574 -0
  123. speclogician-0.0.0b1/src/speclogician/state/recommendation.py +13 -0
  124. speclogician-0.0.0b1/src/speclogician/state/recommender.py +577 -0
  125. speclogician-0.0.0b1/src/speclogician/state/state.py +465 -0
  126. speclogician-0.0.0b1/src/speclogician/state/state_stats.py +133 -0
  127. speclogician-0.0.0b1/src/speclogician/tui/__init__.py +0 -0
  128. speclogician-0.0.0b1/src/speclogician/tui/app.py +257 -0
  129. speclogician-0.0.0b1/src/speclogician/tui/app.tcss +160 -0
  130. speclogician-0.0.0b1/src/speclogician/tui/demo.py +45 -0
  131. speclogician-0.0.0b1/src/speclogician/tui/images/speclogician-full.png +0 -0
  132. speclogician-0.0.0b1/src/speclogician/tui/images/speclogician-minimal.png +0 -0
  133. speclogician-0.0.0b1/src/speclogician/tui/main_screen.py +454 -0
  134. speclogician-0.0.0b1/src/speclogician/tui/splash_screen.py +51 -0
  135. speclogician-0.0.0b1/src/speclogician/tui/stats_screen.py +125 -0
  136. speclogician-0.0.0b1/src/speclogician/utils/__init__.py +78 -0
  137. speclogician-0.0.0b1/src/speclogician/utils/load.py +166 -0
  138. speclogician-0.0.0b1/src/speclogician/utils/prompt.md +325 -0
  139. speclogician-0.0.0b1/src/speclogician/utils/testing.py +151 -0
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.3
2
+ Name: speclogician
3
+ Version: 0.0.0b1
4
+ Summary: SpecLogicain AI framework for data-driven formal program specification synthesis, verification and analysis
5
+ Author: denis, hongyu
6
+ Author-email: denis <denis@imandra.ai>, hongyu <hongyu@imandra.ai>
7
+ Requires-Dist: imandrax-api-models>=18.0.0
8
+ Requires-Dist: iml-query>=0.5.1
9
+ Requires-Dist: pydantic>=2.12.5
10
+ Requires-Dist: rich>=14.2.0
11
+ Requires-Dist: textual>=6.11.0
12
+ Requires-Dist: typer>=0.20.0
13
+ Requires-Python: >=3.12
14
+ Project-URL: Homepage, https://speclogician.dev/
15
+ Description-Content-Type: text/markdown
16
+
17
+ # SpecLogician
18
+ SpecLogician AI framework for data-driven formal program specification synthesis, verification and analysis
19
+
20
+ www.speclogician.dev
21
+
22
+ ## 1) The challenge: scaling formal methods via LLM-powered automation
23
+
24
+ - Automatically applying formal methods to large software systems using **LLM-powered and agentic tools** remains a fundamental challenge
25
+ - Traditional formal modeling approaches require building **large, monolithic formal models upfront**
26
+ - There is **no single canonical way** to formalize a complex software system
27
+ - As a result, formalization becomes **as much an art as a science**, relying heavily on expert judgment
28
+ - These characteristics fundamentally limit automation:
29
+ - LLMs struggle to generate or maintain **large, globally consistent formal models**
30
+ - Small local changes often require understanding the entire model
31
+ - Monolithic models are brittle under iterative, agent-driven workflows
32
+
33
+
34
+ ## 2) SpecLogician’s core idea
35
+
36
+ - SpecLogician is an **AI framework for data-driven formal program specification synthesis, verification, and analysis**
37
+ - It replaces monolithic specifications with **incrementally constructed formal logic**
38
+ - The core logic is built from **symbolic `given / when / then` scenarios**
39
+ - Scenarios are:
40
+ - composable
41
+ - declarative
42
+ - local in scope
43
+ - Scenarios are connected to a **domain model of arbitrary complexity**
44
+ - The domain model captures:
45
+ - predicates
46
+ - transitions
47
+ - state/action structure
48
+ - auxiliary and domain-specific logic
49
+
50
+
51
+ ## 3) Why this structure works well with LLMs
52
+
53
+ - LLM-powered tools are used to:
54
+ - propose new scenarios
55
+ - refine existing scenarios
56
+ - generate structured deltas (add / remove / edit)
57
+ - LLMs operate on **small, well-scoped artifacts**, not entire formal models
58
+ - Each change is:
59
+ - explicit
60
+ - typed
61
+ - machine-checkable
62
+ - This aligns naturally with how LLMs perform best:
63
+ - local reasoning
64
+ - incremental edits
65
+ - structured outputs (JSON, CLI commands)
66
+
67
+
68
+ ## 4) Agentic reasoning loop (formal reasoning as the backbone)
69
+
70
+ - SpecLogician sits at the center of an **agentic reasoning loop**
71
+ - In this loop:
72
+ - **CodeLogician / ImandraX** translate source code into formal models and reasoning artifacts
73
+ - **LLM-powered agentic CLIs** propose scenario additions, edits, and removals as structured deltas
74
+ - **Software mapping tools** (e.g. CodeMaps from cognition.ai) provide high-level program structure and navigation context
75
+ - Each agent contributes **partial, local insight**:
76
+ - code structure
77
+ - behavioral intent
78
+ - execution traces
79
+ - test artifacts
80
+ - SpecLogician:
81
+ - integrates these inputs into a single formal state
82
+ - validates them symbolically
83
+ - delegates global analysis to the **ImandraX automated reasoning engine**
84
+ - The reasoning engine analyzes the **entire accumulated model after every change**
85
+ - This creates a **closed-loop workflow**:
86
+ - propose → formalize → verify → refine
87
+
88
+
89
+ ## 5) What the resulting formal model enables
90
+
91
+ - Systematically identify **gaps in design and requirements**
92
+ - Precisely understand **test coverage and gaps in test coverage**
93
+ - Trace:
94
+ - execution logs
95
+ - test cases
96
+ - documentation
97
+ - other artifacts
98
+ back to **formal specifications and requirements**
99
+ - Automatically **generate missing test cases**
100
+ - Safely **model and verify the impact of changes** before they are applied
101
+ - Maintain a **single, authoritative source of truth** for system behavior
102
+
103
+
104
+ ## 6) Big-picture outcome
105
+
106
+ - Transforms LLMs from:
107
+ - probabilistic code generators
108
+ into:
109
+ - **reliable collaborators in a verification-driven workflow**
110
+ - Makes formal methods:
111
+ - incremental
112
+ - data-driven
113
+ - compatible with LLM-powered automation
114
+ - scalable to real-world software systems
115
+ - Positions SpecLogician as the **formal reasoning backbone** for modern, agentic software development
116
+
@@ -0,0 +1,100 @@
1
+ # SpecLogician
2
+ SpecLogician AI framework for data-driven formal program specification synthesis, verification and analysis
3
+
4
+ www.speclogician.dev
5
+
6
+ ## 1) The challenge: scaling formal methods via LLM-powered automation
7
+
8
+ - Automatically applying formal methods to large software systems using **LLM-powered and agentic tools** remains a fundamental challenge
9
+ - Traditional formal modeling approaches require building **large, monolithic formal models upfront**
10
+ - There is **no single canonical way** to formalize a complex software system
11
+ - As a result, formalization becomes **as much an art as a science**, relying heavily on expert judgment
12
+ - These characteristics fundamentally limit automation:
13
+ - LLMs struggle to generate or maintain **large, globally consistent formal models**
14
+ - Small local changes often require understanding the entire model
15
+ - Monolithic models are brittle under iterative, agent-driven workflows
16
+
17
+
18
+ ## 2) SpecLogician’s core idea
19
+
20
+ - SpecLogician is an **AI framework for data-driven formal program specification synthesis, verification, and analysis**
21
+ - It replaces monolithic specifications with **incrementally constructed formal logic**
22
+ - The core logic is built from **symbolic `given / when / then` scenarios**
23
+ - Scenarios are:
24
+ - composable
25
+ - declarative
26
+ - local in scope
27
+ - Scenarios are connected to a **domain model of arbitrary complexity**
28
+ - The domain model captures:
29
+ - predicates
30
+ - transitions
31
+ - state/action structure
32
+ - auxiliary and domain-specific logic
33
+
34
+
35
+ ## 3) Why this structure works well with LLMs
36
+
37
+ - LLM-powered tools are used to:
38
+ - propose new scenarios
39
+ - refine existing scenarios
40
+ - generate structured deltas (add / remove / edit)
41
+ - LLMs operate on **small, well-scoped artifacts**, not entire formal models
42
+ - Each change is:
43
+ - explicit
44
+ - typed
45
+ - machine-checkable
46
+ - This aligns naturally with how LLMs perform best:
47
+ - local reasoning
48
+ - incremental edits
49
+ - structured outputs (JSON, CLI commands)
50
+
51
+
52
+ ## 4) Agentic reasoning loop (formal reasoning as the backbone)
53
+
54
+ - SpecLogician sits at the center of an **agentic reasoning loop**
55
+ - In this loop:
56
+ - **CodeLogician / ImandraX** translate source code into formal models and reasoning artifacts
57
+ - **LLM-powered agentic CLIs** propose scenario additions, edits, and removals as structured deltas
58
+ - **Software mapping tools** (e.g. CodeMaps from cognition.ai) provide high-level program structure and navigation context
59
+ - Each agent contributes **partial, local insight**:
60
+ - code structure
61
+ - behavioral intent
62
+ - execution traces
63
+ - test artifacts
64
+ - SpecLogician:
65
+ - integrates these inputs into a single formal state
66
+ - validates them symbolically
67
+ - delegates global analysis to the **ImandraX automated reasoning engine**
68
+ - The reasoning engine analyzes the **entire accumulated model after every change**
69
+ - This creates a **closed-loop workflow**:
70
+ - propose → formalize → verify → refine
71
+
72
+
73
+ ## 5) What the resulting formal model enables
74
+
75
+ - Systematically identify **gaps in design and requirements**
76
+ - Precisely understand **test coverage and gaps in test coverage**
77
+ - Trace:
78
+ - execution logs
79
+ - test cases
80
+ - documentation
81
+ - other artifacts
82
+ back to **formal specifications and requirements**
83
+ - Automatically **generate missing test cases**
84
+ - Safely **model and verify the impact of changes** before they are applied
85
+ - Maintain a **single, authoritative source of truth** for system behavior
86
+
87
+
88
+ ## 6) Big-picture outcome
89
+
90
+ - Transforms LLMs from:
91
+ - probabilistic code generators
92
+ into:
93
+ - **reliable collaborators in a verification-driven workflow**
94
+ - Makes formal methods:
95
+ - incremental
96
+ - data-driven
97
+ - compatible with LLM-powered automation
98
+ - scalable to real-world software systems
99
+ - Positions SpecLogician as the **formal reasoning backbone** for modern, agentic software development
100
+
@@ -0,0 +1,32 @@
1
+ [project]
2
+ name = "speclogician"
3
+ version = "0.0.0b1"
4
+ description = "SpecLogicain AI framework for data-driven formal program specification synthesis, verification and analysis"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "denis", email = "denis@imandra.ai" },
8
+ { name = "hongyu", email = "hongyu@imandra.ai" }
9
+ ]
10
+ requires-python = ">=3.12"
11
+ dependencies = [
12
+ "imandrax-api-models>=18.0.0",
13
+ "iml-query>=0.5.1",
14
+ "pydantic>=2.12.5",
15
+ "rich>=14.2.0",
16
+ "textual>=6.11.0",
17
+ "typer>=0.20.0",
18
+ ]
19
+
20
+ [build-system]
21
+ requires = ["uv_build>=0.8.22,<0.9.0"]
22
+ build-backend = "uv_build"
23
+
24
+ [dependency-groups]
25
+ dev = [
26
+ "dotenv>=0.9.9",
27
+ "pytest>=9.0.2",
28
+ "pytest-asyncio>=1.3.0",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://speclogician.dev/"
File without changes
@@ -0,0 +1,15 @@
1
+ #
2
+ # Imandra Inc.
3
+ #
4
+ # speclogician/commands/__init__.py
5
+ #
6
+
7
+ from .cmd_ch import app as ch_app
8
+ from .cmd_find import app as find_app
9
+ from .cmd_view import app as view_app
10
+
11
+ __all__ = [
12
+ "ch_app",
13
+ "find_app",
14
+ "view_app"
15
+ ]