ai-planning-val
Version:
Javascript/typescript wrapper for VAL (AI Planning plan validation and evaluation tools from KCL Planning department and the planning community around the ICAPS conference).
48 lines (47 loc) • 1.89 kB
TypeScript
import { utils, ProblemInfo, DomainInfo, ParsingProblem } from 'pddl-workspace';
import { URI } from 'vscode-uri';
import { ProblemPattern } from './ProblemPattern';
export declare class ParserError extends Error {
readonly message: string;
readonly domain: DomainInfo;
readonly problem?: ProblemInfo | undefined;
constructor(message: string, domain: DomainInfo, problem?: ProblemInfo | undefined);
}
export declare class ParserExitCode extends Error {
constructor(message: string);
}
/** Parser utility execution options. */
export interface ParserOptions {
/** Parser executable path, if undefined 'Parser' command will be used when spawning the process. */
executablePath?: string;
/** Current directory. If undefined, the current process `cwd` will be used. */
cwd?: string;
}
/** PDDL domain and problem parser. */
export declare class Parser {
private options;
constructor(options: ParserOptions);
protected getSyntax(): string[];
validate(domainInfo: DomainInfo, problemInfo?: ProblemInfo): Promise<ParsingProblems>;
static readonly OUTPUT_PATTERN = "/^($(filePaths))\\s*:\\s*line\\s*:\\s*(\\d*)\\s*:\\s*(Error|Warning)\\s*:\\s*(.*)$/gmi/1,3,2,0,4";
protected createPatternMatchers(context: ParserRunContext): ProblemPattern[];
private processOutput;
private validateProblem;
private runProcess;
}
export interface ParserRunContext {
domain: DomainInfo;
problem?: ProblemInfo;
fileNameMap: FileNameToUriMap;
}
declare class ParsingProblems extends utils.StringifyingMap<URI, ParsingProblem[]> {
protected stringifyKey(key: URI): string;
}
declare class FileNameToUriMap {
private map;
constructor(domainFilePath: string, uri: URI);
addProblem(problemFilePath: string, uri: URI): FileNameToUriMap;
getFilePaths(): string[];
getUri(filePath: string): URI | undefined;
}
export {};