diff --git a/src/is.ts b/src/is.ts index ee416f6..71922bb 100644 --- a/src/is.ts +++ b/src/is.ts @@ -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 @@ -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")), ], } ], diff --git a/src/utils.ts b/src/utils.ts index 89b037a..3c0b8de 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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, + } +} \ No newline at end of file