Skip to content

Commit 3f8154f

Browse files
Copilothzhangxyzgithub-code-quality[bot]
authored
Rename TypeScript/JavaScript classes to PascalCase (#95)
* Initial plan * Rename TypeScript/JavaScript classes to PascalCase naming convention Co-authored-by: hzhangxyz <[email protected]> * Fix remaining term_t references in test_term.mjs Co-authored-by: hzhangxyz <[email protected]> * Potential fix for pull request finding 'Missing variable declaration' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix remaining old class names in docs/concepts/search.md Co-authored-by: hzhangxyz <[email protected]> * Update Sudoku.vue example to use new class names Co-authored-by: hzhangxyz <[email protected]> * Update sudoku.md. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hzhangxyz <[email protected]> Co-authored-by: Hao Zhang(张浩) <[email protected]> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent f7b4df4 commit 3f8154f

File tree

20 files changed

+338
-338
lines changed

20 files changed

+338
-338
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ Include the headers from `include/ds/` in your C++ project.
8484
### TypeScript/JavaScript Example
8585

8686
```typescript
87-
import { rule_t, search_t } from "atsds";
87+
import { Rule, Search } from "atsds";
8888

8989
// Create a search engine
90-
const search = new search_t(1000, 10000);
90+
const search = new Search(1000, 10000);
9191

9292
// Modus ponens: P -> Q, P |- Q
9393
search.add("(`P -> `Q) `P `Q");
@@ -102,7 +102,7 @@ search.add("(((! `p) -> (! `q)) -> (`q -> `p))");
102102
search.add("(! (! X))");
103103

104104
// Target: X (double negation elimination)
105-
const target = new rule_t("X");
105+
const target = new Rule("X");
106106

107107
// Execute search until target is found
108108
while (true) {
@@ -236,8 +236,8 @@ A fact is a rule without premises:
236236
Grounding substitutes variables with values using a dictionary:
237237

238238
```typescript
239-
const a = new term_t("`a");
240-
const dict = new term_t("((`a b))"); // Substitute `a with b
239+
const a = new Term("`a");
240+
const dict = new Term("((`a b))"); // Substitute `a with b
241241
const result = a.ground(dict);
242242
console.log(result.toString()); // "b"
243243
```
@@ -248,9 +248,9 @@ Matching unifies the first premise of a rule with a fact to produce a new rule.
248248

249249
```typescript
250250
// Modus ponens rule: (p -> q), p |- q
251-
const mp = new rule_t("(`p -> `q)\n`p\n`q\n");
251+
const mp = new Rule("(`p -> `q)\n`p\n`q\n");
252252
// Double negation elimination axiom: !!x -> x
253-
const pq = new rule_t("((! (! `x)) -> `x)");
253+
const pq = new Rule("((! (! `x)) -> `x)");
254254
// Match produces: !!x |- x
255255
console.log(mp.match(pq).toString()); // "(! (! `x))\n----------\n`x\n"
256256
```
@@ -260,13 +260,13 @@ console.log(mp.match(pq).toString()); // "(! (! `x))\n----------\n`x\n"
260260
### TypeScript/JavaScript
261261

262262
- `buffer_size(size?: number)`: Get/set buffer size for internal operations
263-
- `string_t`: String wrapper class
264-
- `variable_t`: Logical variable class
265-
- `item_t`: Item (constant/functor) class
266-
- `list_t`: List class
267-
- `term_t`: General term class (variable, item, or list)
268-
- `rule_t`: Logical rule class
269-
- `search_t`: Search engine for inference
263+
- `String_`: String wrapper class
264+
- `Variable`: Logical variable class
265+
- `Item`: Item (constant/functor) class
266+
- `List`: List class
267+
- `Term`: General term class (variable, item, or list)
268+
- `Rule`: Logical rule class
269+
- `Search`: Search engine for inference
270270

271271
### Python
272272

0 commit comments

Comments
 (0)