parent
0144aba631
commit
b900978543
@ -0,0 +1,7 @@
|
|||||||
|
FROM swipl:stable
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY *.pl ./
|
||||||
|
|
||||||
|
CMD ["swipl", "-g", "consult('family.pl')", "-t", "halt"]
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
.PHONY: build run interactive clean test trace demo
|
||||||
|
|
||||||
|
# Build Docker image
|
||||||
|
build:
|
||||||
|
docker build -t lab8-task2-prolog .
|
||||||
|
|
||||||
|
# Run Prolog with family database (show basic info and exit)
|
||||||
|
run: build
|
||||||
|
docker run --rm -v $(PWD):/app lab8-task2-prolog swipl -g "consult('family.pl'), family_info_task2, halt"
|
||||||
|
|
||||||
|
# Interactive Prolog session
|
||||||
|
interactive: build
|
||||||
|
docker run -it --rm -v $(PWD):/app lab8-task2-prolog swipl family.pl
|
||||||
|
|
||||||
|
# Run test queries
|
||||||
|
test: build
|
||||||
|
docker run --rm -v $(PWD):/app lab8-task2-prolog swipl -g "consult('family.pl'), consult('tests.pl'), run_tests, halt"
|
||||||
|
|
||||||
|
# Run with tracing enabled
|
||||||
|
trace: build
|
||||||
|
docker run --rm -v $(PWD):/app lab8-task2-prolog swipl -g "consult('family.pl'), trace, fathers, notrace, halt"
|
||||||
|
|
||||||
|
# Show basic info about task2
|
||||||
|
info: build
|
||||||
|
docker run --rm -v $(PWD):/app lab8-task2-prolog swipl -g "consult('family.pl'), write('=== TASK2 INFO ==='), nl, family_info_task2, show_relationships, halt"
|
||||||
|
|
||||||
|
# Run demo
|
||||||
|
demo: build
|
||||||
|
docker run --rm -v $(PWD):/app lab8-task2-prolog swipl -g "consult('family.pl'), consult('demo.pl'), demo, halt"
|
||||||
|
|
||||||
|
# Clean Docker images
|
||||||
|
clean:
|
||||||
|
docker rmi lab8-task2-prolog || true
|
||||||
|
|
||||||
|
# Help
|
||||||
|
help:
|
||||||
|
@echo "Available commands for lab8 task2:"
|
||||||
|
@echo " make build - Build Docker image"
|
||||||
|
@echo " make run - Run and show basic family info"
|
||||||
|
@echo " make info - Show detailed task2 information"
|
||||||
|
@echo " make demo - Run demonstration queries"
|
||||||
|
@echo " make test - Run test queries"
|
||||||
|
@echo " make interactive - Start interactive Prolog session"
|
||||||
|
@echo " make trace - Run with tracing enabled"
|
||||||
|
@echo " make clean - Clean Docker images"
|
||||||
Loading…
Reference in new issue