Skip to content

Commit

Permalink
Add utils for defining plan items
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-berman committed Sep 9, 2024
1 parent 805ae0b commit d187f44
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/is.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InformationState from "./types";
import { objectsEqual, WHQ } from "./utils";
import { objectsEqual, WHQ, findout, consultDB } from "./utils";

export const initialIS = (): InformationState => {
const predicates = { // Mapping from predicate to sort
Expand Down Expand Up @@ -34,14 +34,8 @@ export const initialIS = (): InformationState => {
"type": "question",
"content": WHQ("booking_room"),
"plan": [
{
type: "findout",
content: WHQ("booking_course"),
},
{
type: "consultDB",
content: WHQ("booking_room"),
},
findout(WHQ("booking_course")),
consultDB(WHQ("booking_room")),
],
}
],
Expand Down
14 changes: 14 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ export function WHQ(predicate) {
predicate: predicate,
}
}

export function findout(q) {
return {
type: "findout",
content: q,
}
}

export function consultDB(q) {
return {
type: "consultDB",
content: q,
}
}

0 comments on commit d187f44

Please sign in to comment.