eyeling 1.33.5 → 1.33.7
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.
- package/README.md +50 -106
- package/docs/eyelang-guide.md +550 -0
- package/docs/eyelang-language-reference.md +11 -9
- package/examples/eyelang/annotation.pl +9 -9
- package/examples/eyelang/context-association.pl +3 -3
- package/examples/eyelang/delfour.pl +7 -7
- package/examples/eyelang/dijkstra-risk-path.pl +2 -2
- package/examples/eyelang/dijkstra.pl +2 -2
- package/examples/eyelang/family-cousins.pl +1 -1
- package/examples/eyelang/gps.pl +4 -4
- package/examples/eyelang/odrl-dpv-healthcare-risk-ranked.pl +2 -2
- package/examples/eyelang/odrl-dpv-risk-ranked.pl +2 -2
- package/examples/eyelang/proof/annotation.pl +12 -12
- package/examples/eyelang/resilient-city-orchestration.pl +5 -5
- package/lib/eyelang/builtins/context.js +42 -0
- package/lib/eyelang/builtins/registry.js +2 -2
- package/package.json +1 -1
- package/test/eyelang/conformance/README.md +1 -1
- package/test/eyelang/conformance/cases/extension/006_holds_parts.pl +4 -0
- package/test/eyelang/conformance/cases/extension/026_nested_holds_parts.pl +4 -0
- package/test/eyelang/conformance/cases/extension/027_formula_member.query +1 -0
- package/test/eyelang/conformance/cases/extension/027_holds_member.pl +3 -0
- package/test/eyelang/conformance/expected/extension/006_holds_parts.out +3 -0
- package/test/eyelang/conformance/expected/extension/026_nested_holds_parts.out +3 -0
- package/test/eyelang/conformance/expected/extension/027_holds_member.out +2 -0
- package/test/eyelang/run-regression.mjs +2 -2
- package/test/packlist.test.js +1 -0
- package/examples/eyelang/INTEGRATION.md +0 -20
- package/examples/eyelang/README.md +0 -553
- package/lib/eyelang/builtins/formula.js +0 -26
- package/test/eyelang/conformance/cases/extension/006_formula_terms.pl +0 -4
- package/test/eyelang/conformance/cases/extension/026_nested_formula_terms.pl +0 -4
- package/test/eyelang/conformance/expected/extension/006_formula_terms.out +0 -2
- package/test/eyelang/conformance/expected/extension/026_nested_formula_terms.out +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Annotation with quoted formula data.
|
|
2
2
|
%
|
|
3
3
|
% The program keeps the annotation as data and derives visible relations from it.
|
|
4
|
-
%
|
|
4
|
+
% Context members become default output only when explicit rules project them.
|
|
5
5
|
|
|
6
6
|
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
7
7
|
materialize(name, 2).
|
|
@@ -18,17 +18,17 @@ annotation(t, (
|
|
|
18
18
|
|
|
19
19
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
20
20
|
name(S, O) :-
|
|
21
|
-
annotation(_T,
|
|
22
|
-
|
|
21
|
+
annotation(_T, Context),
|
|
22
|
+
holds(Context, name(S, O)).
|
|
23
23
|
|
|
24
24
|
log_nameOf(T, name(S, O)) :-
|
|
25
|
-
annotation(T,
|
|
26
|
-
|
|
25
|
+
annotation(T, Context),
|
|
26
|
+
holds(Context, name(S, O)).
|
|
27
27
|
|
|
28
28
|
statedBy(S, O) :-
|
|
29
|
-
annotation(_T,
|
|
30
|
-
|
|
29
|
+
annotation(_T, Context),
|
|
30
|
+
holds(Context, statedBy(S, O)).
|
|
31
31
|
|
|
32
32
|
recorded(S, O) :-
|
|
33
|
-
annotation(_T,
|
|
34
|
-
|
|
33
|
+
annotation(_T, Context),
|
|
34
|
+
holds(Context, recorded(S, O)).
|
|
@@ -39,9 +39,9 @@ log_nameOf(g3, (
|
|
|
39
39
|
% A tiny projection shows how a program can inspect a quoted context without
|
|
40
40
|
% making the entire context globally true.
|
|
41
41
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
42
|
-
context_statement(
|
|
43
|
-
log_nameOf(
|
|
44
|
-
|
|
42
|
+
context_statement(ContextName, Subject, Predicate, Object) :-
|
|
43
|
+
log_nameOf(ContextName, Context),
|
|
44
|
+
holds(Context, Predicate, [Subject, Object]).
|
|
45
45
|
|
|
46
46
|
dataGraph(association, skolem_g0) :-
|
|
47
47
|
context_statement(skolem_g0, bob, foaf_name, "Bob").
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
% checklist facts as relation materialization.
|
|
5
5
|
%
|
|
6
6
|
% Static input is kept as scoped data: the case, insight, policy, envelope, and
|
|
7
|
-
% signature are
|
|
7
|
+
% signature are context terms, while the product catalog is a list of records.
|
|
8
8
|
% Rules project only the fields they need, avoiding global permission/prohibition
|
|
9
9
|
% facts that could contradict another policy formula in the same program.
|
|
10
10
|
|
|
@@ -41,7 +41,7 @@ materialize(marketingProhibited, 2).
|
|
|
41
41
|
materialize(filesWrittenExpected, 2).
|
|
42
42
|
|
|
43
43
|
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
44
|
-
%
|
|
44
|
+
% Context-valued facts keep each input graph scoped and easy to project.
|
|
45
45
|
case_graph(delfourCaseGraph, (
|
|
46
46
|
caseName(case, "delfour"),
|
|
47
47
|
requestPurpose(case, "shopping_assist"),
|
|
@@ -102,11 +102,11 @@ signature_graph(delfourSignatureGraph, (
|
|
|
102
102
|
reason_text(reasonText, "Household requires low-sugar guidance (diabetes in POD). A neutral Insight is scoped to device 'self-scanner', event 'pick_up_scanner', retailer 'Delfour', and expires soon; the policy confines use to shopping assistance.").
|
|
103
103
|
|
|
104
104
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
105
|
-
case_statement(S, P, O) :- case_graph(delfourCaseGraph,
|
|
106
|
-
insight_statement(S, P, O) :- insight_graph(delfourInsightGraph,
|
|
107
|
-
policy_statement(S, P, O) :- policy_graph(delfourPolicyGraph,
|
|
108
|
-
envelope_statement(S, P, O) :- envelope_graph(delfourEnvelopeGraph,
|
|
109
|
-
signature_statement(S, P, O) :- signature_graph(delfourSignatureGraph,
|
|
105
|
+
case_statement(S, P, O) :- case_graph(delfourCaseGraph, Context), holds(Context, P, [S, O]).
|
|
106
|
+
insight_statement(S, P, O) :- insight_graph(delfourInsightGraph, Context), holds(Context, P, [S, O]).
|
|
107
|
+
policy_statement(S, P, O) :- policy_graph(delfourPolicyGraph, Context), holds(Context, P, [S, O]).
|
|
108
|
+
envelope_statement(S, P, O) :- envelope_graph(delfourEnvelopeGraph, Context), holds(Context, P, [S, O]).
|
|
109
|
+
signature_statement(S, P, O) :- signature_graph(delfourSignatureGraph, Context), holds(Context, P, [S, O]).
|
|
110
110
|
|
|
111
111
|
case_name(case, Name) :- case_statement(case, caseName, Name).
|
|
112
112
|
request_purpose(case, Purpose) :- case_statement(case, requestPurpose, Purpose).
|
|
@@ -32,8 +32,8 @@ route_network(riskNetwork, (
|
|
|
32
32
|
|
|
33
33
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
34
34
|
route_segment(From, To, Raw, Risk) :-
|
|
35
|
-
route_network(riskNetwork,
|
|
36
|
-
|
|
35
|
+
route_network(riskNetwork, Context),
|
|
36
|
+
holds(Context, segment(From, segment(To, Raw, Risk))).
|
|
37
37
|
|
|
38
38
|
candidate(pathB, [depotA, depotB, labD]).
|
|
39
39
|
candidate(pathC, [depotA, depotC, labD]).
|
|
@@ -24,8 +24,8 @@ weighted_graph(dijkstraGraph, (
|
|
|
24
24
|
|
|
25
25
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
26
26
|
base_link(A, B, Cost) :-
|
|
27
|
-
weighted_graph(dijkstraGraph,
|
|
28
|
-
|
|
27
|
+
weighted_graph(dijkstraGraph, Context),
|
|
28
|
+
holds(Context, edge(A, arc(B, Cost))).
|
|
29
29
|
|
|
30
30
|
link(A, B, Cost) :- base_link(A, B, Cost).
|
|
31
31
|
link(B, A, Cost) :- base_link(A, B, Cost).
|
|
@@ -33,7 +33,7 @@ family_graph(familyGraph, (
|
|
|
33
33
|
)).
|
|
34
34
|
|
|
35
35
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
36
|
-
family_statement(S, P, O) :- family_graph(familyGraph,
|
|
36
|
+
family_statement(S, P, O) :- family_graph(familyGraph, Context), holds(Context, P, [S, O]).
|
|
37
37
|
|
|
38
38
|
parent(Parent, Child) :- family_statement(Parent, parent, Child).
|
|
39
39
|
branch(Person, Branch) :- family_statement(Person, seedBranch, Branch).
|
package/examples/eyelang/gps.pl
CHANGED
|
@@ -39,12 +39,12 @@ map_graph(mapBE, (
|
|
|
39
39
|
|
|
40
40
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
41
41
|
case_statement(S, P, O) :-
|
|
42
|
-
case_graph(caseGraph,
|
|
43
|
-
|
|
42
|
+
case_graph(caseGraph, Context),
|
|
43
|
+
holds(Context, P, [S, O]).
|
|
44
44
|
|
|
45
45
|
map_description(From, To, Action, Duration, Cost, Belief, Comfort) :-
|
|
46
|
-
map_graph(mapBE,
|
|
47
|
-
|
|
46
|
+
map_graph(mapBE, Context),
|
|
47
|
+
holds(Context, gps_description(mapBE, description(From, true, To, Action, Duration, Cost, Belief, Comfort))).
|
|
48
48
|
|
|
49
49
|
path(From, To, [Action], Duration, Cost, Belief, Comfort) :-
|
|
50
50
|
map_description(From, To, Action, Duration, Cost, Belief, Comfort).
|
|
@@ -114,8 +114,8 @@ policy_graph(policyGraphHC1, (
|
|
|
114
114
|
|
|
115
115
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
116
116
|
policy_statement(GraphName, Subject, Predicate, Object) :-
|
|
117
|
-
policy_graph(GraphName,
|
|
118
|
-
|
|
117
|
+
policy_graph(GraphName, Context),
|
|
118
|
+
holds(Context, Predicate, [Subject, Object]).
|
|
119
119
|
|
|
120
120
|
permission(Graph, Permission) :- policy_statement(Graph, policyHC1, odrl_permission, Permission).
|
|
121
121
|
clause(Graph, Permission, Clause) :- policy_statement(Graph, Permission, clause, Clause).
|
|
@@ -98,8 +98,8 @@ policy_graph(policyGraph1, (
|
|
|
98
98
|
|
|
99
99
|
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
100
100
|
policy_statement(Subject, Predicate, Object) :-
|
|
101
|
-
policy_graph(_Graph,
|
|
102
|
-
|
|
101
|
+
policy_graph(_Graph, Context),
|
|
102
|
+
holds(Context, Predicate, [Subject, Object]).
|
|
103
103
|
|
|
104
104
|
policy(Policy, Agreement) :- policy_statement(Policy, odrl_appliesTo, Agreement).
|
|
105
105
|
permission(Policy, Rule) :- policy_statement(Policy, odrl_permission, Rule).
|
|
@@ -4,15 +4,15 @@ why(
|
|
|
4
4
|
proof(
|
|
5
5
|
goal(name(a, "Alice")),
|
|
6
6
|
by(rule("annotation.pl", clause(6))),
|
|
7
|
-
bindings([binding("S", a), binding("O", "Alice"), binding("_T", t), binding("
|
|
7
|
+
bindings([binding("S", a), binding("O", "Alice"), binding("_T", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
|
|
8
8
|
uses([
|
|
9
9
|
proof(
|
|
10
10
|
goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
|
|
11
11
|
by(fact("annotation.pl", clause(5)))
|
|
12
12
|
),
|
|
13
13
|
proof(
|
|
14
|
-
goal(
|
|
15
|
-
by(builtin(
|
|
14
|
+
goal(holds((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice"))),
|
|
15
|
+
by(builtin(holds, 2))
|
|
16
16
|
)
|
|
17
17
|
])
|
|
18
18
|
)
|
|
@@ -24,15 +24,15 @@ why(
|
|
|
24
24
|
proof(
|
|
25
25
|
goal(log_nameOf(t, name(a, "Alice"))),
|
|
26
26
|
by(rule("annotation.pl", clause(7))),
|
|
27
|
-
bindings([binding("T", t), binding("S", a), binding("O", "Alice"), binding("
|
|
27
|
+
bindings([binding("T", t), binding("S", a), binding("O", "Alice"), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
|
|
28
28
|
uses([
|
|
29
29
|
proof(
|
|
30
30
|
goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
|
|
31
31
|
by(fact("annotation.pl", clause(5)))
|
|
32
32
|
),
|
|
33
33
|
proof(
|
|
34
|
-
goal(
|
|
35
|
-
by(builtin(
|
|
34
|
+
goal(holds((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice"))),
|
|
35
|
+
by(builtin(holds, 2))
|
|
36
36
|
)
|
|
37
37
|
])
|
|
38
38
|
)
|
|
@@ -44,15 +44,15 @@ why(
|
|
|
44
44
|
proof(
|
|
45
45
|
goal(statedBy(t, bob)),
|
|
46
46
|
by(rule("annotation.pl", clause(8))),
|
|
47
|
-
bindings([binding("S", t), binding("O", bob), binding("_T", t), binding("
|
|
47
|
+
bindings([binding("S", t), binding("O", bob), binding("_T", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
|
|
48
48
|
uses([
|
|
49
49
|
proof(
|
|
50
50
|
goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
|
|
51
51
|
by(fact("annotation.pl", clause(5)))
|
|
52
52
|
),
|
|
53
53
|
proof(
|
|
54
|
-
goal(
|
|
55
|
-
by(builtin(
|
|
54
|
+
goal(holds((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), statedBy(t, bob))),
|
|
55
|
+
by(builtin(holds, 2))
|
|
56
56
|
)
|
|
57
57
|
])
|
|
58
58
|
)
|
|
@@ -64,15 +64,15 @@ why(
|
|
|
64
64
|
proof(
|
|
65
65
|
goal(recorded(t, "2021-07-07")),
|
|
66
66
|
by(rule("annotation.pl", clause(9))),
|
|
67
|
-
bindings([binding("S", t), binding("O", "2021-07-07"), binding("_T", t), binding("
|
|
67
|
+
bindings([binding("S", t), binding("O", "2021-07-07"), binding("_T", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
|
|
68
68
|
uses([
|
|
69
69
|
proof(
|
|
70
70
|
goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
|
|
71
71
|
by(fact("annotation.pl", clause(5)))
|
|
72
72
|
),
|
|
73
73
|
proof(
|
|
74
|
-
goal(
|
|
75
|
-
by(builtin(
|
|
74
|
+
goal(holds((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), recorded(t, "2021-07-07"))),
|
|
75
|
+
by(builtin(holds, 2))
|
|
76
76
|
)
|
|
77
77
|
])
|
|
78
78
|
)
|
|
@@ -45,7 +45,7 @@ reading(substation_load_percent, 94).
|
|
|
45
45
|
threshold(substation_load_percent, 85).
|
|
46
46
|
|
|
47
47
|
% The deployable skills are stored as quoted formula data and projected by
|
|
48
|
-
%
|
|
48
|
+
% holds/2, showing how policy documents can be reasoned over as data.
|
|
49
49
|
policy_bundle(response_policy, (
|
|
50
50
|
permission(medical_transport, deploy),
|
|
51
51
|
permission(cold_chain, deploy),
|
|
@@ -168,13 +168,13 @@ criticalNeed(civic_storm, map_flood_front) :-
|
|
|
168
168
|
activeSignal(civic_storm, river_surge).
|
|
169
169
|
|
|
170
170
|
policyClearance(Skill, deploy) :-
|
|
171
|
-
policy_bundle(response_policy,
|
|
172
|
-
|
|
171
|
+
policy_bundle(response_policy, Context),
|
|
172
|
+
holds(Context, permission(Skill, deploy)),
|
|
173
173
|
not(policyBlocked(Skill, deploy)).
|
|
174
174
|
|
|
175
175
|
policyBlocked(Skill, deploy) :-
|
|
176
|
-
policy_bundle(response_policy,
|
|
177
|
-
|
|
176
|
+
policy_bundle(response_policy, Context),
|
|
177
|
+
holds(Context, prohibition(Skill, deploy)).
|
|
178
178
|
|
|
179
179
|
usableRoute(Zone, route(Path, minutes(Minutes), risk(RouteRisk))) :-
|
|
180
180
|
zone(Zone),
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Context builtins that treat comma conjunctions as first-class data terms.
|
|
2
|
+
// These are used by examples that construct or inspect rule bodies programmatically.
|
|
3
|
+
import { atom, deref, isConjunction, listFromItems, unify } from '../term.js';
|
|
4
|
+
|
|
5
|
+
export const contextBuiltins = {
|
|
6
|
+
register(registry) {
|
|
7
|
+
registry.add('holds', 2, holdsTerm);
|
|
8
|
+
registry.add('holds', 3, holdsParts);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function* emitContextTerm(context, term, env) {
|
|
13
|
+
context = deref(context, env);
|
|
14
|
+
if (isConjunction(context)) {
|
|
15
|
+
yield* emitContextTerm(context.args[0], term, env);
|
|
16
|
+
yield* emitContextTerm(context.args[1], term, env);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const next = env.clone();
|
|
20
|
+
if (unify(term, context, next)) yield next;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function* emitContextParts(context, name, args, env) {
|
|
24
|
+
context = deref(context, env);
|
|
25
|
+
if (isConjunction(context)) {
|
|
26
|
+
yield* emitContextParts(context.args[0], name, args, env);
|
|
27
|
+
yield* emitContextParts(context.args[1], name, args, env);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (context.type !== 'atom' && context.type !== 'compound') return;
|
|
31
|
+
const next = env.clone();
|
|
32
|
+
const argList = context.type === 'compound' ? listFromItems(context.args) : listFromItems([]);
|
|
33
|
+
if (unify(name, atom(context.name), next) && unify(args, argList, next)) yield next;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function* holdsTerm({ goal, env }) {
|
|
37
|
+
yield* emitContextTerm(goal.args[0], goal.args[1], env);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function* holdsParts({ goal, env }) {
|
|
41
|
+
yield* emitContextParts(goal.args[0], goal.args[1], goal.args[2], env);
|
|
42
|
+
}
|
|
@@ -5,7 +5,7 @@ import { coreBuiltins } from './core.js';
|
|
|
5
5
|
import { stringBuiltins } from './strings.js';
|
|
6
6
|
import { listBuiltins } from './lists.js';
|
|
7
7
|
import { aggregationBuiltins } from './aggregation.js';
|
|
8
|
-
import {
|
|
8
|
+
import { contextBuiltins } from './context.js';
|
|
9
9
|
import { controlBuiltins } from './control.js';
|
|
10
10
|
import { portfolioBuiltins } from './portfolio.js';
|
|
11
11
|
import { searchBuiltins } from './search.js';
|
|
@@ -38,7 +38,7 @@ export class BuiltinRegistry {
|
|
|
38
38
|
|
|
39
39
|
export function createDefaultRegistry() {
|
|
40
40
|
const registry = new BuiltinRegistry();
|
|
41
|
-
for (const mod of [coreBuiltins, arithmeticBuiltins, stringBuiltins, listBuiltins, aggregationBuiltins,
|
|
41
|
+
for (const mod of [coreBuiltins, arithmeticBuiltins, stringBuiltins, listBuiltins, aggregationBuiltins, contextBuiltins, controlBuiltins, portfolioBuiltins, searchBuiltins, numberTheoryBuiltins, matrixBuiltins, alphameticBuiltins]) {
|
|
42
42
|
mod.register(registry);
|
|
43
43
|
}
|
|
44
44
|
return registry;
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ The runner executes materialized programs in-process through the public JavaScri
|
|
|
36
36
|
|
|
37
37
|
`core` covers the portable core language profile from the [eyelang language reference](../../../docs/eyelang-language-reference.md): lexical syntax, facts, definite clauses, first-order terms, lists, conjunction, structured unification through user predicates, left-to-right goal-directed proof search, materialized output, and read-back printing.
|
|
38
38
|
|
|
39
|
-
`extension` covers the standard built-in and host behavior exercised by the current reference implementation: arithmetic, comparison, strings, list relations, aggregation,
|
|
39
|
+
`extension` covers the standard built-in and host behavior exercised by the current reference implementation: arithmetic, comparison, strings, list relations, aggregation, context-term helpers, number-theory helpers, finite-search helpers used by the example corpus, matrix helpers, `memoize/2`, `materialize/2`, and default derived output.
|
|
40
40
|
|
|
41
41
|
The profile name `extension` is a test-suite grouping name. It does not mean that these cases are outside the eyelang language reference; most of them correspond to the standard built-in profile and standard host profile in the [eyelang language reference](../../../docs/eyelang-language-reference.md).
|
|
42
42
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
answer(Label, Term)
|
|
@@ -491,9 +491,9 @@ function listExampleNames() {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
function readmeCatalogExampleNames() {
|
|
494
|
-
const readme = fs.readFileSync(path.join(packageRoot, '
|
|
494
|
+
const readme = fs.readFileSync(path.join(packageRoot, 'docs', 'eyelang-guide.md'), 'utf8');
|
|
495
495
|
const section = between(readme, '## Example catalog', '## Golden outputs, tests, and conformance');
|
|
496
|
-
return [...section.matchAll(/examples\/([A-Za-z0-9_-]+)\.pl/g)]
|
|
496
|
+
return [...section.matchAll(/examples\/eyelang\/([A-Za-z0-9_-]+)\.pl/g)]
|
|
497
497
|
.map((match) => match[1])
|
|
498
498
|
.filter((name, index, names) => names.indexOf(name) === index)
|
|
499
499
|
.sort();
|
package/test/packlist.test.js
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Eyelang examples inside Eyeling
|
|
2
|
-
|
|
3
|
-
This directory contains eyelang examples that can be exercised through Eyeling's experimental second engine:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
eyeling --engine eyelang examples/eyelang/ancestor.pl
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
For a paired example, compare the N3 and eyelang versions of the same dependency-risk scenario:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
eyeling examples/vulnerability-impact.n3
|
|
13
|
-
eyeling --engine eyelang examples/eyelang/vulnerability-impact.pl
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The eyelang conformance corpus is kept under `test/eyelang/` and can be run with:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm run test:eyelang:corpus
|
|
20
|
-
```
|