S-Expression 기반 구문 체계 (S-Expression Based Syntax System)

S-Expression 기반 구문 체계 (S-Expression Based Syntax System)

1. 개요

PDDL의 구문은 Lisp 프로그래밍 언어에서 유래한 S-Expression(Symbolic Expression, 기호 표현식) 체계에 기반한다. S-Expression은 괄호로 구분된 중첩 리스트 구조로, 파싱이 용이하고 재귀적 구조를 자연스럽게 표현할 수 있다는 장점을 가진다.

2. S-Expression의 기본 구조

2.1 원자 (Atom)

더 이상 분해되지 않는 기본 단위이다.

  • 기호(symbol): robot, at, move
  • 숫자(number): 10, 3.14
  • 변수(variable): ?robot, ?from

2.2 리스트 (List)

괄호로 감싸진 원자 또는 리스트의 순서 있는 집합이다.

(at ?robot ?location)
(and (at ?r ?from) (connected ?from ?to))

2.3 중첩 (Nesting)

리스트는 임의의 깊이로 중첩될 수 있다.

(define (domain robot-delivery)
  (:action move
    :parameters (?r - robot ?from ?to - location)
    :precondition (and
      (at ?r ?from)
      (not (blocked ?from ?to)))
    :effect (and
      (at ?r ?to)
      (not (at ?r ?from)))))

3. PDDL에서의 S-Expression 활용

3.1 최상위 정의

(define (domain 이름) ...)
(define (problem 이름) ...)

3.2 키워드 접두어

PDDL의 키워드는 콜론(:)으로 시작하여 일반 기호와 구분된다.

:requirements, :types, :predicates, :action, :parameters, :precondition, :effect

3.3 논리 연산자

(and expr1 expr2 ...)    ; 논리 AND
(or expr1 expr2 ...)     ; 논리 OR
(not expr)               ; 논리 NOT
(forall (?x - type) expr) ; 전칭 양화사
(exists (?x - type) expr) ; 존재 양화사

3.4 수치 연산

(+ expr1 expr2)          ; 덧셈
(- expr1 expr2)          ; 뺄셈
(* expr1 expr2)          ; 곱셈
(/ expr1 expr2)          ; 나눗셈
(= expr1 expr2)          ; 동등
(> expr1 expr2)          ; 초과
(< expr1 expr2)          ; 미만

4. S-Expression의 장점

장점설명
파싱 용이괄호 매칭만으로 구문 분석 가능
구조적 명확성중첩 구조가 시각적으로 명확
확장 가능새로운 키워드를 자유롭게 추가
도구 지원Lisp 생태계의 에디터/파서 활용 가능

5. 참고 문헌

  • McDermott, D., et al. (1998). “PDDL — The Planning Domain Definition Language.”

버전날짜변경 사항
v0.12026-04-05초안 작성