#!/usr/bin/ruby

require 'relsch'

attribs = gets.chomp.split(' ')
deps = gets.chomp.split(' ')

x = RelationalSchema.new attribs, deps

puts '===Stan poczatkowy==='
puts x.inspect

_3nf = false
unless x.is2nf?
  _3nf = true
  puts '===Po przeprowadzeniu do 2PN==='
  x.to2nf.each do |r|
    puts r.inspect
    _3nf &= r.is3nf?
  end
end

if !_3nf
  puts '===Po przeprowadzeniu do 3PN==='
  x.to3nf.each do |r|
    puts r.inspect
  end
end
